new check for kashkol

This commit is contained in:
2026-06-12 16:06:37 +03:30
parent 80bcfbf5cf
commit e3bc50e2c6
6 changed files with 46 additions and 54 deletions
+9 -4
View File
@@ -10,7 +10,7 @@ use App\Models\Setting;
class ConfigService
{
public const PRICE_PROVIDERS = ['montzar', 'taban_gohar', 'main_product', 'zaarbox'];
public const PRICE_PROVIDERS = ['montzar', 'main_product', 'zaarbox'];
public function Config($name)
{
@@ -99,12 +99,13 @@ class ConfigService
}
/**
* تنها منبع فعال قیمت — montzar | taban_gohar | main_product | zaarbox
* تنها منبع فعال قیمت — montzar | main_product | zaarbox
*
* اولویت:
* 1) price_provider (یا price_primary_source قدیمی)
* 1) price_provider (یا price_primary_source قدیمی) — فقط مقادیر معتبر
* 2) montzar_price=true → montzar (ابشده خانگی و پروژه‌های فعلی)
* 3) پیش‌فرض فایل: montzar
* 3) main_product_price=true → main_product (legacy)
* 4) پیش‌فرض فایل: montzar
*/
public function priceProvider(): string
{
@@ -119,6 +120,10 @@ class ConfigService
return 'montzar';
}
if ($this->getBool('main_product_price', false)) {
return 'main_product';
}
$default = strtolower((string) config('price_providers.price_provider', 'montzar'));
return in_array($default, self::PRICE_PROVIDERS, true) ? $default : 'montzar';