← All changes
|
includes/Admin/Components/SettingPageComponents.php
+19
-1
1.10.10
→
1.10.28
View file →
| @@ -20,8 +20,25 @@ | ||
| 20 | 20 | $value = syncBasalamSettings()->getSettings(SettingsConfig::SYNC_STATUS_PRODUCT) == true ? false : true; |
| 21 | 21 | echo '<input type="hidden" name="sync_basalam_settings[' . esc_attr(SettingsConfig::SYNC_STATUS_PRODUCT) . ']" value="' . esc_attr($value) . '">'; |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | + public static function renderProductSyncOperations() | |
| 25 | + { | |
| 26 | + $operations = [ | |
| 27 | + SettingsConfig::SYNC_STATUS_PRODUCT_CREATE => 'ایجاد محصول در باسلام', | |
| 28 | + SettingsConfig::SYNC_STATUS_PRODUCT_UPDATE => 'بروزرسانی محصول در باسلام', | |
| 29 | + ]; | |
| 30 | + | |
| 31 | + foreach ($operations as $setting => $label) { | |
| 32 | + $enabled = syncBasalamSettings()->getSettings($setting); | |
| 33 | + echo '<input type="hidden" name="sync_basalam_settings[' . esc_attr($setting) . ']" value="0">'; | |
| 34 | + echo '<label class="basalam-product-sync-option">'; | |
| 35 | + echo '<input type="checkbox" name="sync_basalam_settings[' . esc_attr($setting) . ']" value="1"' . checked($enabled, true, false) . '>'; | |
| 36 | + echo '<span><strong>' . esc_html($label) . '</strong></span>'; | |
| 37 | + echo '</label>'; | |
| 38 | + } | |
| 39 | + } | |
| 40 | + | |
| 24 | 41 | public static function syncStatusOrder() |
| 25 | 42 | { |
| 26 | 43 | $value = syncBasalamSettings()->getSettings(SettingsConfig::SYNC_STATUS_ORDER) == true ? false : true; |
| 27 | 44 | echo '<input type="hidden" name="sync_basalam_settings[' . esc_attr(SettingsConfig::SYNC_STATUS_ORDER) . ']" value="' . esc_attr($value) . '">'; |
| @@ -263,9 +280,9 @@ | ||
| 263 | 280 | $current_value = syncBasalamSettings()->getSettings(SettingsConfig::PRODUCT_ATTRIBUTE_SUFFIX_PRIORITY); |
| 264 | 281 | $is_enabled = syncBasalamSettings()->getSettings(SettingsConfig::PRODUCT_ATTRIBUTE_SUFFIX_ENABLED) == 'yes'; |
| 265 | 282 | $disabled = $is_enabled ? '' : 'disabled'; |
| 266 | 283 | |
| 267 | - echo '<input type="text" name="sync_basalam_settings[' . esc_attr(SettingsConfig::PRODUCT_ATTRIBUTE_SUFFIX_PRIORITY) . ']" value="' . esc_attr($current_value) . '" class="basalam-input basalam-p basalam-attribute-suffix-priority basalam-max-width-80 basalam-font-12" placeholder="مثال: ناشر" ' . esc_attr($disabled) . '>'; | |
| 284 | + echo '<input type="text" name="sync_basalam_settings[' . esc_attr(SettingsConfig::PRODUCT_ATTRIBUTE_SUFFIX_PRIORITY) . ']" value="' . esc_attr($current_value) . '" class="basalam-input basalam-p basalam-attribute-suffix-priority basalam-max-width-80 basalam-font-12" placeholder="مثال: ناشر, نویسنده" ' . esc_attr($disabled) . '>'; | |
| 268 | 285 | } |
| 269 | 286 | |
| 270 | 287 | public static function renderMapOptionsProduct() |
| 271 | 288 | { |
| @@ -284,8 +301,9 @@ | ||
| 284 | 301 | public static function renderSyncProductFields() |
| 285 | 302 | { |
| 286 | 303 | echo '<div>'; |
| 287 | 304 | echo self::renderSingleCheckbox(SettingsConfig::SYNC_PRODUCT_FIELD_NAME, 'نام'); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- HTML is escaped inside the component method. |
| 305 | + echo self::renderSingleCheckbox(SettingsConfig::SYNC_PRODUCT_FIELD_SKU, 'کد محصول (SKU)'); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- HTML is escaped inside the component method. | |
| 288 | 306 | echo self::renderSingleCheckbox(SettingsConfig::SYNC_PRODUCT_FIELD_PHOTOS, 'عکس'); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- HTML is escaped inside the component method. |
| 289 | 307 | echo self::renderSingleCheckbox(SettingsConfig::SYNC_PRODUCT_FIELD_PRICE, 'قیمت'); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- HTML is escaped inside the component method. |
| 290 | 308 | echo self::renderSingleCheckbox(SettingsConfig::SYNC_PRODUCT_FIELD_STOCK, 'موجودی'); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- HTML is escaped inside the component method. |
| 291 | 309 | echo self::renderSingleCheckbox(SettingsConfig::SYNC_PRODUCT_FIELD_WEIGHT, 'وزن'); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- HTML is escaped inside the component method. |