Jump to content

[Solved] Cart problem


Recommended Posts

Under customers> carts I have carts that is filling without any customer on the website. I use livezilla tracker and nobody is on my website, but every while one cart keep growing till 4500 €. If I delete this card here it comes one new that do the same.

Anybody have any idea?


Thanks

Link to comment
Share on other sites

Could you please check if I done this right. I add one robot that is for my country maybe because this I still get cards. What would not surprise me that such small serch engines don't respect robots.txt

<?php

require_once(dirname(__FILE__).'/config/config.inc.php');
require_once(dirname(__FILE__).'/init.php');
/**robot generating carts, predelava**/
if (strpos($_SERVER['HTTP_USER_AGENT'],'bot') !== false || 
    strpos($_SERVER['HTTP_USER_AGENT'],'baidu') !== false ||
    strpos($_SERVER['HTTP_USER_AGENT'],'spider') !== false ||
    strpos($_SERVER['HTTP_USER_AGENT'],'Ask Jeeves') !== false ||
    strpos($_SERVER['HTTP_USER_AGENT'],'slurp') !== false ||
    strpos($_SERVER['HTTP_USER_AGENT'],'crawl') !== false ||
    strpos($_SERVER['HTTP_USER_AGENT'],'spider.najdi.si') !== false)
{
   Header( "HTTP/1.1 301 Moved Permanently" );
   Header( "Location: ".__PS_BASE_URI__);
   exit; 
} 
/**robot generating carts, predelava - KONEC**/
$errors = array();

$orderTotal = $cart->getOrderTotal(true, 1);

$cartDiscounts = $cart->getDiscounts();
foreach ($cartDiscounts AS $k => $cartDiscount)
   if ($error = $cart->checkDiscountValidity(new Discount(intval($cartDiscount['id_discount'])), $cartDiscounts, $orderTotal, $cart->getProducts()))
       $cart->deleteDiscount(intval($cartDiscount['id_discount']));

$add = Tools::getIsset('add') ? 1 : 0;
$delete = Tools::getIsset('delete') ? 1 : 0;



the cart.php continue, I cuted it because the modification is on top...

Link to comment
Share on other sites

×
×
  • Create New...