prestashopprestashop-1.6prestashop-1.7

PrestaShop $link ->getProductLink($product) gives incorrect URL


I'm generating my product links in custom ajax powered module with $link -> getProductLink($product)

it's generating a URL like http://example.com/prestashop/2-blouse.html

which is throwing an error saying

[Debug] This page has moved Please use the following URL instead: http://example.com/prestashop/blouses/2-blouse.html

How do I avoid the same whithout Set _PS_MODE_DEV_ to false in config/defines.inc.php.

Thanks

P.S: I'm using prestashop 1.7


Solution

  • Try out this (free) module.
    But to awnser your question {$link->getProductLink($smarty.get.id_product, $smarty.get.id_product.link_rewrite)|escape:'htmlall':'UTF-8'}