| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* Size Chart Options. |
| 5 |
* |
| 6 |
* @package Merchant |
| 7 |
*/ |
| 8 |
|
| 9 |
if ( ! defined( 'ABSPATH' ) ) { |
| 10 |
exit; // Exit if accessed directly |
| 11 |
} |
| 12 |
|
| 13 |
// Settings |
| 14 |
|
| 15 |
return array( |
| 16 |
array( |
| 17 |
'title' => esc_html__( 'Settings', 'merchant' ), |
| 18 |
'module' => Merchant_Size_Chart::MODULE_ID, |
| 19 |
'fields' => array( |
| 20 |
|
| 21 |
array( |
| 22 |
'id' => 'global_size_chart', |
| 23 |
'type' => 'select_size_chart', |
| 24 |
'title' => esc_html__( 'Global size chart (optional)', 'merchant' ), |
| 25 |
/* Translators: 1. Link open tag 2. Link close tag */ |
| 26 |
'desc' => sprintf( esc_html__( 'Your size charts will appear in this option as you create them. %1$sClick here%2$s to create or modify the available size charts.', 'merchant' ), '<a href="'. esc_url( admin_url( 'edit.php?post_type=merchant_size_chart' ) ) .'">', '</a>' ), |
| 27 |
'ai_meta' => array( |
| 28 |
'usage_hint' => 'Selects the fallback size chart shown on all products. Overridden by per-product size chart assignments. Leave empty to show no global chart.', |
| 29 |
), |
| 30 |
), |
| 31 |
|
| 32 |
array( |
| 33 |
'id' => 'global_size_chart_categories', |
| 34 |
'type' => 'select_ajax', |
| 35 |
'title' => esc_html__( 'Categories', 'merchant' ), |
| 36 |
'source' => 'options', |
| 37 |
'multiple' => true, |
| 38 |
'options' => Merchant_Admin_Options::get_category_select2_choices(), |
| 39 |
'placeholder' => esc_html__( 'Select categories', 'merchant' ), |
| 40 |
'desc' => esc_html__( 'The global size chart will appear only on products within the selected categories. If no categories are selected, the size chart will be displayed on all products.', 'merchant' ), |
| 41 |
'ai_meta' => array( |
| 42 |
'entity' => 'category', |
| 43 |
'reference_type' => 'dynamic', |
| 44 |
'taxonomy' => 'product_cat', |
| 45 |
'value_format' => 'slug', |
| 46 |
'abstraction_level' => 3, |
| 47 |
'usage_hint' => 'Limits the global size chart to products in these categories. Dynamic: future products added to the category are included. Leave empty to apply to all products.', |
| 48 |
), |
| 49 |
), |
| 50 |
|
| 51 |
array( |
| 52 |
'id' => 'text', |
| 53 |
'type' => 'text', |
| 54 |
'title' => esc_html__( 'Label text', 'merchant' ), |
| 55 |
'default' => esc_html__( 'Size Chart', 'merchant' ), |
| 56 |
), |
| 57 |
|
| 58 |
array( |
| 59 |
'id' => 'icon', |
| 60 |
'type' => 'choices', |
| 61 |
'title' => esc_html__( 'Icon', 'merchant' ), |
| 62 |
'options' => array( |
| 63 |
'icon-size-chart' => MERCHANT_URI . 'assets/images/icons/size-chart/admin/icon-size-chart.svg', |
| 64 |
'cloth-size-guide-icon' => MERCHANT_URI . 'assets/images/icons/size-chart/admin/cloth-size-guide-icon.svg', |
| 65 |
'measurement-vertical-icon' => MERCHANT_URI . 'assets/images/icons/size-chart/admin/measurement-vertical-icon.svg', |
| 66 |
'measuring-tape-icon' => MERCHANT_URI . 'assets/images/icons/size-chart/admin/measuring-tape-icon.svg', |
| 67 |
'pencil-rule' => MERCHANT_URI . 'assets/images/icons/size-chart/admin/pencil-rule.svg', |
| 68 |
'scale-ruler-icon' => MERCHANT_URI . 'assets/images/icons/size-chart/admin/scale-ruler-icon.svg', |
| 69 |
), |
| 70 |
'default' => 'icon-size-chart', |
| 71 |
), |
| 72 |
|
| 73 |
array( |
| 74 |
'id' => 'icon-size', |
| 75 |
'type' => 'range', |
| 76 |
'title' => esc_html__( 'Icon size', 'merchant' ), |
| 77 |
'min' => 1, |
| 78 |
'max' => 100, |
| 79 |
'step' => 1, |
| 80 |
'default' => 24, |
| 81 |
'unit' => 'px', |
| 82 |
), |
| 83 |
|
| 84 |
array( |
| 85 |
'id' => 'title-text-color', |
| 86 |
'type' => 'color', |
| 87 |
'title' => esc_html__( 'Title text color', 'merchant' ), |
| 88 |
'default' => '#212121', |
| 89 |
), |
| 90 |
|
| 91 |
array( |
| 92 |
'id' => 'title-text-color-hover', |
| 93 |
'type' => 'color', |
| 94 |
'title' => esc_html__( 'Title text color hover', 'merchant' ), |
| 95 |
'default' => '#757575', |
| 96 |
), |
| 97 |
|
| 98 |
array( |
| 99 |
'id' => 'icon-color', |
| 100 |
'type' => 'color', |
| 101 |
'title' => esc_html__( 'Icon color', 'merchant' ), |
| 102 |
), |
| 103 |
|
| 104 |
array( |
| 105 |
'id' => 'icon-color-hover', |
| 106 |
'type' => 'color', |
| 107 |
'title' => esc_html__( 'Icon color hover', 'merchant' ), |
| 108 |
), |
| 109 |
|
| 110 |
), |
| 111 |
), |
| 112 |
array( |
| 113 |
'title' => esc_html__( 'Display position', 'merchant' ), |
| 114 |
'module' => Merchant_Size_Chart::MODULE_ID, |
| 115 |
'fields' => array( |
| 116 |
|
| 117 |
array( |
| 118 |
'id' => 'display_hook', |
| 119 |
'type' => 'hook_select', |
| 120 |
'title' => esc_html__( 'Loading position and priority on single product', 'merchant' ), |
| 121 |
'desc' => esc_html__( 'Where the button renders on the single product page. A lower priority number moves it higher. The add to cart positions only exist while a product is purchasable and in stock.', 'merchant' ), |
| 122 |
'options' => array( |
| 123 |
'' => esc_html__( 'Default', 'merchant' ), |
| 124 |
'woocommerce_single_product_summary' => esc_html__( 'After Product summary', 'merchant' ), |
| 125 |
'woocommerce_before_add_to_cart_form' => esc_html__( 'Before add to cart form', 'merchant' ), |
| 126 |
'woocommerce_after_add_to_cart_form' => esc_html__( 'After add to cart form', 'merchant' ), |
| 127 |
'woocommerce_before_add_to_cart_button' => esc_html__( 'Before add to cart button', 'merchant' ), |
| 128 |
'woocommerce_after_add_to_cart_button' => esc_html__( 'After add to cart button', 'merchant' ), |
| 129 |
), |
| 130 |
'min' => 1, |
| 131 |
'max' => 999, |
| 132 |
'step' => 1, |
| 133 |
'unit' => '', |
| 134 |
'order' => true, |
| 135 |
'default' => array( |
| 136 |
'hook_name' => '', |
| 137 |
'hook_priority' => 10, |
| 138 |
), |
| 139 |
'ai_meta' => array( |
| 140 |
'usage_hint' => 'Controls where the size chart button renders on the single product page. Leave hook_name empty to keep the default placement: inside the variation block for variable products, next to the add to cart button otherwise. Valid hook_name values are an empty string, woocommerce_single_product_summary, woocommerce_before_add_to_cart_form, woocommerce_after_add_to_cart_form, woocommerce_before_add_to_cart_button, woocommerce_after_add_to_cart_button. A lower hook_priority renders the button higher on the page.', |
| 141 |
), |
| 142 |
), |
| 143 |
), |
| 144 |
), |
| 145 |
array( |
| 146 |
'title' => esc_html__( 'Popup Design', 'merchant' ), |
| 147 |
'module' => Merchant_Size_Chart::MODULE_ID, |
| 148 |
'fields' => array( |
| 149 |
|
| 150 |
array( |
| 151 |
'id' => 'popup-width', |
| 152 |
'type' => 'range', |
| 153 |
'title' => esc_html__( 'Popup width', 'merchant' ), |
| 154 |
'min' => 1, |
| 155 |
'max' => 2000, |
| 156 |
'step' => 1, |
| 157 |
'default' => 750, |
| 158 |
'unit' => 'px', |
| 159 |
), |
| 160 |
|
| 161 |
array( |
| 162 |
'id' => 'background-color', |
| 163 |
'type' => 'color', |
| 164 |
'title' => esc_html__( 'Background color', 'merchant' ), |
| 165 |
'default' => '#f2f2f2', |
| 166 |
), |
| 167 |
|
| 168 |
array( |
| 169 |
'id' => 'close-icon-color', |
| 170 |
'type' => 'color', |
| 171 |
'title' => esc_html__( 'Close icon color', 'merchant' ), |
| 172 |
'default' => '#212121', |
| 173 |
), |
| 174 |
|
| 175 |
array( |
| 176 |
'id' => 'close-icon-color-hover', |
| 177 |
'type' => 'color', |
| 178 |
'title' => esc_html__( 'Close icon color hover', 'merchant' ), |
| 179 |
'default' => '#757575', |
| 180 |
), |
| 181 |
|
| 182 |
array( |
| 183 |
'id' => 'title-color', |
| 184 |
'type' => 'color', |
| 185 |
'title' => esc_html__( 'Title color', 'merchant' ), |
| 186 |
'default' => '#212112', |
| 187 |
), |
| 188 |
|
| 189 |
array( |
| 190 |
'id' => 'tabs-color', |
| 191 |
'type' => 'color', |
| 192 |
'title' => esc_html__( 'Tabs color', 'merchant' ), |
| 193 |
'default' => '#757575', |
| 194 |
), |
| 195 |
|
| 196 |
array( |
| 197 |
'id' => 'tabs-color-active', |
| 198 |
'type' => 'color', |
| 199 |
'title' => esc_html__( 'Tabs color active', 'merchant' ), |
| 200 |
'default' => '#212121', |
| 201 |
), |
| 202 |
|
| 203 |
array( |
| 204 |
'id' => 'table-headings-background-color', |
| 205 |
'type' => 'color', |
| 206 |
'title' => esc_html__( 'Table headings background color', 'merchant' ), |
| 207 |
'default' => '#212121', |
| 208 |
), |
| 209 |
|
| 210 |
array( |
| 211 |
'id' => 'table-headings-text-color', |
| 212 |
'type' => 'color', |
| 213 |
'title' => esc_html__( 'Table headings text color', 'merchant' ), |
| 214 |
'default' => '#ffffff', |
| 215 |
), |
| 216 |
|
| 217 |
array( |
| 218 |
'id' => 'table-body-background-color', |
| 219 |
'type' => 'color', |
| 220 |
'title' => esc_html__( 'Table body background color', 'merchant' ), |
| 221 |
'default' => '#ffffff', |
| 222 |
), |
| 223 |
|
| 224 |
array( |
| 225 |
'id' => 'table-body-text-color', |
| 226 |
'type' => 'color', |
| 227 |
'title' => esc_html__( 'Table body text color', 'merchant' ), |
| 228 |
'default' => '#212121', |
| 229 |
), |
| 230 |
|
| 231 |
array( |
| 232 |
'id' => 'description-text-color', |
| 233 |
'type' => 'color', |
| 234 |
'title' => esc_html__( 'Description text Color', 'merchant' ), |
| 235 |
'default' => '#212121', |
| 236 |
), |
| 237 |
|
| 238 |
array( |
| 239 |
'id' => 'description-link-color', |
| 240 |
'type' => 'color', |
| 241 |
'title' => esc_html__( 'Description link color', 'merchant' ), |
| 242 |
'default' => '#212121', |
| 243 |
), |
| 244 |
|
| 245 |
array( |
| 246 |
'id' => 'description-link-color-hover', |
| 247 |
'type' => 'color', |
| 248 |
'title' => esc_html__( 'Description link color hover', 'merchant' ), |
| 249 |
'default' => '#757575', |
| 250 |
), |
| 251 |
|
| 252 |
), |
| 253 |
), |
| 254 |
array( |
| 255 |
'module' => Merchant_Size_Chart::MODULE_ID, |
| 256 |
'title' => esc_html__( 'Use shortcode', 'merchant' ), |
| 257 |
'fields' => array( |
| 258 |
array( |
| 259 |
'id' => 'use_shortcode', |
| 260 |
'type' => 'switcher', |
| 261 |
'title' => __( 'Use shortcode', 'merchant' ), |
| 262 |
'default' => 0, |
| 263 |
), |
| 264 |
array( |
| 265 |
'type' => 'info', |
| 266 |
'id' => 'shortcode_info', |
| 267 |
'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' ), |
| 268 |
), |
| 269 |
array( |
| 270 |
'id' => 'shortcode_text', |
| 271 |
'type' => 'text_readonly', |
| 272 |
'title' => esc_html__( 'Shortcode text', 'merchant' ), |
| 273 |
'default' => '[merchant_module_' . str_replace( '-', '_', Merchant_Size_Chart::MODULE_ID ) . ']', |
| 274 |
'condition' => array( 'use_shortcode', '==', '1' ), |
| 275 |
), |
| 276 |
), |
| 277 |
), |
| 278 |
); |
| 279 |
|