您是否知道是否可以在后端产品页面(见附件:https://i.stack.imgur.com/Ks9Xm.jpg)中检索上一张添加的图片的id,以便在前端显示?
我在prestashop 1.6上这样做的{$link -> getImageLink($->->link_rewrite,$imageIds,‘new_img_details’)|转义:‘html’:‘UTF-8’}
但是我不知道如何在prestashop 1.7.6上做到这一点
谢谢
发布于 2020-11-02 17:23:50
你可以通过在你的模块/控制器中查询来获得最后一个位置的id_image:
$lastIdImage = Db::getInstance()->getValue('SELECT id_image FROM '._DB_PREFIX_.'image
WHERE id_product = '.$your_id_product.' ORDER BY position DESC');
然后,您可以使用getImageLink方法轻松地检索链接。
https://stackoverflow.com/questions/64646136
复制