I would like to set a custom discount price to an existing cart/quote in my controller and found some other people that had this question but none of them got answered:

I want to add discount to existing quote using controller file Magento 2

Magento 2 : How to Set custom Discount from controller?

To give you an example, if the customer clicks a button in the cart he will get a random discount price. But now how can I achieve to add this specific disount price to the cart and quote in the controller?

  • why you do not use Cart Rules?
    – Amit Bera
    Aug 29 '19 at 8:18
  • Because I need to set a specific custom discount price, that isn't the same every time. As I calculate a discount in my controller and then I want to set this calculated discount price. Aug 29 '19 at 8:28
  • Do you want to use Cart rules concept means showing your custom discount at below of total section of cart
    – Amit Bera
    Aug 29 '19 at 8:50
  • Ah, ok. Yes I want to show the custom discount below the total section of the cart. Aug 29 '19 at 8:51
  • any updates on this? Mar 27 at 17:55

Your Answer

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

Browse other questions tagged or ask your own question.