1

Can we make this rule Buy 2 products, get 25% off on cheapest one without third party extension?

  • 1
    This is not default you will to create plugin, can be done via observer – dev_67Commerce Dec 21 '17 at 8:18
  • Thank you. Do you have any hints or tutorial? – MagEGY Dec 21 '17 at 11:49
1

You can create an observer which will be fired in the event:-

controller_action_predispatch_checkout_cart_couponPost

Then you override the controller CouponPost that is executing for checkout cart. Now using this code in your observer:-

public function execute(\Magento\Framework\Event\Observer $observer)
    {

        //Your algorithm here
    }

You will need to use preference for overriding the controller with after.

I am not 100% confident of the workflow but this is where you can start from.

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.