I am looking for a way to automatically add a single flat reservation fee to the cart when a customer adds any product. I understand the “reservation fee” will need to be setup as a product itself to work around this. I am hoping to find the coding for this, because I do not want to use an app. I am using Dawn theme,
Yes it’s possible without an app.
You can take an idea from this code
/* Custom Code */
if(anycondition){ // if any condition you want to set
var quant = 1; // Product quntity
var ID = ProductID; // Pass product ID here
jQuery.ajax({
type: 'POST',
url: '/cart/add.js',
data: {
quantity: 1,
id: ID
},
dataType: 'json',
success: function(res) {
console.log(res);
}
});
}
/* Ends here */