Automatically Add Reservation Fee To Cart When Product Is Added

Hello,

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,

Hello @LARVPark ,

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 */

Thanks

Where in the Dawn theme code would I need to paste this?

The code is just to take an idea, don’t use it directly in the theme if you’re comfortable with the code.