fixed show true when price is 0 2

This commit is contained in:
2026-06-22 19:35:20 +03:30
parent 27d58e8a11
commit 8858cf968b
2 changed files with 32 additions and 24 deletions
-17
View File
@@ -51,10 +51,6 @@ class ProductPriceService
$data['price_profit'] = 0;
}
if (\Illuminate\Support\Facades\Schema::hasColumn($product->getTable(), 'show')) {
$data['show'] = self::resolveShowAfterPriceSync($product, $adjustedPrice);
}
Product::where('id', $product->id)->update($data);
return [
@@ -71,19 +67,6 @@ class ProductPriceService
];
}
private static function resolveShowAfterPriceSync(Product $product, int $adjustedPrice): bool
{
if (! ($product->active ?? true)) {
return false;
}
if (! app(ConfigService::class)->isProductWithinTradingHours($product)) {
return false;
}
return $adjustedPrice > 0;
}
/** وقتی فقط درصد در ادمین عوض می‌شود (بدون sync جدید) */
public static function reapplyOffsetPercent(Product $product, float $newOffsetPercent, ?float $oldOffsetPercent = null): void
{