Magento CE ver . 1.7.0.2
我正试图从我们的Magento商店获取一些订单数据,以集成到我们的其他商业软件中 . 在我的情况下,我需要计算单个项目的价格加税 . 以下代码仅在 Display Product Prices In Catalog 设置为 Include 或 Both (在系统>配置>销售>税收中)时有效 . 如何在网站显示价格不含税的情况下计算某项目的税金?
$customer_tax_class = Mage::getModel('tax/calculation')->getRateRequest()->getCustomerClassId();
$_product = Mage::getModel('catalog/product')->loadByAttribute('sku',$skunumber);
$my_price = Mage::helper('tax')->getPrice($_product, $_product->getPrice(), true, $shippingAddress, $billingAddress, $customer_tax_class);
我也尝试使用它,但我仍然可以获得不含税的价格(除非我更改上面提到的显示设置):
$_finalPriceInclTax = Mage::helper('tax')->getPrice($_product, $_product->getFinalPrice(), true, $shippingAddress, $billingAddress, $customer_tax_class);
我知道这一定是可能的,因为Magento在您下订单时会计算税收 . 任何帮助将不胜感激 .
1 回答
我需要一段时间来获得我需要的所有参数,因为我们正在使用高度自定义的结账,但这里最终对我有用