Jeet Kune Do Posted March 5, 2011 Share Posted March 5, 2011 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 More sharing options...
tomerg3 Posted March 5, 2011 Share Posted March 5, 2011 It's probably created by search engines, I have posted some code on how to avoid that here, try to do a search for it in the forum (can't remember the thread off the top of my head).Tomer. Link to comment Share on other sites More sharing options...
Jeet Kune Do Posted March 5, 2011 Author Share Posted March 5, 2011 Thank you very much Tommer. I will take a look. Link to comment Share on other sites More sharing options...
Jeet Kune Do Posted March 5, 2011 Author Share Posted March 5, 2011 I think I found your post:http://www.prestashop.com/forums/viewthread/53013/P30/configuring___using_prestashop/robots_generating_cartsI don't know which fix to apply, yours or the newest ones. Could you please take a look and point me in the right dirrection?Thank you in advance! Link to comment Share on other sites More sharing options...
tomerg3 Posted March 5, 2011 Share Posted March 5, 2011 I know mine works, I don't know know about the others. Link to comment Share on other sites More sharing options...
Jeet Kune Do Posted March 5, 2011 Author Share Posted March 5, 2011 Ok. Perfect. I have one more questions.Would my "rank" be hurt because this modification? Link to comment Share on other sites More sharing options...
tomerg3 Posted March 5, 2011 Share Posted March 5, 2011 The only thing it does it prevent search engines from accessing cart.php...... Link to comment Share on other sites More sharing options...
Jeet Kune Do Posted March 5, 2011 Author Share Posted March 5, 2011 #tomerg3Ok. I will give it a go.Thank you very much for your efforts in support us, I really appreciate it!Have a great time.Regards! Link to comment Share on other sites More sharing options...
Jeet Kune Do Posted March 6, 2011 Author Share Posted March 6, 2011 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 More sharing options...
tomerg3 Posted March 6, 2011 Share Posted March 6, 2011 You don't need to add "spider.najdi.si" since the code already looks for anything with "spider" Link to comment Share on other sites More sharing options...
Jeet Kune Do Posted March 6, 2011 Author Share Posted March 6, 2011 Ok. Thank you for your info.But unfortunatly I had more robots generated carts also with this modification. Link to comment Share on other sites More sharing options...
Radu Posted March 6, 2011 Share Posted March 6, 2011 also check this posthttp://www.prestashop.com/forums/viewthread/54548/seo_search_engine_optimization/robots_dot_txt_what_should_it_contain_and_be_placedbasically create a robots.txt that will tell spiders not to index cart.php (the link where the add to cart buttons point to) Link to comment Share on other sites More sharing options...
Recommended Posts