| @@ -1,143 +1,437 @@ | ||
| 1 | -<?php | |
| 2 | -/** | |
| 3 | - * Payment Logos | |
| 4 | - * | |
| 5 | - * @package Merchant | |
| 6 | - */ | |
| 7 | - | |
| 8 | -if ( ! defined( 'ABSPATH' ) ) { | |
| 9 | - exit; // Exit if accessed directly | |
| 10 | -} | |
| 11 | - | |
| 12 | -/** | |
| 13 | - * Payment Logos | |
| 14 | - */ | |
| 15 | -Merchant_Admin_Options::create( array( | |
| 16 | - 'title' => esc_html__( 'Payment Logos', 'merchant' ), | |
| 17 | - 'module' => Merchant_Payment_Logos::MODULE_ID, | |
| 18 | - 'fields' => array( | |
| 19 | - | |
| 20 | - array( | |
| 21 | - 'id' => 'logos', | |
| 22 | - 'type' => 'gallery', | |
| 23 | - 'label' => esc_html__( 'Select logos', 'merchant' ) | |
| 24 | - ), | |
| 25 | - | |
| 26 | - ), | |
| 27 | -) ); | |
| 28 | - | |
| 29 | -/** | |
| 30 | - * Settings | |
| 31 | - */ | |
| 32 | -Merchant_Admin_Options::create( array( | |
| 33 | - 'title' => esc_html__( 'Settings', 'merchant' ), | |
| 34 | - 'module' => Merchant_Payment_Logos::MODULE_ID, | |
| 35 | - 'fields' => array( | |
| 36 | - | |
| 37 | - array( | |
| 38 | - 'id' => 'align', | |
| 39 | - 'type' => 'select', | |
| 40 | - 'title' => esc_html__( 'Align logos', 'merchant' ), | |
| 41 | - 'options' => array( | |
| 42 | - 'flex-start' => esc_html__( 'Left', 'merchant' ), | |
| 43 | - 'center' => esc_html__( 'Center', 'merchant' ), | |
| 44 | - 'flex-end' => esc_html__( 'Right', 'merchant' ), | |
| 45 | - ), | |
| 46 | - 'default' => 'flex-start', | |
| 47 | - ), | |
| 48 | - | |
| 49 | - array( | |
| 50 | - 'id' => 'title', | |
| 51 | - 'type' => 'text', | |
| 52 | - 'title' => esc_html__( 'Text above the logos', 'merchant' ), | |
| 53 | - 'default' => esc_html__( '🔒 Safe & Secure Checkout', 'merchant' ), | |
| 54 | - ), | |
| 55 | - | |
| 56 | - array( | |
| 57 | - 'id' => 'font-size', | |
| 58 | - 'type' => 'range', | |
| 59 | - 'title' => esc_html__( 'Font size', 'merchant' ), | |
| 60 | - 'min' => 1, | |
| 61 | - 'max' => 250, | |
| 62 | - 'step' => 1, | |
| 63 | - 'default' => 18, | |
| 64 | - 'unit' => 'px', | |
| 65 | - ), | |
| 66 | - | |
| 67 | - array( | |
| 68 | - 'id' => 'text-color', | |
| 69 | - 'type' => 'color', | |
| 70 | - 'title' => esc_html__( 'Text color', 'merchant' ), | |
| 71 | - 'default' => '#212121', | |
| 72 | - ), | |
| 73 | - | |
| 74 | - array( | |
| 75 | - 'id' => 'margin-top', | |
| 76 | - 'type' => 'range', | |
| 77 | - 'title' => esc_html__( 'Margin top', 'merchant' ), | |
| 78 | - 'min' => 1, | |
| 79 | - 'max' => 250, | |
| 80 | - 'step' => 1, | |
| 81 | - 'default' => 20, | |
| 82 | - 'unit' => 'px', | |
| 83 | - ), | |
| 84 | - | |
| 85 | - array( | |
| 86 | - 'id' => 'margin-bottom', | |
| 87 | - 'type' => 'range', | |
| 88 | - 'title' => esc_html__( 'Margin bottom', 'merchant' ), | |
| 89 | - 'min' => 1, | |
| 90 | - 'max' => 250, | |
| 91 | - 'step' => 1, | |
| 92 | - 'default' => 20, | |
| 93 | - 'unit' => 'px', | |
| 94 | - ), | |
| 95 | - | |
| 96 | - array( | |
| 97 | - 'id' => 'image-max-width', | |
| 98 | - 'type' => 'range', | |
| 99 | - 'title' => esc_html__( 'Image max width', 'merchant' ), | |
| 100 | - 'min' => 1, | |
| 101 | - 'max' => 250, | |
| 102 | - 'step' => 1, | |
| 103 | - 'default' => 80, | |
| 104 | - 'unit' => 'px', | |
| 105 | - ), | |
| 106 | - | |
| 107 | - array( | |
| 108 | - 'id' => 'image-max-height', | |
| 109 | - 'type' => 'range', | |
| 110 | - 'title' => esc_html__( 'Image max height', 'merchant' ), | |
| 111 | - 'min' => 1, | |
| 112 | - 'max' => 250, | |
| 113 | - 'step' => 1, | |
| 114 | - 'default' => 100, | |
| 115 | - 'unit' => 'px', | |
| 116 | - ), | |
| 117 | - | |
| 118 | - ), | |
| 119 | -) ); | |
| 120 | - | |
| 121 | -// Shortcode | |
| 122 | -$merchant_module_id = Merchant_Payment_Logos::MODULE_ID; | |
| 123 | -Merchant_Admin_Options::create( array( | |
| 124 | - 'module' => $merchant_module_id, | |
| 125 | - 'title' => esc_html__( 'Use shortcode', 'merchant' ), | |
| 126 | - 'fields' => array( | |
| 127 | - array( | |
| 128 | - 'id' => 'use_shortcode', | |
| 129 | - 'type' => 'switcher', | |
| 130 | - 'title' => __( 'Use shortcode', 'merchant' ), | |
| 131 | - 'default' => 0, | |
| 132 | - 'desc' => esc_html__( 'If you are using a page builder or a theme that supports shortcodes, then you can output the module using the shortcode above. This might be useful if, for example, you find that you want to control the position of the module output more precisely than with the module settings. Note that the shortcodes can only be used on single product pages.', | |
| 133 | - 'merchant' ), | |
| 134 | - ), | |
| 135 | - array( | |
| 136 | - 'id' => 'shortcode_text', | |
| 137 | - 'type' => 'text_readonly', | |
| 138 | - 'title' => esc_html__( 'Shortcode text', 'merchant' ), | |
| 139 | - 'default' => '[merchant_module_' . str_replace( '-', '_', $merchant_module_id ) . ']', | |
| 140 | - 'condition' => array( 'use_shortcode', '==', '1' ), | |
| 141 | - ), | |
| 142 | - ), | |
| 143 | -) ); | |
| 1 | +<?php | |
| 2 | +/** | |
| 3 | + * Payment Logos — Option group definitions. | |
| 4 | + * | |
| 5 | + * Pure data file. Returns the option groups array | |
| 6 | + * consumed by init_option_groups(). | |
| 7 | + * | |
| 8 | + * @package Merchant | |
| 9 | + */ | |
| 10 | + | |
| 11 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 12 | + exit; // Exit if accessed directly. | |
| 13 | +} | |
| 14 | + | |
| 15 | +/** | |
| 16 | + * Icon Source. | |
| 17 | + */ | |
| 18 | + | |
| 19 | +return array( | |
| 20 | + array( | |
| 21 | + 'title' => esc_html__( 'Payment Logos', 'merchant' ), | |
| 22 | + 'module' => Merchant_Payment_Logos::MODULE_ID, | |
| 23 | + 'fields' => array( | |
| 24 | + | |
| 25 | + array( | |
| 26 | + 'id' => 'icon_source', | |
| 27 | + 'type' => 'select', | |
| 28 | + 'title' => esc_html__( 'Icon source', 'merchant' ), | |
| 29 | + 'options' => array( | |
| 30 | + 'gallery' => esc_html__( 'Media Gallery (upload your own)', 'merchant' ), | |
| 31 | + 'library' => esc_html__( 'Built-in Icon Library', 'merchant' ), | |
| 32 | + ), | |
| 33 | + 'default' => 'gallery', | |
| 34 | + ), | |
| 35 | + | |
| 36 | + array( | |
| 37 | + 'id' => 'logos', | |
| 38 | + 'type' => 'gallery', | |
| 39 | + 'label' => esc_html__( 'Select logos', 'merchant' ), | |
| 40 | + 'condition' => array( 'icon_source', '==', 'gallery' ), | |
| 41 | + ), | |
| 42 | + | |
| 43 | + array( | |
| 44 | + 'id' => 'library_icons', | |
| 45 | + 'type' => 'choices', | |
| 46 | + 'title' => esc_html__( 'Select payment icons', 'merchant' ), | |
| 47 | + 'multiple' => true, | |
| 48 | + 'options' => Merchant_Payment_Icons_Library::get_choices_options(), | |
| 49 | + 'default' => array( 'visa', 'mastercard', 'paypal' ), | |
| 50 | + 'condition' => array( 'icon_source', '==', 'library' ), | |
| 51 | + ), | |
| 52 | + | |
| 53 | + ), | |
| 54 | +), | |
| 55 | + array( | |
| 56 | + 'title' => esc_html__( 'Display Locations', 'merchant' ), | |
| 57 | + 'module' => Merchant_Payment_Logos::MODULE_ID, | |
| 58 | + 'fields' => array( | |
| 59 | + | |
| 60 | + array( | |
| 61 | + 'id' => 'show_on_single_product', | |
| 62 | + 'type' => 'switcher', | |
| 63 | + 'title' => esc_html__( 'Single Product Page', 'merchant' ), | |
| 64 | + 'default' => 1, | |
| 65 | + ), | |
| 66 | + | |
| 67 | + array( | |
| 68 | + 'id' => 'show_on_cart_page', | |
| 69 | + 'type' => 'switcher', | |
| 70 | + 'title' => esc_html__( 'Cart Page', 'merchant' ), | |
| 71 | + 'default' => 0, | |
| 72 | + ), | |
| 73 | + | |
| 74 | + array( | |
| 75 | + 'id' => 'cart_position', | |
| 76 | + 'type' => 'select', | |
| 77 | + 'title' => esc_html__( 'Cart page position', 'merchant' ), | |
| 78 | + 'options' => array( | |
| 79 | + 'before_table' => esc_html__( 'Before cart table', 'merchant' ), | |
| 80 | + 'after_table' => esc_html__( 'After cart table', 'merchant' ), | |
| 81 | + 'before_proceed_to_checkout' => esc_html__( 'Before "Proceed to checkout" button', 'merchant' ), | |
| 82 | + 'after_cart_totals' => esc_html__( 'After cart totals', 'merchant' ), | |
| 83 | + ), | |
| 84 | + 'default' => 'after_table', | |
| 85 | + 'conditions' => array( | |
| 86 | + 'terms' => array( | |
| 87 | + array( | |
| 88 | + 'field' => 'show_on_cart_page', | |
| 89 | + 'operator' => '===', | |
| 90 | + 'value' => true, | |
| 91 | + ), | |
| 92 | + ), | |
| 93 | + ), | |
| 94 | + ), | |
| 95 | + | |
| 96 | + array( | |
| 97 | + 'id' => 'show_on_checkout_page', | |
| 98 | + 'type' => 'switcher', | |
| 99 | + 'title' => esc_html__( 'Checkout Page', 'merchant' ), | |
| 100 | + 'default' => 0, | |
| 101 | + ), | |
| 102 | + | |
| 103 | + array( | |
| 104 | + 'id' => 'checkout_position', | |
| 105 | + 'type' => 'select', | |
| 106 | + 'title' => esc_html__( 'Checkout page position', 'merchant' ), | |
| 107 | + 'options' => array( | |
| 108 | + 'before_checkout_form' => esc_html__( 'Before checkout form', 'merchant' ), | |
| 109 | + 'before_customer_details' => esc_html__( 'Before customer details', 'merchant' ), | |
| 110 | + 'after_customer_details' => esc_html__( 'After customer details', 'merchant' ), | |
| 111 | + 'before_place_order' => esc_html__( 'Before "Place order" button', 'merchant' ), | |
| 112 | + 'after_checkout_form' => esc_html__( 'After checkout form', 'merchant' ), | |
| 113 | + ), | |
| 114 | + 'default' => 'before_checkout_form', | |
| 115 | + 'conditions' => array( | |
| 116 | + 'terms' => array( | |
| 117 | + array( | |
| 118 | + 'field' => 'show_on_checkout_page', | |
| 119 | + 'operator' => '===', | |
| 120 | + 'value' => true, | |
| 121 | + ), | |
| 122 | + ), | |
| 123 | + ), | |
| 124 | + ), | |
| 125 | + | |
| 126 | + array( | |
| 127 | + 'id' => 'show_on_footer', | |
| 128 | + 'type' => 'switcher', | |
| 129 | + 'title' => esc_html__( 'Footer (site-wide)', 'merchant' ), | |
| 130 | + 'default' => 0, | |
| 131 | + ), | |
| 132 | + | |
| 133 | + array( | |
| 134 | + 'id' => 'show_on_archive_pages', | |
| 135 | + 'type' => 'switcher', | |
| 136 | + 'title' => esc_html__( 'Archive / Shop Pages', 'merchant' ), | |
| 137 | + 'default' => 0, | |
| 138 | + ), | |
| 139 | + | |
| 140 | + array( | |
| 141 | + 'id' => 'archive_position', | |
| 142 | + 'type' => 'select', | |
| 143 | + 'title' => esc_html__( 'Archive page position', 'merchant' ), | |
| 144 | + 'options' => array( | |
| 145 | + 'before_loop' => esc_html__( 'Before product loop', 'merchant' ), | |
| 146 | + 'after_loop' => esc_html__( 'After product loop', 'merchant' ), | |
| 147 | + ), | |
| 148 | + 'default' => 'after_loop', | |
| 149 | + 'conditions' => array( | |
| 150 | + 'terms' => array( | |
| 151 | + array( | |
| 152 | + 'field' => 'show_on_archive_pages', | |
| 153 | + 'operator' => '===', | |
| 154 | + 'value' => true, | |
| 155 | + ), | |
| 156 | + ), | |
| 157 | + ), | |
| 158 | + ), | |
| 159 | + | |
| 160 | + ), | |
| 161 | +), | |
| 162 | + array( | |
| 163 | + 'title' => esc_html__( 'Settings', 'merchant' ), | |
| 164 | + 'module' => Merchant_Payment_Logos::MODULE_ID, | |
| 165 | + 'fields' => array( | |
| 166 | + | |
| 167 | + array( | |
| 168 | + 'id' => 'align', | |
| 169 | + 'type' => 'select', | |
| 170 | + 'title' => esc_html__( 'Align logos', 'merchant' ), | |
| 171 | + 'options' => array( | |
| 172 | + 'flex-start' => esc_html__( 'Left', 'merchant' ), | |
| 173 | + 'center' => esc_html__( 'Center', 'merchant' ), | |
| 174 | + 'flex-end' => esc_html__( 'Right', 'merchant' ), | |
| 175 | + ), | |
| 176 | + 'default' => 'flex-start', | |
| 177 | + ), | |
| 178 | + | |
| 179 | + array( | |
| 180 | + 'id' => 'title', | |
| 181 | + 'type' => 'text', | |
| 182 | + 'title' => esc_html__( 'Text above the logos', 'merchant' ), | |
| 183 | + 'default' => esc_html__( '🔒 Safe & Secure Checkout', 'merchant' ), | |
| 184 | + ), | |
| 185 | + | |
| 186 | + array( | |
| 187 | + 'id' => 'font-size', | |
| 188 | + 'type' => 'range', | |
| 189 | + 'title' => esc_html__( 'Font size', 'merchant' ), | |
| 190 | + 'min' => 1, | |
| 191 | + 'max' => 250, | |
| 192 | + 'step' => 1, | |
| 193 | + 'default' => 18, | |
| 194 | + 'unit' => 'px', | |
| 195 | + ), | |
| 196 | + | |
| 197 | + array( | |
| 198 | + 'id' => 'text-color', | |
| 199 | + 'type' => 'color', | |
| 200 | + 'title' => esc_html__( 'Text color', 'merchant' ), | |
| 201 | + 'default' => '#212121', | |
| 202 | + ), | |
| 203 | + | |
| 204 | + array( | |
| 205 | + 'id' => 'margin-top', | |
| 206 | + 'type' => 'range', | |
| 207 | + 'title' => esc_html__( 'Margin top', 'merchant' ), | |
| 208 | + 'min' => 1, | |
| 209 | + 'max' => 250, | |
| 210 | + 'step' => 1, | |
| 211 | + 'default' => 20, | |
| 212 | + 'unit' => 'px', | |
| 213 | + ), | |
| 214 | + | |
| 215 | + array( | |
| 216 | + 'id' => 'margin-bottom', | |
| 217 | + 'type' => 'range', | |
| 218 | + 'title' => esc_html__( 'Margin bottom', 'merchant' ), | |
| 219 | + 'min' => 1, | |
| 220 | + 'max' => 250, | |
| 221 | + 'step' => 1, | |
| 222 | + 'default' => 20, | |
| 223 | + 'unit' => 'px', | |
| 224 | + ), | |
| 225 | + | |
| 226 | + array( | |
| 227 | + 'id' => 'image-max-width', | |
| 228 | + 'type' => 'range', | |
| 229 | + 'title' => esc_html__( 'Image max width', 'merchant' ), | |
| 230 | + 'min' => 1, | |
| 231 | + 'max' => 250, | |
| 232 | + 'step' => 1, | |
| 233 | + 'default' => 80, | |
| 234 | + 'unit' => 'px', | |
| 235 | + ), | |
| 236 | + | |
| 237 | + array( | |
| 238 | + 'id' => 'image-max-height', | |
| 239 | + 'type' => 'range', | |
| 240 | + 'title' => esc_html__( 'Image max height', 'merchant' ), | |
| 241 | + 'min' => 1, | |
| 242 | + 'max' => 250, | |
| 243 | + 'step' => 1, | |
| 244 | + 'default' => 100, | |
| 245 | + 'unit' => 'px', | |
| 246 | + ), | |
| 247 | + | |
| 248 | + ), | |
| 249 | +), | |
| 250 | + array( | |
| 251 | + 'title' => esc_html__( 'Container Styling', 'merchant' ), | |
| 252 | + 'module' => Merchant_Payment_Logos::MODULE_ID, | |
| 253 | + 'fields' => array( | |
| 254 | + | |
| 255 | + array( | |
| 256 | + 'id' => 'container_bg_color', | |
| 257 | + 'type' => 'color', | |
| 258 | + 'title' => esc_html__( 'Background color', 'merchant' ), | |
| 259 | + 'default' => 'transparent', | |
| 260 | + ), | |
| 261 | + | |
| 262 | + array( | |
| 263 | + 'id' => 'container_padding', | |
| 264 | + 'type' => 'range', | |
| 265 | + 'title' => esc_html__( 'Padding', 'merchant' ), | |
| 266 | + 'min' => 0, | |
| 267 | + 'max' => 100, | |
| 268 | + 'step' => 1, | |
| 269 | + 'default' => 0, | |
| 270 | + 'unit' => 'px', | |
| 271 | + ), | |
| 272 | + | |
| 273 | + array( | |
| 274 | + 'id' => 'container_border_radius', | |
| 275 | + 'type' => 'range', | |
| 276 | + 'title' => esc_html__( 'Border radius', 'merchant' ), | |
| 277 | + 'min' => 0, | |
| 278 | + 'max' => 100, | |
| 279 | + 'step' => 1, | |
| 280 | + 'default' => 0, | |
| 281 | + 'unit' => 'px', | |
| 282 | + ), | |
| 283 | + | |
| 284 | + array( | |
| 285 | + 'id' => 'container_border_color', | |
| 286 | + 'type' => 'color', | |
| 287 | + 'title' => esc_html__( 'Border color', 'merchant' ), | |
| 288 | + 'default' => 'transparent', | |
| 289 | + ), | |
| 290 | + | |
| 291 | + array( | |
| 292 | + 'id' => 'container_border_width', | |
| 293 | + 'type' => 'range', | |
| 294 | + 'title' => esc_html__( 'Border width', 'merchant' ), | |
| 295 | + 'min' => 0, | |
| 296 | + 'max' => 20, | |
| 297 | + 'step' => 1, | |
| 298 | + 'default' => 0, | |
| 299 | + 'unit' => 'px', | |
| 300 | + ), | |
| 301 | + | |
| 302 | + ), | |
| 303 | +), | |
| 304 | + array( | |
| 305 | + 'title' => esc_html__( 'Exclusion Rules', 'merchant' ), | |
| 306 | + 'module' => Merchant_Payment_Logos::MODULE_ID, | |
| 307 | + 'fields' => array( | |
| 308 | + | |
| 309 | + array( | |
| 310 | + 'id' => 'exclude_products_toggle', | |
| 311 | + 'type' => 'switcher', | |
| 312 | + 'title' => esc_html__( 'Exclude specific products', 'merchant' ), | |
| 313 | + 'default' => 0, | |
| 314 | + 'ai_meta' => array( | |
| 315 | + 'toggle_for' => 'excluded_products', | |
| 316 | + 'semantic_group' => 'product_exclusion', | |
| 317 | + 'usage_hint' => 'Enable this toggle before setting excluded_products. Hides payment logos on specific individual product pages.', | |
| 318 | + ), | |
| 319 | + ), | |
| 320 | + | |
| 321 | + array( | |
| 322 | + 'id' => 'excluded_products', | |
| 323 | + 'type' => 'products_selector', | |
| 324 | + 'title' => esc_html__( 'Excluded Products', 'merchant' ), | |
| 325 | + 'multiple' => true, | |
| 326 | + 'desc' => esc_html__( 'Payment logos will not appear on these products.', 'merchant' ), | |
| 327 | + 'allowed_types' => array( 'simple', 'variable', 'external', 'grouped' ), | |
| 328 | + 'conditions' => array( | |
| 329 | + 'terms' => array( | |
| 330 | + array( | |
| 331 | + 'field' => 'exclude_products_toggle', | |
| 332 | + 'operator' => '===', | |
| 333 | + 'value' => true, | |
| 334 | + ), | |
| 335 | + ), | |
| 336 | + ), | |
| 337 | + 'ai_meta' => array( | |
| 338 | + 'entity' => 'product', | |
| 339 | + 'reference_type' => 'static', | |
| 340 | + 'value_format' => 'product_id', | |
| 341 | + 'semantic_group' => 'product_exclusion', | |
| 342 | + 'abstraction_level' => 1, | |
| 343 | + 'toggled_by' => 'exclude_products_toggle', | |
| 344 | + 'usage_hint' => 'Use ONLY for excluding specific individual products. For category exclusions, prefer excluded_categories — it is dynamic and auto-excludes future products.', | |
| 345 | + ), | |
| 346 | + ), | |
| 347 | + | |
| 348 | + array( | |
| 349 | + 'id' => 'exclude_categories_toggle', | |
| 350 | + 'type' => 'switcher', | |
| 351 | + 'title' => esc_html__( 'Exclude specific categories', 'merchant' ), | |
| 352 | + 'default' => 0, | |
| 353 | + 'ai_meta' => array( | |
| 354 | + 'toggle_for' => 'excluded_categories', | |
| 355 | + 'semantic_group' => 'product_exclusion', | |
| 356 | + 'usage_hint' => 'Enable this toggle before setting excluded_categories. Hides payment logos on all products within the selected categories. Also gates include_subcategories.', | |
| 357 | + ), | |
| 358 | + ), | |
| 359 | + | |
| 360 | + array( | |
| 361 | + 'id' => 'excluded_categories', | |
| 362 | + 'type' => 'select_ajax', | |
| 363 | + 'title' => esc_html__( 'Excluded Categories', 'merchant' ), | |
| 364 | + 'source' => 'options', | |
| 365 | + 'multiple' => true, | |
| 366 | + 'options' => Merchant_Admin_Options::get_category_select2_choices(), | |
| 367 | + 'placeholder' => esc_html__( 'Select categories', 'merchant' ), | |
| 368 | + 'desc' => esc_html__( 'Payment logos will not appear on products in these categories.', 'merchant' ), | |
| 369 | + 'conditions' => array( | |
| 370 | + 'terms' => array( | |
| 371 | + array( | |
| 372 | + 'field' => 'exclude_categories_toggle', | |
| 373 | + 'operator' => '===', | |
| 374 | + 'value' => true, | |
| 375 | + ), | |
| 376 | + ), | |
| 377 | + ), | |
| 378 | + 'ai_meta' => array( | |
| 379 | + 'entity' => 'category', | |
| 380 | + 'reference_type' => 'dynamic', | |
| 381 | + 'taxonomy' => 'product_cat', | |
| 382 | + 'value_format' => 'slug', | |
| 383 | + 'semantic_group' => 'product_exclusion', | |
| 384 | + 'abstraction_level' => 3, | |
| 385 | + 'toggled_by' => 'exclude_categories_toggle', | |
| 386 | + 'usage_hint' => 'Use when excluding products by category. Dynamic: future products added to the category are automatically excluded. Prefer over excluded_products for category-level intent.', | |
| 387 | + ), | |
| 388 | + ), | |
| 389 | + | |
| 390 | + array( | |
| 391 | + 'id' => 'include_subcategories', | |
| 392 | + 'type' => 'switcher', | |
| 393 | + 'title' => esc_html__( 'Include subcategories', 'merchant' ), | |
| 394 | + 'desc' => esc_html__( 'When enabled, selecting a parent category also applies to all of its child categories.', 'merchant' ), | |
| 395 | + 'default' => 0, | |
| 396 | + 'conditions' => array( | |
| 397 | + 'terms' => array( | |
| 398 | + array( | |
| 399 | + 'field' => 'exclude_categories_toggle', | |
| 400 | + 'operator' => '===', | |
| 401 | + 'value' => true, | |
| 402 | + ), | |
| 403 | + ), | |
| 404 | + ), | |
| 405 | + 'ai_meta' => array( | |
| 406 | + 'semantic_group' => 'product_exclusion', | |
| 407 | + 'usage_hint' => 'Enable so selected parent categories also cover their child categories when excluding products. Off by default, which excludes only the exact categories chosen.', | |
| 408 | + ), | |
| 409 | + ), | |
| 410 | + | |
| 411 | + ), | |
| 412 | +), | |
| 413 | + array( | |
| 414 | + 'module' => Merchant_Payment_Logos::MODULE_ID, | |
| 415 | + 'title' => esc_html__( 'Use shortcode', 'merchant' ), | |
| 416 | + 'fields' => array( | |
| 417 | + array( | |
| 418 | + 'id' => 'use_shortcode', | |
| 419 | + 'type' => 'switcher', | |
| 420 | + 'title' => __( 'Use shortcode', 'merchant' ), | |
| 421 | + 'default' => 0, | |
| 422 | + ), | |
| 423 | + array( | |
| 424 | + 'type' => 'info', | |
| 425 | + 'id' => 'shortcode_info', | |
| 426 | + 'content' => esc_html__( 'If you are using a page builder or a theme that supports shortcodes, then you can output the module using the shortcode above. This might be useful if, for example, you find that you want to control the position of the module output more precisely than with the module settings. Note that the shortcodes can only be used on single product pages.', 'merchant' ), | |
| 427 | + ), | |
| 428 | + array( | |
| 429 | + 'id' => 'shortcode_text', | |
| 430 | + 'type' => 'text_readonly', | |
| 431 | + 'title' => esc_html__( 'Shortcode text', 'merchant' ), | |
| 432 | + 'default' => '[merchant_module_' . str_replace( '-', '_', Merchant_Payment_Logos::MODULE_ID ) . ']', | |
| 433 | + 'condition' => array( 'use_shortcode', '==', '1' ), | |
| 434 | + ), | |
| 435 | + ), | |
| 436 | +), | |
| 437 | +); | |