Skip to content

Commit

Permalink
税率ルールが取得できない場合は product_class_id = 0 を返す
Browse files Browse the repository at this point in the history
- 基本税率を適用するため
  • Loading branch information
nanasess committed Aug 15, 2019
1 parent 51134aa commit b52d321
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions data/class/SC_Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -796,12 +796,16 @@ protected static function getProductsClassRelateTaxRule(array $product_ids, $opt
* getProductsClassRelateTaxRule の結果から最大値または最小値の金額の product_class_id を取得する.
*
* @param string $col 比較対象のカラム
* @param array $rules 商品規格IDを添字とした商品規格別の税率
* @param array|null $rules 商品規格IDを添字とした商品規格別の税率
* @param string $operator max or min
* @return int product_class_id
*/
protected static function findProductClassIdByRule($col, array $rules, $operator = 'max')
protected static function findProductClassIdByRule($col, $rules, $operator = 'max')
{
if (empty($rules)) {
return 0;
}

// 価格が null の商品規格は除外
$rules = array_filter($rules, function ($rule) use ($col) {
return $rule[$col] !== null;
Expand Down

0 comments on commit b52d321

Please sign in to comment.