【发布时间】:2017-01-14 03:08:57
【问题描述】:
当用户在结帐时输入增值税号时,我正在尝试进行 magento 修改,从订单中删除税款。
我在 stackoverflow 上找到了一个代码,它支持 magento 旧版本,但它不适用于新版本 1.9,
我对工作条件做了一些修改并返回 0,即使它返回 0 结帐仍然显示税款。
这是我存档的代码
/app/code/core/Mage/Tax/Model/Calculation.php line number 268
public function getRate($request)
{
if (!$request->getCountryId() || !$request->getCustomerClassId() || !$request->getProductClassId()) {
return 0;
}
//my code
$ctax= Mage::getSingleton('checkout/session')->getQuote()->getCustomerTaxvat();
if ($this->getCustomer() && $ctax !='') {
//echo 'test';
return 0;
}
//end my code
$cacheKey = $this->_getRequestCacheKey($request);
if (!isset($this->_rateCache[$cacheKey])) {
$this->unsRateValue();
$this->unsCalculationProcess();
$this->unsEventModuleId();
Mage::dispatchEvent('tax_rate_data_fetch', array(
'request' => $request));
if (!$this->hasRateValue()) {
$rateInfo = $this->_getResource()->getRateInfo($request);
$this->setCalculationProcess($rateInfo['process']);
$this->setRateValue($rateInfo['value']);
} else {
$this->setCalculationProcess($this->_formCalculationProcess());
}
$this->_rateCache[$cacheKey] = $this->getRateValue();
$this->_rateCalculationProcess[$cacheKey] = $this->getCalculationProcess();
}
return $this->_rateCache[$cacheKey];
}
当用户在结帐时输入增值税号时,任何人都可以帮助我将税款设为 0,非常感谢
【问题讨论】:
标签: php magento magento-1.9