fallback handled
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user