세금 신청 후 라운드 가격
-
29-09-2020 - |
문제
My Store, CE 1.9.2.2, 세금 신청 후 가격을 원합니다. 예: 세금이 적용되지 않은 가격으로 160.50의 제품이 있습니다.일부 고객의 경우 상점은 22 %의 가격을 증가시키는 세금 규칙을 적용합니다.따라서 세금 계산 후 특정 제품의 가격은 195.81이됩니다.그 고객에게는 세금 계산이 적용되지 않는 고객을 위해 160.50을 떠나고있는 동안 제품 가격을 책정하고 싶습니다.
마젠토에서 어떤 식 으로든이를 달성 할 수 있습니까?
해결책
나는 그것을 할 수 있었다.이것은 내가 어떻게 달성했는지입니다.
Mage_Tax_Model_Calculation
클래스를 확장하고 calcTaxAmount
메소드에서 논리를 다시 작성해야했습니다.
public function calcTaxAmount($price, $taxRate, $priceIncludeTax = false, $round = true)
{
$taxRate = $taxRate / 100;
if ($priceIncludeTax) {
$amount = $price * (1 - 1 / (1 + $taxRate));
} else {
$amount = $price * $taxRate;
}
$taxedPrice = $price + $amount;
$amount += round($taxedPrice) - $taxedPrice;
if ($round) {
return $this->round($amount);
}
return $amount;
}
.
방금 두 줄을 추가했습니다 :
$taxedPrice = $price + $amount;
$amount += round($taxedPrice) - $taxedPrice;
.
세금 금액에 합산 된 가격과 둥근 세금 가격의 차이점.
제휴하지 않습니다 magento.stackexchange