commerce icon indicating copy to clipboard operation
commerce copied to clipboard

Support variant for set sale price

Open mostafasoufi opened this issue 4 years ago • 3 comments

It could allow setting the sale price during custom initial events, something like this:

public function events()
{
    return [
        Purchasable::EVENT_INIT => 'initialEvent',
    ];
}

public function initialEvent(Event $event)
{
    /** @var Variant $variant */
    $variant = $event->sender;

    $variant->setSalePrice(5.99);
    $variant->product->promotable = true;
}

mostafasoufi avatar Oct 29 '20 12:10 mostafasoufi

Thanks for this idea. We are discussing internally a path forward with custom price modifications both outside and inside the context of a cart. Keeping this PR open and circle back soon.

lukeholder avatar Oct 29 '20 13:10 lukeholder

Hey, when do think guys you will work on?

Thanks!

mostafasoufi avatar Nov 06 '20 08:11 mostafasoufi

@lukeholder any news on this topic?

stanislavprokopov avatar Oct 01 '22 20:10 stanislavprokopov

Unfortunately we will be going in a different direction to allow plugins to override the price of the products. Stay tuned to future announcements. Thanks.

lukeholder avatar Nov 23 '22 08:11 lukeholder