Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP]商品個別税率の場合は、共通の課税規則を利用するように変更。 #2117

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions src/Eccube/Repository/TaxRuleRepository.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -203,9 +203,20 @@ public function getByRule($Product = null, $ProductClass = null, $Pref = null, $
}); });


if (!empty($TaxRules)) { if (!empty($TaxRules)) {
$this->rules[$cacheKey] = $TaxRules[0]; $TaxRule = $TaxRules[0];

// 商品個別税率の場合は、共通税率設定の課税規則を適用して返却
$RelatedProduct = $TaxRule->getProduct();
if (!empty($RelatedProduct)) {
$CommonTaxRule = $this->getByRule();
$CommonCalcRule = $CommonTaxRule->getCalcRule();
$TaxRule->setCalcRule($CommonCalcRule);
}

// キャッシュに保存
$this->rules[$cacheKey] = $TaxRule;


return $TaxRules[0]; return $TaxRule;
} else { } else {
throw new NoResultException(); throw new NoResultException();
} }
Expand Down