Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /home/vape/domains/woodenspasolutions.co.uk/public_html/wp-content/plugins/woocommerce-product-addons/classes/class-product-addon-cart.php on line 314

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /home/vape/domains/woodenspasolutions.co.uk/public_html/wp-content/plugins/woocommerce-product-addons/classes/class-product-addon-cart.php on line 331

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /home/vape/domains/woodenspasolutions.co.uk/public_html/wp-content/plugins/woocommerce-product-addons/classes/class-product-addon-cart.php on line 364

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /home/vape/domains/woodenspasolutions.co.uk/public_html/wp-content/plugins/woocommerce-product-addons/classes/class-product-addon-cart.php on line 383
Wooden SPA Solutions – Product Other Accessories – Wooden Lid

Wooden Lid

jQuery(document).ready(function($) { console.log('swx'); // Whenever a .wapf-input is selected (or deselected), calculate the total $('.wapf-input').on('change', function() { console.log('change'); // Step 1: Sum selected .wapf-input values with data-wapf-price="300" var sumSelected = 0; $('.wapf-input:checked').each(function() { if($(this).data('wapf-price') === "300") { sumSelected += parseFloat($(this).data('wapf-price')); } }); // Step 2: Get the value from the specified span and remove non-numeric characters var priceSpanValue = $('.woocommerce-Price-amount.amount').text(); var numericValue = parseFloat(priceSpanValue.replace(/[^\d.-]/g, '')); // Step 3: Calculate the total and display it (or use it as needed) var total = sumSelected + numericValue; console.log("Total: £" + total); // You might want to display this total somewhere on the page // $('#someElement').text("Total: £" + total); }); });