Craft Commerce Product Options that increase price, but do NOT affect stock My client wishes to sell artwork online. They're all one-off pieces and once one is sold, it should not be available to purchase thereafter.
However, the artwork needs to have an option to be framed which would increase the price.
I can't see how this can be achieved with Variants as each variant has their own stock level.
Worked it out!
Putting this in a custom module should do the trick..., obviously changing the price modifier and option name to your needs.
        Event::on(
            LineItems::class,
            LineItems::EVENT_POPULATE_LINE_ITEM,
            function(LineItemEvent $event) {
                // @var LineItem $lineItem
                $lineItem = $event-&gt;lineItem;
                // @var bool $isNew
                $isNew = $event-&gt;isNew;

                if (isset($lineItem-&gt;options['giftWrapped']) &amp;&amp; $lineItem-&gt;options['giftWrapped'] == 'yes') {
                    $lineItem-&gt;price += 20;
                }
            }
        );