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:
@@ -739,6 +739,13 @@ class ZaarboxPriceService
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (FormulaPriceService::isEnabled($product)) {
|
||||
return FormulaPriceService::calculateForProduct($product, [
|
||||
'price' => $parts['price'],
|
||||
'active' => true,
|
||||
]) ?? 0;
|
||||
}
|
||||
|
||||
return ProductPriceService::adjustedTotal(
|
||||
$parts['price'],
|
||||
$parts['profit'],
|
||||
|
||||
Reference in New Issue
Block a user