Reputation: 41
I want to update custom price as hidden option from product details page on click "Add to Cart"....
Like product price is $10
Custom price $5
Total= $15 (I want this needs to added to cart)
Custom price will be changed everytime on selection of custom options in product details page..
So any one can help me out for this how could I do this in shopify????
Thanks
Upvotes: 4
Views: 3868
Reputation: 682
You can do some JavaScript
//update price when changing quantity
function updatePricing() {
jQuery('#quantity').val(jQuery('#choose-select-value option:selected').val());
var quantity = jQuery('#choose-select-value').val();
var unitPriceTotal = jQuery('.product .total-price').text();
var totalPrice = unitPriceTotal * quantity;
jQuery('.product .price').html().replace(regInput ,totalPrice);
}
Upvotes: 0
Reputation: 15437
Make variants to cover the different options. give each one its own price.
Upvotes: 1