I want to add a checkbox to products in certain categories in my online shop, but when the checkbox is ticked it will need to add ‘x’ amount to the total of the product.
To complicate things further, the product is total is calculated by (area x product price) after the user has inputted their required Length and Width, the checkbox will need to use the area value and then multiply the area by 2.5 and then add that sub-total to the grand total of the product. It’s an add-on to the product. If you catch my drift?
Here’s a link to a sample product page. The products are carpets, so when you to tick the checkbox, the carpets will have a stain protection applied and will be charged for.
Is there any snippet of code that could help me here?
So it was a relatively easy solution. It was just a case of turning the product into a variable product and using attributes to make a “yes or no” drop-down box, with one of the options having an increased price. This makes the price change before the area is calculated, unlike the ‘product add-ons’ plugin, which adds on after.
I can’t believe it took me two weeks to find the answer to this.