Add formula-based product pricing (P/W/MG) for Parsian-style unit prices.
Port FormulaPriceService from colleague app so admins can compute a single unit price from reference mid, weight, and wage instead of offset coefficients. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -773,8 +773,14 @@ class Controller extends BaseController
|
||||
'direct_price' => is_object($product) ? ($product->direct_price ?? null) : null,
|
||||
'group_type' => is_object($product) ? ($product->group_type ?? null) : null,
|
||||
'reading_method' => is_object($product) ? ($product->reading_method ?? null) : null,
|
||||
'price_formula_enabled' => is_object($product) ? ($product->price_formula_enabled ?? null) : null,
|
||||
];
|
||||
|
||||
// قیمت فرمولی = قیمت واحد هر عدد (وزن داخل فرمول است)
|
||||
if (! empty($payload['price_formula_enabled'])) {
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
if (! empty($payload['reading_method'])) {
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user