我正在尝试使用以下代码在 Adobe Business Catalyst 网站上以葡萄牙语制作自定义警报消息:Customizing Online Shop Alert Message Strings
并自定义在线商店布局字符串,例如“购物车为空!继续购物”和“1 件商品,总计:12,00 欧元查看购物车”到“Carrinho de compras vazio!continuar as compras”。和“1 件,总计:€ 12,00 VER CARRINHO DE COMPRAS”使用我在 Adobe 论坛某处找到的这段代码:
<script type="text/javascript">
var ele = GetElementsByClass('cartLink');
if(ele[0]) ele[0].innerHTML = 'O CARRINHO DE COMPRAS ESTÀ `enter code here`VAZIO!';// replace with your own message!
function UpdateProductExtras(c, p, res) {
document.getElementById('catCartDetails').innerHTML = 'O carrinho de compras está vazio! <a href="/catalogos">VOLTAR</a>'; // replace with your own message!
}
/*
var ele = GetElementsByClass('cartSummaryItem');
if(ele[0]) ele[0].innerHTML = 'Carrinho de compras vazio.';// replace with your own message!
function UpdateProductExtras(c, p, res) {
document.getElementById('cartSummaryItem').innerHTML = 'Carrinho de compras vazio.'; // replace with your own message!
}*/This one works but if we click to buy something then this doesn't show: "1 item(s), Total: €12,00 VIEW CART"
var ele = GetElementsByClass('cartSummaryLink');
if(ele[0]) ele[0].innerHTML = 'Ver carrinho de compras >';// replace with your own message!
function UpdateProductExtras(c, p, res) {
document.getElementById('cartSummaryLink').innerHTML = 'Ver carrinho de compras >'; // replace with your own message!
}
</script>
这段代码似乎可以工作,但是每次 BC 触发一个弹出窗口,比如我们将新产品添加到购物车或点击空购物车按钮时,它们都会返回英文的原始字符串,并且只有当我们刷新浏览器或移动到另一个目录并继续购物时,消息会返回葡萄牙语。如何解决这个问题?
来自自定义在线商店警报消息字符串的 js 文件中的弹出窗口消息也是如此,如果我们刷新浏览器,它们只会更改为葡萄牙语,每次我们执行新操作时,弹出窗口消息都会恢复为英文。