Access a community of over 900,000 Shopify Merchants and Partners and engage in meaningful conversations with your peers.
how I can add a line item on the buy button with js code
here is my code
I refer to the Shopify document https://shopify.github.io/buy-button-js/customization/ but not working
ShopifyBuy.UI.onReady(client).then(function (ui) {
ui.createComponent('product', {
id: '5843095158948',
node: document.getElementById('product-component-1612677248591'),
moneyFormat: '%C2%A3%7B%7Bamount_no_decimals%7D%7D',
options: {
"product": {
contents: {
description: true,
quantity: true,
note: true,
lineItem: true,
lineItems: true,
quantityDecrement: true,
quantityIncrement: true,
},
order: [
'img',
'title',
'variantTitle',
'price',
'note',
'options',
'lineItems',
'lineItem',
'description',
'quantity',
'button',
],