首页 > 解决方案 > PrestaShop $link ->getProductLink($product) 给出不正确的 URL

问题描述

我正在使用自定义 ajax 驱动模块生成我的产品链接$link -> getProductLink($product)

它正在生成一个类似http://example.com/prestashop/2-blouse.html的 URL

这是抛出一个错误说

[调试] 此页面已移动 请改用以下 URL: http ://example.com/prestashop/blouses/2-blouse.html

如何避免在 config/defines.inc.php 中将 _PS_MODE_DEV_ 设置为 false 的情况。

谢谢

PS:我正在使用 prestashop 1.7

标签: prestashopprestashop-1.6prestashop-1.7

解决方案


试试这个(免费)模块。
但是为了解决你的问题{$link->getProductLink($smarty.get.id_product, $smarty.get.id_product.link_rewrite)|escape:'htmlall':'UTF-8'}


推荐阅读