18910140161

PHP-如何添加HTML代码以在产品图像上显示徽标-堆栈溢出

顺晟科技

2022-10-18 13:43:57

149

我有一个来自价格比较网站的脚本,我想在我的WooCommerce产品页面上使用,这样如果我的产品价格在价格比较网站上更便宜,那么产品图像上就会出现一个徽标,如下所示:

enter image description here

我收到

的脚本如下,他们告诉我为所有产品页面设置此脚本。[商品_编号]应替换为WooCommerce SKU.有人能帮助我在WooCommerce中添加此脚本以获得所需的结果吗?我想我可能需要在子主题的functions.PHP下调用一个动作,不确定到底要调用哪个钩子等等。

<代码><;a href=";https://instore.prisjakt.nu/cheapest_redirect.php?id=[商品_编号]&;f=123456";target=";_空白";>;<;IMG SRC=";https://instore.prisjakt.nu/cheapest.php?id=[商品_编号]&;f=123456";/>;<;/a>;

我尝试了下面的代码,但它不工作。

<a href="https://instore.prisjakt.nu/cheapest_redirect.php?id=[article_number]&f=123456" target="_blank"><img src="https://instore.prisjakt.nu/cheapest.php?id=[article_number]&f=123456" /></a>

顺晟科技:

  • TAG:
相关文章
我们已经准备好了,你呢?
2024我们与您携手共赢,为您的企业形象保驾护航