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:
2026-08-10 16:47:29 +03:30
co-authored by Cursor
parent 71a48c9c08
commit f421fcb83f
9 changed files with 515 additions and 9 deletions
+7
View File
@@ -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'],