mozack Posted October 10, 2010 Share Posted October 10, 2010 Hi,I have the module cross selling installed but i found an small error in link rewrite. The problem is that the link that appear when we click on product shown in cross selling module is without the category in url, and all other modules insert category name in url.This is duplicate url for google.Ex.: my products have this url: example.com/category-name/product-name.html.In cross selling the url is: example.com/product-name.htmlHope someone can help meRegardsMozack Link to comment Share on other sites More sharing options...
rocky Posted October 10, 2010 Share Posted October 10, 2010 It looks like you've found a bug! Try changing line 57 of modules/crossselling/crossselling.php from: $orderProduct['link'] = $link->getProductLink(intval($orderProduct['product_id']), $orderProduct['link_rewrite']); to: $product = new Product(intval($orderProduct['product_id']), false, intval($cookie->id_lang)); $category = new Category(intval($product->id_category_default), intval($cookie->id_lang)); $orderProduct['link'] = $link->getProductLink(intval($orderProduct['product_id']), $orderProduct['link_rewrite'], $category->link_rewrite); If this work for you, I will post it on the bug tracker. 1 Link to comment Share on other sites More sharing options...
mozack Posted October 10, 2010 Author Share Posted October 10, 2010 Hi,It doesn't work for me I need to add or edit something in tpl file?RegardsMozack Link to comment Share on other sites More sharing options...
rocky Posted October 11, 2010 Share Posted October 11, 2010 I don't know what I was thinking when I wrote that code. I completely skipped a step. I've now fixed my code above. Try again. Link to comment Share on other sites More sharing options...
mozack Posted October 11, 2010 Author Share Posted October 11, 2010 Hi Rocky,Thanks. Now it works! Thanks a lot. Maybe it change the problem with duplicate content.RegardsMozack Link to comment Share on other sites More sharing options...
Engkus Kusnadi Posted April 7, 2011 Share Posted April 7, 2011 I have problem to show and get manufacturer_name in module “cross selling”, that relational database is not found. Could you tell me this problem ?in .php$orderProducts = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' SELECT DISTINCT od.product_id, pl.name, pl.link_rewrite, p.reference, i.id_image, p.show_price, cl.link_rewrite category, p.ean13 FROM '._DB_PREFIX_.'order_detail od LEFT JOIN '._DB_PREFIX_.'product p ON (p.id_product = od.product_id) LEFT JOIN '._DB_PREFIX_.'product_lang pl ON (pl.id_product = od.product_id) LEFT JOIN '._DB_PREFIX_.'category_lang cl ON (cl.id_category = p.id_category_default) LEFT JOIN '._DB_PREFIX_.'image i ON (i.id_product = od.product_id) WHERE od.id_order IN ('.$list.') AND pl.id_lang = '.(int)($cookie->id_lang).' AND cl.id_lang = '.(int)($cookie->id_lang).' AND od.product_id != '.(int)$params['product']->id.' AND i.cover = 1 AND p.active = 1 ORDER BY RAND() LIMIT 10');in .tpl{$orderProducts.manufacturer_name|escape:'htmlall':'UTF-8'} Link to comment Share on other sites More sharing options...
ImpulsoTecnologico Posted November 12, 2012 Share Posted November 12, 2012 Rocky, you are my hero! I fixed my problem with crosselling with this. I'm using PS 1.3.5.0 Link to comment Share on other sites More sharing options...
Recommended Posts