| @@ -45,8 +45,22 @@ | ||
| 45 | 45 | |
| 46 | 46 | return $input; |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | + public static function isProductUpdateSelectionValid(?array $settings = null): bool | |
| 50 | + { | |
| 51 | + $settings = array_merge(self::getSettings() ?: [], $settings ?: []); | |
| 52 | + | |
| 53 | + if (($settings[SettingsConfig::SYNC_PRODUCT_FIELDS] ?? 'all') !== 'custom') return true; | |
| 54 | + | |
| 55 | + foreach (SettingsConfig::CUSTOM_PRODUCT_UPDATE_FIELDS as $field) { | |
| 56 | + $value = $settings[$field] ?? null; | |
| 57 | + if ($value === true || $value === 1 || $value === '1') return true; | |
| 58 | + } | |
| 59 | + | |
| 60 | + return false; | |
| 61 | + } | |
| 62 | + | |
| 49 | 63 | public static function getEffectiveTasksPerMinute() |
| 50 | 64 | { |
| 51 | 65 | $isAuto = self::getSettings(SettingsConfig::TASKS_PER_MINUTE_AUTO) == 'true'; |
| 52 | 66 | |