Prestashop1.6 更改默认产品带水印的thickbox

Prestashop1.6 Change Default Product thickbox with watermark

在 product.tpl 中,我通过编辑此代码设法更改了 thickbox 的默认大小

href="{$link->getImageLink($product->link_rewrite, $imageIds, 'thickbox_default')|escape:'html':'UTF-8'}"   

href="{$link->getImageLink($product->link_rewrite, $imageIds, '')|escape:'html':'UTF-8'}"   

现在的问题是水印不起作用,请注意我使用了 prestashops 默认水印模块。

prestashop 提供了一个称为图像类型的功能,我们可以在其中创建自定义图像类型并提供宽度、高度和图像类型用于(类别、产品、制造商等),我们可以在 tpl 中使用此图像类型或 php 代码(如有需要)。

水印模块为除原图外的所有图片类型绘制水印。因此,对于您的情况,我们可以创建一个名为 custom_default 的新图像类型,我们可以在您的 tpl 文件中使用它

getImageLink($name, $ids, $type = null)

getimagelink 方法接受3个参数,第3个参数是图片类型,不是必需的,默认为null。因此,如果我们传递第三个参数,将返回具有所提供类型的图像,否则将返回原始图像。因此,只需将我们的新图像类型作为第 3 个参数

的值传递来修改您的 tpl 代码
href="{$link->getImageLink($product->link_rewrite, $imageIds, 'custom_default')|escape:'html':'UTF-8'}"