| 1 |
<?php |
| 2 |
/** |
| 3 |
* Quick View |
| 4 |
* |
| 5 |
* @package Merchant |
| 6 |
*/ |
| 7 |
|
| 8 |
if ( ! defined( 'ABSPATH' ) ) { |
| 9 |
exit; // Exit if accessed directly |
| 10 |
} |
| 11 |
|
| 12 |
/** |
| 13 |
* Settings. |
| 14 |
* |
| 15 |
*/ |
| 16 |
Merchant_Admin_Options::create( array( |
| 17 |
'title' => esc_html__( 'Settings', 'merchant' ), |
| 18 |
'module' => 'quick-view', |
| 19 |
'fields' => array( |
| 20 |
|
| 21 |
array( |
| 22 |
'id' => 'button_type', |
| 23 |
'type' => 'select', |
| 24 |
'title' => esc_html__( 'Button type', 'merchant' ), |
| 25 |
'options' => array( |
| 26 |
'text' => esc_html__( 'Text', 'merchant' ), |
| 27 |
'icon' => esc_html__( 'Icon', 'merchant' ), |
| 28 |
'icon-text' => esc_html__( 'Icon + text', 'merchant' ), |
| 29 |
), |
| 30 |
'default' => 'text', |
| 31 |
), |
| 32 |
|
| 33 |
array( |
| 34 |
'id' => 'button_text', |
| 35 |
'type' => 'text', |
| 36 |
'title' => esc_html__( 'Button text', 'merchant' ), |
| 37 |
'default' => esc_html__( 'Quick view', 'merchant' ), |
| 38 |
'condition' => array( 'button_type', 'any', 'text|icon-text' ), |
| 39 |
), |
| 40 |
|
| 41 |
array( |
| 42 |
'id' => 'button_icon', |
| 43 |
'type' => 'choices', |
| 44 |
'title' => esc_html__( 'Select an icon', 'merchant' ), |
| 45 |
'options' => array( |
| 46 |
'eye' => '%s/eye.svg', |
| 47 |
'cart' => '%s/cart.svg', |
| 48 |
), |
| 49 |
'default' => 'eye', |
| 50 |
'condition' => array( 'button_type', 'any', 'icon|icon-text' ), |
| 51 |
), |
| 52 |
|
| 53 |
array( |
| 54 |
'id' => 'button_position', |
| 55 |
'type' => 'select', |
| 56 |
'title' => esc_html__( 'Button position', 'merchant' ), |
| 57 |
'options' => array( |
| 58 |
'before' => esc_html__( 'Before - Add to cart', 'merchant' ), |
| 59 |
'after' => esc_html__( 'After - Add to cart', 'merchant' ), |
| 60 |
'overlay' => esc_html__( 'Overlay', 'merchant' ), |
| 61 |
), |
| 62 |
'default' => 'overlay', |
| 63 |
), |
| 64 |
|
| 65 |
array( |
| 66 |
'id' => 'button-position-top', |
| 67 |
'type' => 'range', |
| 68 |
'title' => esc_html__( 'Button position top', 'merchant' ), |
| 69 |
'min' => 1, |
| 70 |
'max' => 100, |
| 71 |
'step' => 1, |
| 72 |
'default' => 50, |
| 73 |
'unit' => '%', |
| 74 |
'condition' => array( 'button_position', '==', 'overlay' ), |
| 75 |
), |
| 76 |
|
| 77 |
array( |
| 78 |
'id' => 'button-position-left', |
| 79 |
'type' => 'range', |
| 80 |
'title' => esc_html__( 'Button position left', 'merchant' ), |
| 81 |
'min' => 1, |
| 82 |
'max' => 100, |
| 83 |
'step' => 1, |
| 84 |
'default' => 50, |
| 85 |
'unit' => '%', |
| 86 |
'condition' => array( 'button_position', '==', 'overlay' ), |
| 87 |
), |
| 88 |
|
| 89 |
array( |
| 90 |
'id' => 'icon-color', |
| 91 |
'type' => 'color', |
| 92 |
'title' => esc_html__( 'Icon color', 'merchant' ), |
| 93 |
'default' => '#ffffff', |
| 94 |
'condition' => array( 'button_type', 'any', 'icon|icon-text' ), |
| 95 |
), |
| 96 |
|
| 97 |
array( |
| 98 |
'id' => 'icon-hover-color', |
| 99 |
'type' => 'color', |
| 100 |
'title' => esc_html__( 'Icon color hover', 'merchant' ), |
| 101 |
'default' => '#ffffff', |
| 102 |
'condition' => array( 'button_type', 'any', 'icon|icon-text' ), |
| 103 |
), |
| 104 |
|
| 105 |
array( |
| 106 |
'id' => 'text-color', |
| 107 |
'type' => 'color', |
| 108 |
'title' => esc_html__( 'Button text color', 'merchant' ), |
| 109 |
'default' => '#ffffff', |
| 110 |
'condition' => array( 'button_type', 'any', 'text|icon-text' ), |
| 111 |
), |
| 112 |
|
| 113 |
array( |
| 114 |
'id' => 'text-hover-color', |
| 115 |
'type' => 'color', |
| 116 |
'title' => esc_html__( 'Button text color hover', 'merchant' ), |
| 117 |
'default' => '#ffffff', |
| 118 |
'condition' => array( 'button_type', 'any', 'text|icon-text' ), |
| 119 |
), |
| 120 |
|
| 121 |
array( |
| 122 |
'id' => 'border-color', |
| 123 |
'type' => 'color', |
| 124 |
'title' => esc_html__( 'Button border color', 'merchant' ), |
| 125 |
'default' => '#212121', |
| 126 |
), |
| 127 |
|
| 128 |
array( |
| 129 |
'id' => 'border-hover-color', |
| 130 |
'type' => 'color', |
| 131 |
'title' => esc_html__( 'Button border color hover', 'merchant' ), |
| 132 |
'default' => '#414141', |
| 133 |
), |
| 134 |
|
| 135 |
array( |
| 136 |
'id' => 'background-color', |
| 137 |
'type' => 'color', |
| 138 |
'title' => esc_html__( 'Button background color', 'merchant' ), |
| 139 |
'default' => '#212121', |
| 140 |
), |
| 141 |
|
| 142 |
array( |
| 143 |
'id' => 'background-hover-color', |
| 144 |
'type' => 'color', |
| 145 |
'title' => esc_html__( 'Button background color hover', 'merchant' ), |
| 146 |
'default' => '#414141', |
| 147 |
), |
| 148 |
|
| 149 |
), |
| 150 |
) ); |
| 151 |
|
| 152 |
|
| 153 |
/** |
| 154 |
* Modal. |
| 155 |
* |
| 156 |
*/ |
| 157 |
Merchant_Admin_Options::create( array( |
| 158 |
'title' => esc_html__( 'Modal', 'merchant' ), |
| 159 |
'module' => 'quick-view', |
| 160 |
'fields' => array( |
| 161 |
|
| 162 |
array( |
| 163 |
'id' => 'modal_width', |
| 164 |
'type' => 'range', |
| 165 |
'title' => esc_html__( 'Modal width', 'merchant' ), |
| 166 |
'min' => 1, |
| 167 |
'max' => 2000, |
| 168 |
'step' => 1, |
| 169 |
'default' => 1000, |
| 170 |
'unit' => 'px', |
| 171 |
), |
| 172 |
|
| 173 |
array( |
| 174 |
'id' => 'modal_height', |
| 175 |
'type' => 'range', |
| 176 |
'title' => esc_html__( 'Modal height', 'merchant' ), |
| 177 |
'min' => 1, |
| 178 |
'max' => 2000, |
| 179 |
'step' => 1, |
| 180 |
'default' => 500, |
| 181 |
'unit' => 'px', |
| 182 |
), |
| 183 |
|
| 184 |
array( |
| 185 |
'id' => 'place_product_image', |
| 186 |
'type' => 'radio', |
| 187 |
'title' => esc_html__( 'Place product image', 'merchant' ), |
| 188 |
'options' => array( |
| 189 |
'thumbs-at-left' => esc_html__( 'Thumbs at left', 'merchant' ), |
| 190 |
'thumbs-at-right' => esc_html__( 'Thumbs at right', 'merchant' ), |
| 191 |
'thumbs-at-bottom' => esc_html__( 'Thumbs at bottom', 'merchant' ), |
| 192 |
), |
| 193 |
'default' => 'thumbs-at-left', |
| 194 |
), |
| 195 |
|
| 196 |
array( |
| 197 |
'id' => 'zoom_effect', |
| 198 |
'type' => 'switcher', |
| 199 |
'title' => esc_html__( 'Zoom effect on image', 'merchant' ), |
| 200 |
'default' => 1, |
| 201 |
), |
| 202 |
|
| 203 |
array( |
| 204 |
'id' => 'place_product_description', |
| 205 |
'type' => 'radio', |
| 206 |
'title' => esc_html__( 'Place product description', 'merchant' ), |
| 207 |
'options' => array( |
| 208 |
'top' => esc_html__( 'Top', 'merchant' ), |
| 209 |
'bottom' => esc_html__( 'Bottom', 'merchant' ), |
| 210 |
), |
| 211 |
'default' => 'top', |
| 212 |
), |
| 213 |
|
| 214 |
array( |
| 215 |
'id' => 'description_style', |
| 216 |
'type' => 'radio', |
| 217 |
'title' => esc_html__( 'Description style', 'merchant' ), |
| 218 |
'options' => array( |
| 219 |
'full' => esc_html__( 'Full description', 'merchant' ), |
| 220 |
'short' => esc_html__( 'Short description', 'merchant' ), |
| 221 |
), |
| 222 |
'default' => 'full', |
| 223 |
), |
| 224 |
|
| 225 |
array( |
| 226 |
'id' => 'show_quantity', |
| 227 |
'type' => 'switcher', |
| 228 |
'title' => esc_html__( 'Show quantity selector', 'merchant' ), |
| 229 |
'default' => 1, |
| 230 |
), |
| 231 |
|
| 232 |
array( |
| 233 |
'id' => 'sale-price-color', |
| 234 |
'type' => 'color', |
| 235 |
'title' => esc_html__( 'Sale price color', 'merchant' ), |
| 236 |
'default' => '#212121', |
| 237 |
), |
| 238 |
|
| 239 |
array( |
| 240 |
'id' => 'regular-price-color', |
| 241 |
'type' => 'color', |
| 242 |
'title' => esc_html__( 'Regular price color', 'merchant' ), |
| 243 |
'default' => '#999999', |
| 244 |
), |
| 245 |
|
| 246 |
), |
| 247 |
) ); |
| 248 |
|