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 に答える