0
¡HOLA,从分类页面获取一个产品的信息在Magento
我想成立这个该死的谷歌信任我的Magento网站商店脚本。我似乎Google希望我将以下JavaScript添加到每个页面,并只从每个页面调用一个产品。这对产品页面没问题,但是在类别页面等其他页面上遇到了一些麻烦。我想我可以以某种方式将脚本添加到template/catalog/product/list.phtml因此无论如何,我想知道是否可以将PHP的每个类别页面上的第一个产品列表添加到Google javascript?
有没有人想出了如何将脚本添加到Google想要的Magento中,或者是否有一个关于它的教程?
下面是谷歌的javascript:
<!-- BEGIN: Google Trusted Stores -->
<script type="text/javascript">
var gts = gts || [];
gts.push(["id", "xxxxxx"]);
gts.push(["google_base_offer_id", "<?php echo $this->htmlEscape($_product->getSku()) ?>"]);
gts.push(["google_base_subaccount_id", "xxxxxxxx"]);
gts.push(["google_base_country", "US"]);
gts.push(["google_base_language", "EN"]);
(function() {
var scheme = (("https:" == document.location.protocol) ? "https://" : "http://");
var gts = document.createElement("script");
gts.type = "text/javascript";
gts.async = true;
gts.src = scheme + "www.googlecommerce.com/trustedstores/gtmp_compiled.js";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(gts, s);
})();
</script>
<!-- END: Google Trusted Stores -->
感谢