0

我正在使用 PrestaShop 1.4.8.2

我需要用产品生成 xml 文件,我找到了一个脚本。除了图像路径(路径用于旧图像文件系统,我正在使用新文件系统)外,一切正常。

现在图片路径是:http ://www.mydomain.com/img/p/57-56-large.jpg

但图片位于: http ://www.mydomain.com/img/p/1/0/0/3/17-32-large.jpg http://www.mydomain.com/img/p/2 /0/0/3/61-50-large.jpg http://www.mydomain.com/img/p/3/1/6/3/29-75-large.jpg http://www.mydomain .com/img/p/3/0/4/3/25-11-large.jpg ...

此行获取图像路径:

http://www.mydomain.com".__PS_BASE_URI__."img/p/".$image[0]['id_product']."-".$image[0]['id_image']."-large.jpg
4

1 回答 1

4

你为什么要使用这个getProductLink功能?它返回产品/类别/供应商/制造商的正确链接。如果您想获得指向产品图像的正确链接,请使用$link->getImageLink($name, $ids, $type = NULL).

@param string $name rewrite link of the image
@param string $ids id part of the image filename - can be "id_product-id_image" (legacy support, recommended) or "id_image" (new)
@param string $type

问候

于 2012-12-14T15:07:11.500 回答