fixed show true when price is 0 2
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user