module-list.php
282 lines
| 1 | <?php |
| 2 | |
| 3 | namespace ShopEngine\Core\Register; |
| 4 | |
| 5 | use ShopEngine\Base\List_Model; |
| 6 | use ShopEngine\Traits\Singleton; |
| 7 | |
| 8 | defined( 'ABSPATH' ) || exit; |
| 9 | |
| 10 | class Module_List extends List_Model { |
| 11 | |
| 12 | use Singleton; |
| 13 | |
| 14 | protected $list_type = 'modules'; |
| 15 | |
| 16 | protected function raw_list() { |
| 17 | return array_merge( [ |
| 18 | 'quick-view' => [ |
| 19 | 'slug' => 'quick-view', |
| 20 | 'title' => esc_html__( 'Quick View', 'shopengine' ), |
| 21 | 'package' => 'free', |
| 22 | 'base_class' => '\ShopEngine\Modules\Quick_View\Quick_View', |
| 23 | 'settings' => [ |
| 24 | ], |
| 25 | ], |
| 26 | 'swatches' => [ |
| 27 | 'slug' => 'swatches', |
| 28 | 'title' => esc_html__( 'Swatches', 'shopengine' ), |
| 29 | 'package' => 'free', |
| 30 | 'base_class' => '\ShopEngine\Modules\Swatches\Swatches', |
| 31 | 'settings' => [ |
| 32 | 'show_color_swatch_on_loop' => [ |
| 33 | 'value' => 'no', |
| 34 | 'field_settings' => [ |
| 35 | 'type' => 'switch', |
| 36 | 'label' => esc_html__( 'Show Color Swatch On Loop Products', 'shopengine' ), |
| 37 | ] |
| 38 | ], |
| 39 | ], |
| 40 | ], |
| 41 | 'wishlist' => [ |
| 42 | 'slug' => 'wishlist', |
| 43 | 'title' => esc_html__( 'Wishlist', 'shopengine' ), |
| 44 | 'package' => 'free', |
| 45 | 'base_class' => '\ShopEngine\Modules\Wishlist\Wishlist', |
| 46 | 'settings' => [ |
| 47 | 'show_on_archive_page' => [ |
| 48 | 'value' => 'yes', |
| 49 | 'field_settings' => [ |
| 50 | 'type' => 'switch', |
| 51 | 'label' => esc_html__( 'Show In Archive Page', 'shopengine' ), |
| 52 | ] |
| 53 | ], |
| 54 | 'show_on_single_page' => [ |
| 55 | 'value' => 'yes', |
| 56 | 'field_settings' => [ |
| 57 | 'type' => 'switch', |
| 58 | 'label' => esc_html__( 'Show In Single Page', 'shopengine' ), |
| 59 | ] |
| 60 | ], |
| 61 | 'show_icon_where_to' => [ |
| 62 | 'value' => 'before', |
| 63 | 'field_settings' => [ |
| 64 | 'type' => 'select', |
| 65 | 'label' => esc_html__( 'Show Before/After Add to cart button', 'shopengine' ), |
| 66 | 'options' => [ |
| 67 | 'before' => esc_html__( 'Before', 'shopengine' ), |
| 68 | 'after' => esc_html__( 'After', 'shopengine' ), |
| 69 | ], |
| 70 | ] |
| 71 | ], |
| 72 | 'position' => [ |
| 73 | 'value' => 'bottom-right', |
| 74 | 'field_settings' => [ |
| 75 | 'type' => 'select', |
| 76 | 'label' => esc_html__('Notification Position', 'shopengine'), |
| 77 | 'options' => [ |
| 78 | 'top-left' => esc_html__('Top Left', 'shopengine'), |
| 79 | 'top-right' => esc_html__('Top Right', 'shopengine'), |
| 80 | 'bottom-left' => esc_html__('Bottom Left', 'shopengine'), |
| 81 | 'bottom-right' => esc_html__('Bottom Right', 'shopengine') |
| 82 | ] |
| 83 | ] |
| 84 | ] |
| 85 | ], |
| 86 | ], |
| 87 | 'comparison' => [ |
| 88 | 'slug' => 'comparison', |
| 89 | 'title' => esc_html__( 'Product Comparison', 'shopengine' ), |
| 90 | 'package' => 'free', |
| 91 | 'base_class' => '\ShopEngine\Modules\Comparison\Comparison', |
| 92 | 'settings' => apply_filters( 'shopengine/module/comparison_settings', [ |
| 93 | 'show_on_archive_page' => [ |
| 94 | 'value' => 'yes', |
| 95 | 'field_settings' => [ |
| 96 | 'type' => 'switch', |
| 97 | 'label' => esc_html__( 'Show In Archive Page', 'shopengine' ), |
| 98 | ] |
| 99 | ], |
| 100 | 'show_on_single_page' => [ |
| 101 | 'value' => 'yes', |
| 102 | 'field_settings' => [ |
| 103 | 'type' => 'switch', |
| 104 | 'label' => esc_html__( 'Show In Single Page', 'shopengine' ), |
| 105 | ] |
| 106 | ], |
| 107 | 'show_icon_where_to' => [ |
| 108 | 'value' => 'before', |
| 109 | 'field_settings' => [ |
| 110 | 'type' => 'select', |
| 111 | 'label' => esc_html__( 'Show Before/After Add to cart button', 'shopengine' ), |
| 112 | 'options' => [ |
| 113 | 'before' => esc_html__( 'Before', 'shopengine' ), |
| 114 | 'after' => esc_html__( 'After', 'shopengine' ), |
| 115 | ], |
| 116 | ] |
| 117 | ], |
| 118 | 'shop_field_in_table' => [ |
| 119 | 'value' => [ "image", "title", "availability", "weight" ], |
| 120 | 'field_settings' => [ |
| 121 | 'type' => 'checkbox-group', |
| 122 | 'label' => esc_html__( 'Select Fields to Show in Comparison Table', "shopengine" ), |
| 123 | 'options' => apply_filters( 'shopengine/module/comparison_fields_for_table', [ |
| 124 | [ |
| 125 | 'label' => esc_html__( 'Title', 'shopengine' ), |
| 126 | 'value' => 'title' |
| 127 | ], |
| 128 | [ |
| 129 | 'label' => esc_html__( 'Description', 'shopengine' ), |
| 130 | 'value' => 'description' |
| 131 | ], |
| 132 | [ |
| 133 | 'label' => esc_html__( 'Availability', 'shopengine' ), |
| 134 | 'value' => 'availability' |
| 135 | ], |
| 136 | [ |
| 137 | 'label' => esc_html__( 'Weight', 'shopengine' ), |
| 138 | 'value' => 'weight' |
| 139 | ], |
| 140 | [ |
| 141 | 'label' => esc_html__( 'Height', 'shopengine' ), |
| 142 | 'value' => 'height' |
| 143 | ], |
| 144 | [ |
| 145 | 'label' => esc_html__( 'Dimension', 'shopengine' ), |
| 146 | 'value' => 'dimension' |
| 147 | ], |
| 148 | ] ) |
| 149 | ] |
| 150 | ], |
| 151 | 'alert_one' => [ |
| 152 | 'field_settings' => [ |
| 153 | 'type' => 'pro-alert', |
| 154 | 'value' => '', |
| 155 | 'label' => '<h2> Pro Features </h2>', |
| 156 | 'description' => '<p> |
| 157 | 1. Attributes To Show<br/> |
| 158 | 2. Custom Meta<br/> |
| 159 | 3. Share Button<br/> |
| 160 | 4. Show Compare Button/Bar On Bottom<br/> |
| 161 | You need to upgrade to the <strong><a title="' . esc_html__("Upgrade Feature","shopengine") . '" href="https://wpmet.com/plugin/shopengine/pricing" rel="noopener" target="_blank" style="color: red;">Premium</a> </strong> Version.</p>', |
| 162 | 'alert_type' => 'success' //success, info, warning, error |
| 163 | ] |
| 164 | ], |
| 165 | |
| 166 | ] ), |
| 167 | ], |
| 168 | ], |
| 169 | $this->pro_modules_for_showing_on_free() |
| 170 | ); |
| 171 | } |
| 172 | |
| 173 | private function pro_modules_for_showing_on_free(){ |
| 174 | |
| 175 | if( class_exists('ShopEngine_Pro') ){ |
| 176 | return []; |
| 177 | } |
| 178 | |
| 179 | return [ |
| 180 | |
| 181 | 'badge' => [ |
| 182 | 'slug' => 'badge', |
| 183 | 'title' => esc_html__( 'Badges', 'shopengine' ), |
| 184 | 'package' => 'pro-disabled', |
| 185 | 'status' => 'inactive', |
| 186 | 'settings' => [], |
| 187 | ], |
| 188 | 'quick-checkout' => [ |
| 189 | 'slug' => 'quick-checkout', |
| 190 | 'title' => esc_html__( 'Quick Checkout', 'shopengine' ), |
| 191 | 'package' => 'pro-disabled', |
| 192 | 'settings' => [ |
| 193 | ], |
| 194 | ], |
| 195 | 'partial-payment' => [ |
| 196 | 'slug' => 'partial-payment', |
| 197 | 'title' => esc_html__( 'Partial Payment', 'shopengine' ), |
| 198 | 'package' => 'pro-disabled', |
| 199 | 'settings' => [] |
| 200 | ], |
| 201 | 'pre-order' => [ |
| 202 | 'slug' => 'pre-order', |
| 203 | 'title' => esc_html__( 'Pre-Order', 'shopengine' ), |
| 204 | 'package' => 'pro-disabled', |
| 205 | 'settings' => [], |
| 206 | ], |
| 207 | 'back-order' => [ |
| 208 | 'slug' => 'backorder', |
| 209 | 'title' => esc_html__( 'Back-Order', 'shopengine' ), |
| 210 | 'package' => 'pro-disabled', |
| 211 | 'settings' => [], |
| 212 | ], |
| 213 | 'sales-notification' => [ |
| 214 | 'slug' => 'sales-notification', |
| 215 | 'title' => esc_html__( 'Sales Notification', 'shopengine' ), |
| 216 | 'package' => 'pro-disabled', |
| 217 | 'settings' => [], |
| 218 | ], |
| 219 | 'currency-switcher' => [ |
| 220 | 'slug' => 'currency-switcher', |
| 221 | 'title' => esc_html__( 'Currency Switcher', 'shopengine' ), |
| 222 | 'package' => 'pro-disabled', |
| 223 | 'settings' => [], |
| 224 | ], |
| 225 | 'flash-sale-countdown' => [ |
| 226 | 'slug' => 'flash-sale-countdown', |
| 227 | 'title' => esc_html__( 'Flash Sale Countdown', 'shopengine' ), |
| 228 | 'package' => 'pro-disabled', |
| 229 | 'settings' => [], |
| 230 | ], |
| 231 | 'checkout-additional-field' => [ |
| 232 | 'slug' => 'checkout-additional-field', |
| 233 | 'title' => esc_html__( 'Checkout Additional Field', 'shopengine' ), |
| 234 | 'package' => 'pro-disabled', |
| 235 | 'settings' => [], |
| 236 | ], |
| 237 | 'product-size-charts' => [ |
| 238 | 'slug' => 'product-size-charts', |
| 239 | 'title' => esc_html__('Product Size Charts', 'shopengine'), |
| 240 | 'package' => 'pro-disabled', |
| 241 | 'settings' => [] |
| 242 | ], |
| 243 | 'sticky-fly-cart' => [ |
| 244 | 'slug' => 'sticky-fly-cart', |
| 245 | 'title' => esc_html__('Sticky Fly Cart', 'shopengine'), |
| 246 | 'package' => 'pro-disabled', |
| 247 | 'settings' => [] |
| 248 | ], |
| 249 | 'vacation' => [ |
| 250 | 'slug' => 'vacation', |
| 251 | 'title' => esc_html__('Vacation', 'shopengine'), |
| 252 | 'package' => 'pro-disabled', |
| 253 | 'settings' => [] |
| 254 | ], |
| 255 | 'multistep-checkout' => [ |
| 256 | 'slug' => 'multistep-checkout', |
| 257 | 'title' => esc_html__('Multistep Checkout', 'shopengine'), |
| 258 | 'package' => 'pro-disabled', |
| 259 | 'settings' => [] |
| 260 | ], |
| 261 | 'advanced-coupon' => [ |
| 262 | 'slug' => 'advanced-coupon', |
| 263 | 'title' => esc_html__('Advanced Coupon', 'shopengine'), |
| 264 | 'package' => 'pro-disabled', |
| 265 | 'settings' => [] |
| 266 | ], |
| 267 | 'cross-sell-popup' => [ |
| 268 | 'slug' => 'cross-sell-popup', |
| 269 | 'title' => esc_html__('Cross Sell Popup', 'shopengine'), |
| 270 | 'package' => 'pro-disabled', |
| 271 | 'settings' => [] |
| 272 | ], |
| 273 | 'avatar' => [ |
| 274 | 'slug' => 'avatar', |
| 275 | 'title' => esc_html__('Avatar', 'shopengine'), |
| 276 | 'package' => 'pro-disabled', |
| 277 | 'settings' => [] |
| 278 | ], |
| 279 | ]; |
| 280 | } |
| 281 | } |
| 282 |