Question

Hi I am working on a module that is supposed to import orders from an api. The thing is the orders have to be imported as guest users and the final price has to be set. So far my script is working ok, the only problem I am having is related with taxes. Something is going on that is not adding taxes correctly. I am using the following when adding a product to quote item:

$buyInfo = array(
    'qty' => $prod['qty'],
);

$quote
    ->addProduct($product, new Varien_Object($buyInfo))
    ->setOriginalCustomPrice($price)
    ->setCustomPrice($price);

I also have some questions that think may be related with, but am not sure. When I add shipping and billing address I set the country but region is always incorrect from api so am not able to add it correctly (can this affect taxes?).

Is there any way to force the added product to calculate is taxes, what approachs can I try?

Was it helpful?

Solution

I think you have to to collecttotal after billing and shipping address assign

                $quote->getShippingAddress()->collectTotals(); 

But make sure that you are assign correct shipping country and correct region on billing and shipping address

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top