如何将自定义代码添加到prestashop
How to add custom code to prestashop
我正在尝试将以下代码添加到我的prestashop网站,以便能够显示我的谷歌信任网站徽章:
<!-- BEGIN: Google Trusted Stores -->
<script type="text/javascript">
var gts = gts || [];
gts.push(["id", "STORE_ID"]);
gts.push(["badge_position", "BOTTOM_RIGHT"]);
gts.push(["locale", "english_australia"]);
gts.push(["google_base_offer_id", "ITEM_GOOGLE_SHOPPING_ID"]);
gts.push(["google_base_subaccount_id", "ITEM_GOOGLE_SHOPPING_ACCOUNT_ID"]);
gts.push(["google_base_country", "ITEM_GOOGLE_SHOPPING_COUNTRY"]);
gts.push(["google_base_language", "ITEM_GOOGLE_SHOPPING_LANGUAGE"]);
(function() {
var gts = document.createElement("script");
gts.type = "text/javascript";
gts.async = true;
gts.src = "https://www.googlecommerce.com/trustedstores/api/js";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(gts, s);
})();
</script>
<!-- END: Google Trusted Stores -->
我需要它在每一页上都可见,无论我做什么,我都无法让它显示徽章。
很可能
你需要安装一个模块来添加自定义html.
这是一个要添加到底部/页脚区域.
http://www.prestashop.com/forums/topic/165066-free-prestashop-module-easy-footer/您可以在页脚区域添加自定义HTML内容,它将对整个网站可见。
有点晚了,但最简单的方法是创建一个 js 文件,并将其放在您的主题脚本文件夹中:/themes/yourtheme/js/autoload这样它就会加载到每个页面上。
最简单的方法是在 header.tpl 中插入代码。
相关文章:
- 正在添加'X'按钮,在文本字段旁边使用javascript
- 如何在映射数组中添加换行符
- 正在将数据主题添加到所有项目
- ZeroClipboard-在复制之前添加到值
- 我可以在json对象中添加一个函数吗
- 将输入字段中的文本提交到我的数据库,同时将其添加到我的列表中
- 正在SharePoint 2013母版页中添加JQuery移动文件
- 如何添加浮动和非浮动,其他
- 添加文字和评论功能更新Div
- 如果使用 lodash 将属性存在于另一个对象中,则向对象添加属性
- 动态地改变“”的URL;添加新项目”;链接使用javascript/jquery
- 在函数中添加数组元素的数值
- 如何将歌曲添加到jPlayer
- 在html Select中添加搜索
- 将Google AdWords转换跟踪(javascript)代码添加到PrestaShop/Smarty页面中
- Prestashop - 如何添加内联脚本
- 如何将自定义代码添加到prestashop
- 将自定义Javascript添加到Prestashop
- PrestaShop:使用smarty添加javascript数组元素
- 将JScript添加到prestashop CMS页面