Prestashop通过CSV文件导入图片问题

By | 2010/08/22

Prestashop可以通过CSV文件来导入数据, 对于有大量数据要添加是情况,  这个功能就很有用处了.  产品的图片也可包含在CSV文件中, 在Prestashop通过CSV文件导入图片中却碰到了问题.

本来想当然就是Image URLs 直接用/upload/img/sam.jpg这样的形色, 导入的时候去会出错:

显示: Error copying image

prestashop_csv_images_erro

Prestashop通过CSV文件导入图片出错

网上解释说import带图片的商品时,系统会将你的图片从现有路径拷贝到商品图片目录,无需自己上传图片到商品图片目录。也就是就是导入功能会将你http://youdomain.com/upload/imgs /closes/tshirt/aaa.gif和http://youdomain.com/upload/imgs/accessories /necklace/bbb.gif拷贝到/img/p目录,并以商品ID重新命名。

于是就试着用绝对地址就是 http://www.domain.com/upload/img/sam.jpg 这样的形式. 还是不成功.

最后才看到有人说:

I see that you use a full URL in your image field. That will not work, at least not for me.
I suggest to upload your images to a new folder and then use a relative path.
I have put my images in my theme :
/themes/mytheme/img/products
In the csv file i point to the image like this : ../themes/mytheme/img/products/exampleimage.jpg

把urls改成相对于管理目录 ../upload/img/sam.jpg 测试成功了.  看来prestashop也是通过后台管理系统直接按URL来拷图片的.

One thought on “Prestashop通过CSV文件导入图片问题

Comments are closed.