1

我在使用外部网站上的 BuyButton JS 库更改 Shopify 购物车上的货币符号时遇到问题。

我在这篇文章中看到有人设法通过使用 moneyFormat 选项来解决它。但是当我这样做时,什么都没有改变:/

这是我的代码:

ui.createComponent('cart', {
    toggles: [{
        node: document.getElementById('cart_icon'),
    }],
    options: {
        toggle: {
            sticky: false,
            iframe: false,
        },
        cart: {
            popup: true,
            iframe: true,
            contents: {
                note: false
            },
            text: {
                currency: 'GBP',
            }
        }
    }
})

if (!product_id) {
    return
}

ui.createComponent('product', {
    id: product_id,
    node: document.getElementById('product_holder'),
    moneyFormat: '£{{amount}}',
    currency: 'GBP',
    iframe: true,
    options: {
        moneyFormat:'£{{amount}}',
        product: {
            layout: 'hortontal',
            contents: {
                description: false
            },
            styles: {
                button: {
                    'background-color': '#EB64A0',
                    ':hover': {
                        'background-color': '#CF2A75'
                    }
                }
            },
        }
    }
})

欢迎任何帮助,谢谢!

4

0 回答 0