-
Notifications
You must be signed in to change notification settings - Fork 121
Open
Labels
Description
The JS buy SDK has a way to add custom attributes. I cannot find an equivalent way to add those to line items in the cart when using the JS buy button. I have tried to add them items to the cart manually following the instructions linked above - but cannot find any documentation on how to get the checkout ID. "client.checkout.id" is unassigned.
`
ui.createComponent('product', {
id: 2461692624960,
node: document.getElementById('shopifynode'),
options: {
product: {
buttonDestination: 'cart',
},
cart: {
startOpen: true,
'events': {
}
}
}
}).then((c) => {
const lineItem = {variantId: 'Z2lkOi8vc2hvcGlmeS9Qcm9kdWN0VmFyaWFudC8yMjkyOTcwMjU4NDM4NA==', quantity: 1};
client.checkout.addLineItems(client.checkout.id, [lineItem]).then((updatedCheckout) => {
//checkoutWindow.location = updatedCheckout.webUrl;
console.log(checkout.lineItems);
});
}
`
edalzell and wolfgangschoeffel