I have a product with multiple options.
The user chooses how much he wants to pay for the product. First I have created a dropdown box with the values €5,- €10,- etc. The product price i have put to €0.
When I choose 10 euros, the product changes to 10 euros - that's good.
Now I want a checkbox where users can choose between Exclude Tax and Include Tax, so if I choose excluding tax the product will be inserted in the shopping cart as €10,00 witch is ok (excluding tax). But when I choose Including tax the product needs to be inserted in the shopping cart as 10 /1.21 = €8,26 (excluding tax).
How can I make this possible?
EDIT:
I have the following code:
$event = $observer->getEvent();
$quote_item = $event->getQuoteItem();
if (is_array($quote_item->getOptions())) {
foreach ($quote_item->getOptions() as $optionValue) {
echo ???? . ' --> ' . $optionValue->getValue() . '<br />';
}
}
This will give me the values from the options. But how do I get the real option_id? I get the option_type_id now.