Magento – How to Set Tax Amount on Quote from Third-Party Data

quotetaxthird-party-module

I'm trying to set a tax amount on orders that are processed programatically with a custom controller, but can't figure out where to put the number.

what I have: A rest response from the 3rd party containing all the info for the order. It's setting the order with my controller just fine for all the attributes except tax (ie, price, shipping, item, addresses, etc) Tax is the last thing I need to figure out.

What I need: to take the number they give me in the xml and shove it into the "tax" field of the order.

What I would like: I'm hoping there's something very simple for this. All the info I've found in my searching is for things that are more complicated. Ideally I'm hoping there something like $quote->setTax('$myVariable'); that I just haven't been able to find yet.

As you can probably tell, I'm still quite new to PHP and even more new to Magento, so I really appreciate the help.

Best Answer

I ended up adding a module to my extension that adds a new fee and line item to the totals. Since I don't need to process the amount at all, or apply any logic other than "if it's there, add it" this was the simplest solution for me.

I learned a lot about it from http://tutorialmagento.com/how-to-add-fee-or-discount-to-order-totals-in-magento and by looking at the extension he had made that is downloadable there.

Related Topic