addons
5 years ago
product-pre-select-location-scripts.php
5 years ago
settings-api.php
3 weeks ago
settings-crons.php
1 year ago
settings-default.php
4 years ago
settings-help.php
4 years ago
settings-logger.php
1 year ago
settings-optional.php
1 month ago
settings-sponsor.php
4 years ago
settings-stock-locations.php
1 year ago
settings-widgets.php
4 years ago
taxonomy-fields-edit.php
2 years ago
taxonomy-fields-new.php
5 years ago
settings-optional.php
96 lines
| 1 | <?php if ( ! defined('WPINC') ) die; |
| 2 | global $slw_optional_features_key; |
| 3 | |
| 4 | $option_key = $slw_optional_features_key; |
| 5 | |
| 6 | $features = [ |
| 7 | 'stock_status_column' => [ |
| 8 | 'title' => __('Stock Status Column', 'stock-locations-for-woocommerce'), |
| 9 | 'description' => __('Products list page in the admin to see actual stock status and product visibility together.', 'stock-locations-for-woocommerce'), |
| 10 | ], |
| 11 | |
| 12 | 'fix_stock_status_visibility_mismatch' => [ |
| 13 | 'title' => __('Auto Fix Visibility', 'stock-locations-for-woocommerce'), |
| 14 | 'description' => __('Automatically repair out of stock products with missing visibility taxonomy.', 'stock-locations-for-woocommerce'), |
| 15 | ], |
| 16 | ]; |
| 17 | |
| 18 | $saved_features = get_option($option_key, []); |
| 19 | |
| 20 | $saved_features = is_array($saved_features) |
| 21 | ? $saved_features |
| 22 | : []; |
| 23 | |
| 24 | ?> |
| 25 | |
| 26 | <div class="slw-settings-wrap"> |
| 27 | |
| 28 | <table class="widefat striped slw-settings-table" cellspacing="0"> |
| 29 | |
| 30 | <thead> |
| 31 | <tr> |
| 32 | <th> |
| 33 | <?php _e('Feature', 'stock-locations-for-woocommerce'); ?> |
| 34 | </th> |
| 35 | |
| 36 | <th width="120"> |
| 37 | <?php _e('Status', 'stock-locations-for-woocommerce'); ?> |
| 38 | </th> |
| 39 | </tr> |
| 40 | </thead> |
| 41 | |
| 42 | <tbody> |
| 43 | |
| 44 | <?php foreach ($features as $feature_key => $feature) : ?> |
| 45 | |
| 46 | <?php |
| 47 | |
| 48 | $enabled = ( |
| 49 | isset($saved_features[$feature_key]) |
| 50 | && $saved_features[$feature_key] |
| 51 | ); |
| 52 | |
| 53 | ?> |
| 54 | |
| 55 | <tr> |
| 56 | |
| 57 | <td> |
| 58 | |
| 59 | <strong> |
| 60 | <?php echo esc_html($feature['title']); ?> |
| 61 | </strong> |
| 62 | |
| 63 | <p style="margin:5px 0 0; opacity:.7;"> |
| 64 | <?php echo esc_html($feature['description']); ?> |
| 65 | </p> |
| 66 | |
| 67 | </td> |
| 68 | |
| 69 | <td> |
| 70 | |
| 71 | <label class="slw-optional-features-btn"> |
| 72 | |
| 73 | <input |
| 74 | type="checkbox" |
| 75 | data-feature-key="<?php echo esc_attr($feature_key); ?>" |
| 76 | value="1" |
| 77 | <?php checked($enabled); ?> |
| 78 | > |
| 79 | |
| 80 | <span> |
| 81 | <i class="fas fa-toggle-on"></i> |
| 82 | </span> |
| 83 | |
| 84 | </label> |
| 85 | |
| 86 | </td> |
| 87 | |
| 88 | </tr> |
| 89 | |
| 90 | <?php endforeach; ?> |
| 91 | |
| 92 | </tbody> |
| 93 | |
| 94 | </table> |
| 95 | |
| 96 | </div> |