I have added a product option with a percentage discount. check the below screenshot.
And it is showing perfectly on the front end. check the below screenshot.
By default, Magento applies custom option price to base price. but I want to apply the custom option price to the final price, not to the base price.
For Ex: I have 2 custom option Option X and option Y, option X has 2 value 345 and 410(product default base price is 345) And Option Y has 2 value 0.00(percent) and 15.00(percent)
Now when I select the value of option X = 410 then product price is 410 and then select option Y value = 15.00(percent) then it will apply the 15% to base price(345) not the final price 410, so I want to apply the custom option price to the final price(410) not the base price(345).
So can anyone help me out this how can I achieve this thing? Any help would be appreciated!
========================================================================== EDIT :
It is doesn't matter what is the order of select the custom options. actually, I want to calculate the percentage of the final price of the product after selected the custom option.
I have 2 custom options:
- Option A[Fixed amount] (which have 2 values)
- Option B[Percent amount] (which have 2 values)
Now in the case when select option A = 345 and option B = 15% then product price will display (345 X 15/100 = 51.75)+(345) = 396.75
And in the case when select option A= 410 and option B = 15% then product price should be display (410 X 15/100 = 61.5)+(410) = 471.5 but it is displaying (345 X 15/100 = 51.75)+(410) = 461.7
Because by default Magento calculates the custom option percentage to the base price(345) of the product not the final price(410) of the product.
So basically how many options you have selected and what is the order of selected custom option it doesn't matter. But I just want when I select the percentage custom option then I want to calculate the final price (which is displaying after selecting options) of percentage.