I'm building an extension which imports orders created on a third-party system into Magento. The third-party system should be the single source of truth for the order's prices, tax rate, tax paid, etc.

When creating a quote item for each order line to be imported, I can successfully override the product's price with setOriginalCustomPrice and setCustomPrice. Essentially, I'm looking for a way to do the equivalent for the tax rate (or even just the tax paid).

I've attempted using setTaxPercent, setTaxAmount, setBaseTaxAmount, etc. to no avail. I've seen suggestion of hooking into sales_quote_collect_totals_before, but I don't want to effect any orders created on the front-end of the Magento store (i.e. orders not from the third-party system).

Can someone please point me in the right direction!

  • I think your best bet to be sure that Magento does not mess around with these values is to set them directly on the order object after converting the quote. – Fabian Schmengler Mar 8 '16 at 0:43
  • @fschmengler Thanks. I had experimented with that; I wanted to avoid manually calculating the subtotals, totals, etc., but perhaps it's the only way to go – Angus Fretwell Mar 8 '16 at 1:09
  • @AngusFretwell I'm currently struggling with this same issue and am curious if you found a good solution? – Zeke Farwell Apr 11 '16 at 17:22

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.