我有Magento1.7网站,如果客户在结帐页面输入税号,我将厌倦从他们那里删除该税。
我有两个国家荷兰和比利时的税收规则都有10%的税收。,默认的国家是比利时。
我需要删除增加的税收,当比利时客户进入那里的增值税号码在结帐页面。
我厌倦了使用税收规则,但没有运气。
任何人都知道如何使用magento后端或使用代码level.any答案,我很欣赏。谢谢
发布于 2013-09-18 21:49:28
Over Magento的税务模型getRate()函数是我们做类似事情的方法。
class My_Module_Model_Tax_Calculation extends Mage_Tax_Model_Calculation
{
public function getRate($request)
{
if (!$request->getCountryId() || !$request->getCustomerClassId() || !$request->getProductClassId()) {
return 0;
}
$country_id = $request->getCountryId();
if ($country_id == 'BE' && $this->getCustomer() && $this->getCustomer()->getTaxvat()) {
return 0;
}
$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];
}
}
https://stackoverflow.com/questions/18824438
复制相似问题