fallback handled

This commit is contained in:
2026-06-17 16:13:18 +03:30
parent 34298d3bc5
commit cc5808e755
7 changed files with 232 additions and 2 deletions
+10
View File
@@ -451,6 +451,16 @@ class Controller extends BaseController
return (float) $product['amount'] > 0;
}
/** معامله مقداری: فقط فیلد trade_by_quantity */
public static function usesQuantityTrade($product): bool
{
$value = is_array($product)
? ($product['trade_by_quantity'] ?? null)
: (is_object($product) ? ($product->trade_by_quantity ?? null) : null);
return !empty($value);
}
/** ضریب قیمت محصول — بدون وزن قطعه همیشه ۱ */
public static function productPriceMultiplier($product): float
{