Hi @nuwud
I assume you know javascript code. You should be able to use this code below to add the product or variant.
let formData = {
'items': [{
'id': 36110175633573,
'quantity': 2
}]
};
fetch(window.Shopify.routes.root + 'cart/add.js', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(formData)
})
.then(response => {
return response.json();
})
.catch((error) => {
console.error('Error:', error);
});
You can also use this, just change the id and the quantity.
fetch('cart/add?id=44132404560157&quantity=1&id=44132404887837&quantity=1')
If you refresh the page, the HTML should update. If you want to update without refreshing, you might want to read your theme codes and see where you can insert the code.
I recommend to NOT use jquery if your theme does not support it. It will make your website slower.
I hope I helped. Please don’t forget to Like and Mark Solution to the post that helped you. Thanks!