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.

            function(LineItemEvent $event) {
                // @var LineItem $lineItem
                $lineItem = $event->lineItem;
                // @var bool $isNew
                $isNew = $event->isNew;

                if (isset($lineItem->options['giftWrapped']) && $lineItem->options['giftWrapped'] == 'yes') {
                    $lineItem->price += 20;
| improve this answer | |
  • 1
    Yeh that's the way I'd do it, too. Feel free to set this as the accepted answer if you'd like. – RitterKnight Aug 14 at 14:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.