prestashop 如何加载图像? [英] How does prestashop loads Images?

查看:42
本文介绍了prestashop 如何加载图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在同一个 ftp 中托管了 2 个 prestashop 商店,其中一个具有相同的产品,其中一个加载了所有图像(超过 9k),另一个没有,我想知道 prestashop 加载图像的控制器和功能是什么.

I have 2 prestashop stores hosted in the same ftp with the same products one of them have all the images loaded (Over 9k) and the other has none, I want to know from what controller and function does prestashop loads the images.

我知道图像存储在/img/p {digits with slashes}/product_id.jpg 所以我唯一缺少的是图像在前端加载的地方,所以我可以改变那个功能和使其指向另一家商店的照片,以避免将每张照片上传到第二家商店的工作.

I know the images are stored inside /img/p {digits with slashes}/product_id.jpg so the only thing I'm missing is the place where the images are loaded in the front end so I can alter that function and make it point to the photos of the other shop in order to avoid the job of uploading each of the photos on the second store.

我有 php 知识,所以我正在寻找一种方法来硬编码"这个功能.知道这不是正确的工作方式,我希望开发一个允许我这样做的脚本.

I have php knowledge so I'm looking for a way to "hardcode" this functionality. Knowing that its not the proper way to work it I'm looking to develop a script that allows me to do this.

推荐答案

Product 的图片路径与 product id 无关,而是与 image id 相关.例如:id_image =35 路由应该是 /img/p/3/5/35.jpg您可以在 DB 的 ps_image 表中找到图像和产品之间的关系.

Product's images routes are not related to product id, but related to image id. For example: id_image =35 route should be /img/p/3/5/35.jpg You can find relation between image and product in ps_image table in DB.

图像链接在位于 classes/Link.phpLink::getImageLink 函数中动态形成.如果你想做一些修改,这是最好的地方.

Images link are dynamically formed in Link::getImageLink function located at classes/Link.php. If you want to do some modification this is the best place to do it.

祝你好运

这篇关于prestashop 如何加载图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆