I have made a script for migration orders from prestashop to magento All orders were imported successfully. I have just one problem. I don't know how to apply discount amount on order and how to show discount amount and description in customer order history list.

I tried to create cart price rule and apply it on quote with this tutorial but without success.

    $quote = Mage::getModel('sales/quote')->load($order_no);                  

I tried to apply discount amount on order object with bellow code:


Does anyone have any experiences with importing orders in magento and how to apply discount?

  • Be careful with the date the tutorials you're looking at were released. A lot happened in magento between now and then. Btw, you didn't tag your Magento version. – Julien Lachal Jul 11 '14 at 13:54

Ok, it is quite simple:

  • Magento normally also distributes the discount amounts across the items. I would suggest taking a look on the database level how the order is saved when placing an order via Magento vs your script. – Kristof at Fooman Sep 14 '14 at 23:54
  • Please accept your own answer to mark this question as resolved. This platform is still in beta and we need to reach an answer rate of 80%. blog.stackoverflow.com/2009/01/accept-your-own-answers Thanks! – Anna Völkl Nov 26 '14 at 7:24

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.