I want to add the button ADD TO CART in theme MOTION

Guys please help me i want to Add the BUTTON "ADD TO CART in the theme MOTION

@Wail2022 ,


Try this code.

On which pages you want to add ?

Have you checked in customizer area?

what if we want to add “Add to cart” & “Buy now” button on every product on the website?

What can I do if I have a Fetch API issue. I found this code, but I can’t seem to get it to work when I paste it.

// Use fetch API to add the item to the cart

fetch(url, {

method: ‘POST’,

body: formData,

})

.then(response => {

if (response.ok) {

// Redirect to the cart page after adding the item

window.location.href = ‘/cart’;

} else {

// Handle errors here (optional)

console.error(‘Error adding to cart:’, response.statusText);

}

})

.catch(error => {

console.error(‘Fetch error:’, error);

});

});

});