| 1 |
<?php |
| 2 |
/** |
| 3 |
* Controls class. |
| 4 |
* |
| 5 |
* @package RadiusTheme\SB |
| 6 |
*/ |
| 7 |
|
| 8 |
namespace RadiusTheme\SB\Elementor\Widgets\General\PricingTable; |
| 9 |
|
| 10 |
use RadiusTheme\SB\Helpers\Fns; |
| 11 |
use RadiusTheme\SB\Elementor\Helper\ControlHelper; |
| 12 |
|
| 13 |
// Do not allow directly accessing this file. |
| 14 |
if ( ! defined( 'ABSPATH' ) ) { |
| 15 |
exit( 'This script cannot be accessed directly.' ); |
| 16 |
} |
| 17 |
|
| 18 |
/** |
| 19 |
* Settings class. |
| 20 |
* |
| 21 |
* @package RadiusTheme\SB |
| 22 |
*/ |
| 23 |
class Controls { |
| 24 |
/** |
| 25 |
* Content section |
| 26 |
* |
| 27 |
* @param object $obj Reference object. |
| 28 |
* |
| 29 |
* @return array |
| 30 |
*/ |
| 31 |
public static function content( $obj ) { |
| 32 |
return array_merge( |
| 33 |
self::preset( $obj ), |
| 34 |
self::sb_pricing_table_general_section( $obj ), |
| 35 |
self::sb_pricing_table_feature_section( $obj ), |
| 36 |
self::pricing_table_icon( $obj ), |
| 37 |
self::sb_pricing_table_pricing_section( $obj ), |
| 38 |
self::pricing_table_button( $obj ), |
| 39 |
self::sb_pricing_table_badge_section( $obj ), |
| 40 |
); |
| 41 |
} |
| 42 |
|
| 43 |
/** |
| 44 |
* Style section |
| 45 |
* |
| 46 |
* @param object $obj Reference object. |
| 47 |
* |
| 48 |
* @return array |
| 49 |
*/ |
| 50 |
public static function style( $obj ) { |
| 51 |
return array_merge( |
| 52 |
self::content_box_style( $obj ), |
| 53 |
self::icon_box_style( $obj ), |
| 54 |
self::title_style( $obj ), |
| 55 |
self::content_style( $obj ), |
| 56 |
self::pricing_table_price_style( $obj ), |
| 57 |
self::pricing_table_feature_style( $obj ), |
| 58 |
self::button_style( $obj, 'primary' ), |
| 59 |
self::pricing_table_badge_style( $obj ) |
| 60 |
); |
| 61 |
} |
| 62 |
|
| 63 |
/** |
| 64 |
* Preset section |
| 65 |
* |
| 66 |
* @param object $obj Reference object. |
| 67 |
* |
| 68 |
* @return array |
| 69 |
*/ |
| 70 |
private static function preset( $obj ) { |
| 71 |
$fields['sb_pricing_table_preset'] = $obj->start_section( |
| 72 |
esc_html__( 'Layout', 'shopbuilder' ), |
| 73 |
'content' |
| 74 |
); |
| 75 |
$fields['layout_note'] = $obj->el_heading( esc_html__( 'Predefined Layouts', 'shopbuilder' ) ); |
| 76 |
$fields['layout_style'] = [ |
| 77 |
'type' => 'rtsb-image-selector', |
| 78 |
'options' => ControlHelper::general_widgets_pricing_table_layouts(), |
| 79 |
'default' => 'rtsb-pricing-table-layout1', |
| 80 |
]; |
| 81 |
|
| 82 |
$fields['sb_button_hover_effect_note'] = $obj->el_heading( esc_html__( 'Button Hover Effect Preset', 'shopbuilder' ), 'before' ); |
| 83 |
$fields['button_hover_effects'] = [ |
| 84 |
'type' => 'rtsb-image-selector', |
| 85 |
'options' => ControlHelper::general_widgets_button_hover_effect_preset(), |
| 86 |
'default' => 'rtsb-sb-button-hover-effect-default', |
| 87 |
]; |
| 88 |
$fields['hover_animation'] = [ |
| 89 |
'mode' => 'responsive', |
| 90 |
'type' => 'choose', |
| 91 |
'label' => esc_html__( 'Hover Animation', 'shopbuilder' ), |
| 92 |
'options' => [ |
| 93 |
'left' => [ |
| 94 |
'title' => esc_html__( 'Left', 'shopbuilder' ), |
| 95 |
'icon' => 'eicon-h-align-left', |
| 96 |
], |
| 97 |
'top' => [ |
| 98 |
'title' => esc_html__( 'Top', 'shopbuilder' ), |
| 99 |
'icon' => 'eicon-v-align-top', |
| 100 |
], |
| 101 |
'right' => [ |
| 102 |
'title' => esc_html__( 'Right', 'shopbuilder' ), |
| 103 |
'icon' => 'eicon-h-align-right', |
| 104 |
], |
| 105 |
|
| 106 |
], |
| 107 |
'toggle' => true, |
| 108 |
'default' => 'left', |
| 109 |
'condition' => [ |
| 110 |
'button_hover_effects' => [ 'rtsb-sb-button-hover-effect-preset2' ], |
| 111 |
], |
| 112 |
]; |
| 113 |
$fields['sb_pricing_table_preset_end'] = $obj->end_section(); |
| 114 |
return $fields; |
| 115 |
} |
| 116 |
|
| 117 |
/** |
| 118 |
* General section |
| 119 |
* |
| 120 |
* @param object $obj Reference object. |
| 121 |
* |
| 122 |
* @return array |
| 123 |
*/ |
| 124 |
private static function sb_pricing_table_general_section( $obj ) { |
| 125 |
$fields['sb_pricing_table_general_sec_start'] = $obj->start_section( |
| 126 |
esc_html__( 'General', 'shopbuilder' ), |
| 127 |
'content' |
| 128 |
); |
| 129 |
$fields['sb_pricing_table_title_html_tag'] = [ |
| 130 |
'label' => esc_html__( 'Title Tag', 'shopbuilder' ), |
| 131 |
'description' => esc_html__( 'Please select the title tag.', 'shopbuilder' ), |
| 132 |
'type' => 'select', |
| 133 |
'options' => ControlHelper::heading_tags(), |
| 134 |
'default' => 'h2', |
| 135 |
'label_block' => true, |
| 136 |
]; |
| 137 |
$fields['sb_pricing_table_title'] = [ |
| 138 |
'label' => esc_html__( 'Title', 'shopbuilder' ), |
| 139 |
'description' => esc_html__( 'Please enter the title text.', 'shopbuilder' ), |
| 140 |
'type' => 'textarea', |
| 141 |
'label_block' => true, |
| 142 |
'default' => __( 'Standard', 'shopbuilder' ), |
| 143 |
]; |
| 144 |
$fields['display_content'] = [ |
| 145 |
'label' => esc_html__( 'Show Content?', 'shopbuilder' ), |
| 146 |
'description' => esc_html__( 'Switch on to show content.', 'shopbuilder' ), |
| 147 |
'label_on' => esc_html__( 'On', 'shopbuilder' ), |
| 148 |
'label_off' => esc_html__( 'Off', 'shopbuilder' ), |
| 149 |
'type' => 'switch', |
| 150 |
'default' => 'yes', |
| 151 |
]; |
| 152 |
$fields['sb_pricing_table_content'] = [ |
| 153 |
'label' => esc_html__( 'Content', 'shopbuilder' ), |
| 154 |
'description' => esc_html__( 'Please enter the pricing table description text.', 'shopbuilder' ), |
| 155 |
'type' => 'wysiwyg', |
| 156 |
'label_block' => true, |
| 157 |
'default' => sprintf( '<p>%s</p>', esc_html__( 'Pricing tables makes it easy to create and publish beautiful pricing tables.', 'shopbuilder' ) ), |
| 158 |
'condition' => [ |
| 159 |
'display_content' => 'yes', |
| 160 |
], |
| 161 |
]; |
| 162 |
$fields['sb_pricing_table_content_alignment'] = [ |
| 163 |
'mode' => 'responsive', |
| 164 |
'type' => 'choose', |
| 165 |
'label' => esc_html__( 'Element Alignment', 'shopbuilder' ), |
| 166 |
'options' => ControlHelper::alignment(), |
| 167 |
'separator' => 'before', |
| 168 |
'selectors' => [ $obj->selectors['layout']['alignment'] => 'text-align: {{VALUE}};' ], |
| 169 |
]; |
| 170 |
$fields['sb_pricing_table_general_sec_end'] = $obj->end_section(); |
| 171 |
|
| 172 |
return $fields; |
| 173 |
} |
| 174 |
/** |
| 175 |
* Feature section |
| 176 |
* |
| 177 |
* @param object $obj Reference object. |
| 178 |
* |
| 179 |
* @return array |
| 180 |
*/ |
| 181 |
private static function sb_pricing_table_feature_section( $obj ) { |
| 182 |
$fields['sb_pricing_table_feature_sec_start'] = $obj->start_section( |
| 183 |
esc_html__( 'Features', 'shopbuilder' ), |
| 184 |
'content' |
| 185 |
); |
| 186 |
|
| 187 |
$fields['sb_pricing_table_feature_items'] = [ |
| 188 |
'type' => 'repeater', |
| 189 |
'label' => esc_html__( 'Add Features', 'shopbuilder' ), |
| 190 |
'mode' => 'repeater', |
| 191 |
'title_field' => '{{{ sb_pricing_table_feature_text }}}', |
| 192 |
'fields' => [ |
| 193 |
'sb_pricing_table_list_style' => [ |
| 194 |
'label' => esc_html__( 'List Style', 'shopbuilder' ), |
| 195 |
'type' => 'select', |
| 196 |
'options' => [ |
| 197 |
'icon' => esc_html__( 'Icon', 'shopbuilder' ), |
| 198 |
'bullet' => esc_html__( 'Bullet', 'shopbuilder' ), |
| 199 |
'number' => esc_html__( 'Number', 'shopbuilder' ), |
| 200 |
], |
| 201 |
'default' => 'icon', |
| 202 |
'label_block' => true, |
| 203 |
], |
| 204 |
'sb_pricing_table_feature_icon' => [ |
| 205 |
'label' => esc_html__( 'Icon', 'shopbuilder' ), |
| 206 |
'type' => 'icons', |
| 207 |
'default' => [ |
| 208 |
'value' => 'fas fa-check', |
| 209 |
'library' => 'fa-solid', |
| 210 |
], |
| 211 |
'separator' => 'before-short', |
| 212 |
'condition' => [ |
| 213 |
'sb_pricing_table_list_style' => 'icon', |
| 214 |
], |
| 215 |
], |
| 216 |
'sb_pricing_table_feature_text' => [ |
| 217 |
'label' => esc_html__( 'Feature Text', 'shopbuilder' ), |
| 218 |
'type' => 'textarea', |
| 219 |
'label_block' => true, |
| 220 |
'separator' => 'before-short', |
| 221 |
'default' => __( 'Unlimited calls', 'shopbuilder' ), |
| 222 |
], |
| 223 |
'sb_pricing_table_feature_cross_text' => [ |
| 224 |
'label' => esc_html__( 'Enable Cross Out Text', 'shopbuilder' ), |
| 225 |
'description' => esc_html__( 'Switch on to enable cross out text.', 'shopbuilder' ), |
| 226 |
'separator' => 'before-short', |
| 227 |
'type' => 'switch', |
| 228 |
], |
| 229 |
|
| 230 |
], |
| 231 |
'default' => [ |
| 232 |
[ |
| 233 |
'sb_pricing_table_feature_text' => esc_html__( 'Unlimited calls', 'shopbuilder' ), |
| 234 |
'sb_pricing_table_list_style' => 'icon', |
| 235 |
'sb_pricing_table_feature_icon' => [ |
| 236 |
'value' => 'fas fa-check', |
| 237 |
'library' => 'fa-solid', |
| 238 |
], |
| 239 |
], |
| 240 |
[ |
| 241 |
'sb_pricing_table_feature_text' => esc_html__( 'Free hosting', 'shopbuilder' ), |
| 242 |
'sb_pricing_table_list_style' => 'icon', |
| 243 |
'sb_pricing_table_feature_icon' => [ |
| 244 |
'value' => 'fas fa-check', |
| 245 |
'library' => 'fa-solid', |
| 246 |
], |
| 247 |
], |
| 248 |
[ |
| 249 |
'sb_pricing_table_feature_text' => esc_html__( '24/7 support', 'shopbuilder' ), |
| 250 |
'sb_pricing_table_list_style' => 'icon', |
| 251 |
'sb_pricing_table_feature_icon' => [ |
| 252 |
'value' => 'fas fa-check', |
| 253 |
'library' => 'fa-solid', |
| 254 |
], |
| 255 |
], |
| 256 |
[ |
| 257 |
'sb_pricing_table_feature_text' => esc_html__( '500 MB Bandwidth', 'shopbuilder' ), |
| 258 |
'sb_pricing_table_list_style' => 'icon', |
| 259 |
'sb_pricing_table_feature_icon' => [ |
| 260 |
'value' => 'fas fa-check', |
| 261 |
'library' => 'fa-solid', |
| 262 |
], |
| 263 |
], |
| 264 |
[ |
| 265 |
'sb_pricing_table_feature_text' => esc_html__( 'Create your Own Store', 'shopbuilder' ), |
| 266 |
'sb_pricing_table_feature_icon' => [ |
| 267 |
'value' => 'fas fa-check', |
| 268 |
'library' => 'fa-solid', |
| 269 |
], |
| 270 |
], |
| 271 |
], |
| 272 |
|
| 273 |
]; |
| 274 |
$fields['sb_pricing_table_feature_sec_end'] = $obj->end_section(); |
| 275 |
|
| 276 |
return $fields; |
| 277 |
} |
| 278 |
/** |
| 279 |
* Content Icon |
| 280 |
* |
| 281 |
* @param object $obj Reference object. |
| 282 |
* |
| 283 |
* @return array |
| 284 |
*/ |
| 285 |
public static function pricing_table_icon( $obj ) { |
| 286 |
$alignment_options = ControlHelper::alignment(); |
| 287 |
unset( $alignment_options['justify'] ); |
| 288 |
$fields['sb_pricing_table_content_icon_sec_start'] = $obj->start_section( |
| 289 |
esc_html__( 'Icon', 'shopbuilder' ), |
| 290 |
'content', |
| 291 |
[], |
| 292 |
); |
| 293 |
$fields['sb_pricing_table_display_icon'] = [ |
| 294 |
'label' => esc_html__( 'Show Icon?', 'shopbuilder' ), |
| 295 |
'description' => esc_html__( 'Switch on to show icon.', 'shopbuilder' ), |
| 296 |
'label_on' => esc_html__( 'On', 'shopbuilder' ), |
| 297 |
'label_off' => esc_html__( 'Off', 'shopbuilder' ), |
| 298 |
'type' => 'switch', |
| 299 |
]; |
| 300 |
$fields['sb_pricing_table_icon_type'] = [ |
| 301 |
'label' => __( 'Icon Type', 'shopbuilder' ), |
| 302 |
'type' => 'select', |
| 303 |
'default' => 'icon', |
| 304 |
'options' => [ |
| 305 |
'icon' => __( 'Icon', 'shopbuilder' ), |
| 306 |
'image' => __( 'Image', 'shopbuilder' ), |
| 307 |
], |
| 308 |
'condition' => [ |
| 309 |
'sb_pricing_table_display_icon' => 'yes', |
| 310 |
], |
| 311 |
]; |
| 312 |
$fields['sb_pricing_table_icon'] = [ |
| 313 |
'label' => esc_html__( 'Icon', 'shopbuilder' ), |
| 314 |
'type' => 'icons', |
| 315 |
'default' => [ |
| 316 |
'value' => 'fas fa-code', |
| 317 |
'library' => 'fa-solid', |
| 318 |
], |
| 319 |
'condition' => [ |
| 320 |
'sb_pricing_table_icon_type' => [ 'icon' ], |
| 321 |
'sb_pricing_table_display_icon' => 'yes', |
| 322 |
], |
| 323 |
]; |
| 324 |
$fields['sb_pricing_table_image'] = [ |
| 325 |
'type' => 'media', |
| 326 |
'label' => esc_html__( 'Upload Image', 'shopbuilder' ), |
| 327 |
'default' => [ |
| 328 |
'url' => \Elementor\Utils::get_placeholder_image_src(), |
| 329 |
], |
| 330 |
'condition' => [ |
| 331 |
'sb_pricing_table_icon_type' => [ 'image' ], |
| 332 |
'sb_pricing_table_display_icon' => 'yes', |
| 333 |
], |
| 334 |
]; |
| 335 |
$fields['sb_pricing_table_image_size'] = [ |
| 336 |
'type' => 'select2', |
| 337 |
'label' => esc_html__( 'Select Image Size', 'shopbuilder' ), |
| 338 |
'description' => esc_html__( 'Please select the image size.', 'shopbuilder' ), |
| 339 |
'options' => Fns::get_image_sizes(), |
| 340 |
'default' => 'full', |
| 341 |
'label_block' => true, |
| 342 |
'content_classes' => 'elementor-descriptor', |
| 343 |
'condition' => [ |
| 344 |
'sb_pricing_table_icon_type' => [ 'image' ], |
| 345 |
'sb_pricing_table_display_icon' => 'yes', |
| 346 |
], |
| 347 |
]; |
| 348 |
$fields['sb_pricing_table_img_dimension'] = [ |
| 349 |
'type' => 'image-dimensions', |
| 350 |
'label' => esc_html__( 'Enter Custom Image Size', 'shopbuilder' ), |
| 351 |
'label_block' => true, |
| 352 |
'show_label' => true, |
| 353 |
'default' => [ |
| 354 |
'width' => 100, |
| 355 |
'height' => 100, |
| 356 |
], |
| 357 |
'conditions' => [ |
| 358 |
'relation' => 'and', |
| 359 |
'terms' => [ |
| 360 |
[ |
| 361 |
'name' => 'sb_pricing_table_image_size', |
| 362 |
'operator' => '==', |
| 363 |
'value' => 'rtsb_custom', |
| 364 |
], |
| 365 |
[ |
| 366 |
'name' => 'sb_pricing_table_icon_type', |
| 367 |
'operator' => '==', |
| 368 |
'value' => 'image', |
| 369 |
], |
| 370 |
[ |
| 371 |
'name' => 'sb_pricing_table_display_icon', |
| 372 |
'operator' => '==', |
| 373 |
'value' => 'yes', |
| 374 |
], |
| 375 |
], |
| 376 |
], |
| 377 |
]; |
| 378 |
$fields['sb_pricing_table_img_crop'] = [ |
| 379 |
'type' => 'select2', |
| 380 |
'label' => esc_html__( 'Image Crop', 'shopbuilder' ), |
| 381 |
'description' => esc_html__( 'Please click on "Apply" to update the image.', 'shopbuilder' ), |
| 382 |
'options' => [ |
| 383 |
'soft' => esc_html__( 'Soft Crop', 'shopbuilder' ), |
| 384 |
'hard' => esc_html__( 'Hard Crop', 'shopbuilder' ), |
| 385 |
], |
| 386 |
'default' => 'hard', |
| 387 |
'condition' => [ |
| 388 |
'sb_pricing_table_icon_type' => [ 'image' ], |
| 389 |
'sb_pricing_table_display_icon' => 'yes', |
| 390 |
'sb_pricing_table_image_size' => 'rtsb_custom', |
| 391 |
], |
| 392 |
]; |
| 393 |
|
| 394 |
$fields['sb_pricing_table-img_custom_dimension_note'] = [ |
| 395 |
'type' => 'html', |
| 396 |
'raw' => sprintf( |
| 397 |
'<span style="display: block; background: #fffbf1; padding: 10px; font-weight: 500; line-height: 1.4; color: #bd3a3a;border: 1px solid #bd3a3a;">%s</span>', |
| 398 |
esc_html__( 'Please note that, if you enter image size larger than the actual image itself, the image sizes will fallback to the full image dimension.', 'shopbuilder' ) |
| 399 |
), |
| 400 |
'condition' => [ |
| 401 |
'sb_pricing_table_icon_type' => [ 'image' ], |
| 402 |
'sb_pricing_table_display_icon' => 'yes', |
| 403 |
'sb_pricing_table_image_size' => 'rtsb_custom', |
| 404 |
], |
| 405 |
|
| 406 |
]; |
| 407 |
|
| 408 |
$fields['sb_pricing_table_content_sec_icon_end'] = $obj->end_section(); |
| 409 |
return $fields; |
| 410 |
} |
| 411 |
/** |
| 412 |
* Price section |
| 413 |
* |
| 414 |
* @param object $obj Reference object. |
| 415 |
* |
| 416 |
* @return array |
| 417 |
*/ |
| 418 |
private static function sb_pricing_table_pricing_section( $obj ) { |
| 419 |
$fields['sb_pricing_table_pricing_sec_start'] = $obj->start_section( |
| 420 |
esc_html__( 'Price', 'shopbuilder' ), |
| 421 |
'content' |
| 422 |
); |
| 423 |
$fields['sb_pricing_table_price'] = [ |
| 424 |
'label' => esc_html__( 'Price', 'shopbuilder' ), |
| 425 |
'description' => esc_html__( 'Please enter the pricing table price.', 'shopbuilder' ), |
| 426 |
'type' => 'text', |
| 427 |
'label_block' => true, |
| 428 |
'default' => __( '40', 'shopbuilder' ), |
| 429 |
]; |
| 430 |
$fields['sale_price'] = [ |
| 431 |
'label' => esc_html__( 'On Sale?', 'shopbuilder' ), |
| 432 |
'description' => esc_html__( 'Switch on to On Sale Price.', 'shopbuilder' ), |
| 433 |
'label_on' => esc_html__( 'On', 'shopbuilder' ), |
| 434 |
'label_off' => esc_html__( 'Off', 'shopbuilder' ), |
| 435 |
'type' => 'switch', |
| 436 |
]; |
| 437 |
$fields['sb_pricing_table_sale_price'] = [ |
| 438 |
'label' => esc_html__( 'Sale Price', 'shopbuilder' ), |
| 439 |
'description' => esc_html__( 'Please enter the pricing table sale price.', 'shopbuilder' ), |
| 440 |
'type' => 'text', |
| 441 |
'label_block' => true, |
| 442 |
'default' => __( '20', 'shopbuilder' ), |
| 443 |
'condition' => [ |
| 444 |
'sale_price' => 'yes', |
| 445 |
], |
| 446 |
]; |
| 447 |
$fields['sb_pricing_table_offer_text'] = [ |
| 448 |
'label' => esc_html__( 'Discount Text', 'shopbuilder' ), |
| 449 |
'type' => 'text', |
| 450 |
'label_block' => true, |
| 451 |
'default' => __( 'Save Up To 50%', 'shopbuilder' ), |
| 452 |
'condition' => [ |
| 453 |
'sale_price' => 'yes', |
| 454 |
'layout_style' => [ 'rtsb-pricing-table-layout3' ], |
| 455 |
], |
| 456 |
]; |
| 457 |
$fields['sb_pricing_table_currency'] = [ |
| 458 |
'label' => esc_html__( 'Currency', 'shopbuilder' ), |
| 459 |
'description' => esc_html__( 'Currency sign eg. $', 'shopbuilder' ), |
| 460 |
'type' => 'text', |
| 461 |
'label_block' => true, |
| 462 |
'default' => __( '$', 'shopbuilder' ), |
| 463 |
]; |
| 464 |
$fields['sb_pricing_table_currency_position'] = [ |
| 465 |
'mode' => 'responsive', |
| 466 |
'type' => 'choose', |
| 467 |
'label' => esc_html__( 'Position', 'shopbuilder' ), |
| 468 |
'options' => [ |
| 469 |
'left' => [ |
| 470 |
'title' => esc_html__( 'Left', 'shopbuilder' ), |
| 471 |
'icon' => 'eicon-h-align-left', |
| 472 |
], |
| 473 |
'right' => [ |
| 474 |
'title' => esc_html__( 'Right', 'shopbuilder' ), |
| 475 |
'icon' => 'eicon-h-align-right', |
| 476 |
], |
| 477 |
|
| 478 |
], |
| 479 |
'toggle' => true, |
| 480 |
'default' => 'left', |
| 481 |
]; |
| 482 |
$fields['sb_pricing_table_unit'] = [ |
| 483 |
'label' => esc_html__( 'Unit Name', 'shopbuilder' ), |
| 484 |
'description' => esc_html__( 'eg. month or year. Keep empty if you don\'t want to show unit', 'shopbuilder' ), |
| 485 |
'type' => 'text', |
| 486 |
'label_block' => true, |
| 487 |
'default' => __( 'mo', 'shopbuilder' ), |
| 488 |
]; |
| 489 |
$fields['sb_pricing_table_unit_separator'] = [ |
| 490 |
'label' => esc_html__( 'Unit Separator', 'shopbuilder' ), |
| 491 |
'type' => 'text', |
| 492 |
'label_block' => true, |
| 493 |
'default' => __( '/', 'shopbuilder' ), |
| 494 |
]; |
| 495 |
$fields['sb_pricing_table_pricing_sec_end'] = $obj->end_section(); |
| 496 |
|
| 497 |
return $fields; |
| 498 |
} |
| 499 |
|
| 500 |
/** |
| 501 |
* Button section |
| 502 |
* |
| 503 |
* @param object $obj Reference object. |
| 504 |
* |
| 505 |
* @return array |
| 506 |
*/ |
| 507 |
private static function pricing_table_button( $obj ) { |
| 508 |
$condition = [ |
| 509 |
'display_button' => 'yes', |
| 510 |
]; |
| 511 |
$fields['pricing_table_button_sec_start'] = $obj->start_section( |
| 512 |
esc_html__( 'Button', 'shopbuilder' ), |
| 513 |
'content' |
| 514 |
); |
| 515 |
$fields['display_button'] = [ |
| 516 |
'label' => esc_html__( 'Show Button?', 'shopbuilder' ), |
| 517 |
'description' => esc_html__( 'Switch on to show button.', 'shopbuilder' ), |
| 518 |
'label_on' => esc_html__( 'On', 'shopbuilder' ), |
| 519 |
'label_off' => esc_html__( 'Off', 'shopbuilder' ), |
| 520 |
'type' => 'switch', |
| 521 |
'default' => 'yes', |
| 522 |
]; |
| 523 |
$fields['sb_button_icon'] = [ |
| 524 |
'label' => esc_html__( 'Button Icon', 'shopbuilder' ), |
| 525 |
'type' => 'icons', |
| 526 |
'default' => [ |
| 527 |
'value' => 'fas fa-arrow-right', |
| 528 |
'library' => 'fa-solid', |
| 529 |
], |
| 530 |
'condition' => $condition, |
| 531 |
]; |
| 532 |
$fields['sb_button_icon_position'] = [ |
| 533 |
'mode' => 'responsive', |
| 534 |
'type' => 'choose', |
| 535 |
'label' => esc_html__( 'Position', 'shopbuilder' ), |
| 536 |
'options' => [ |
| 537 |
'left' => [ |
| 538 |
'title' => esc_html__( 'Left', 'shopbuilder' ), |
| 539 |
'icon' => 'eicon-h-align-left', |
| 540 |
], |
| 541 |
'right' => [ |
| 542 |
'title' => esc_html__( 'Right', 'shopbuilder' ), |
| 543 |
'icon' => 'eicon-h-align-right', |
| 544 |
], |
| 545 |
|
| 546 |
], |
| 547 |
'toggle' => true, |
| 548 |
'default' => 'right', |
| 549 |
'condition' => $condition, |
| 550 |
]; |
| 551 |
|
| 552 |
$fields['sb_button_content'] = [ |
| 553 |
'label' => esc_html__( 'Text', 'shopbuilder' ), |
| 554 |
'description' => esc_html__( 'Please enter the button text.', 'shopbuilder' ), |
| 555 |
'type' => 'text', |
| 556 |
'label_block' => true, |
| 557 |
'default' => __( 'Buy Now', 'shopbuilder' ), |
| 558 |
'condition' => $condition, |
| 559 |
]; |
| 560 |
$fields['sb_button_link'] = [ |
| 561 |
'type' => 'link', |
| 562 |
'label' => esc_html__( 'Link', 'shopbuilder' ), |
| 563 |
'description' => esc_html__( 'Please enter a button link.', 'shopbuilder' ), |
| 564 |
'placeholder' => esc_html__( 'https://custom-link.com', 'shopbuilder' ), |
| 565 |
'options' => [ 'url', 'is_external', 'nofollow' ], |
| 566 |
'condition' => $condition, |
| 567 |
]; |
| 568 |
|
| 569 |
$fields['pricing_table_button_sec_end'] = $obj->end_section(); |
| 570 |
|
| 571 |
return $fields; |
| 572 |
} |
| 573 |
/** |
| 574 |
* Badge section |
| 575 |
* |
| 576 |
* @param object $obj Reference object. |
| 577 |
* |
| 578 |
* @return array |
| 579 |
*/ |
| 580 |
private static function sb_pricing_table_badge_section( $obj ) { |
| 581 |
$fields['sb_pricing_table_badge_sec_start'] = $obj->start_section( |
| 582 |
esc_html__( 'Badge', 'shopbuilder' ), |
| 583 |
'content' |
| 584 |
); |
| 585 |
$fields['sb_pricing_table_badge'] = [ |
| 586 |
'label' => esc_html__( 'Display Badge?', 'shopbuilder' ), |
| 587 |
'description' => esc_html__( 'Switch on to On Sale Price.', 'shopbuilder' ), |
| 588 |
'label_on' => esc_html__( 'On', 'shopbuilder' ), |
| 589 |
'label_off' => esc_html__( 'Off', 'shopbuilder' ), |
| 590 |
'type' => 'switch', |
| 591 |
]; |
| 592 |
$fields['sb_pricing_table_badge_style'] = [ |
| 593 |
'type' => 'rtsb-image-selector', |
| 594 |
'options' => ControlHelper::general_widgets_pricing_table_badge_preset(), |
| 595 |
'default' => 'rtsb-pricing-table-badge-preset1', |
| 596 |
'condition' => [ |
| 597 |
'sb_pricing_table_badge' => 'yes', |
| 598 |
], |
| 599 |
]; |
| 600 |
$fields['sb_pricing_table_badge_text'] = [ |
| 601 |
'label' => esc_html__( 'Badge Text', 'shopbuilder' ), |
| 602 |
'type' => 'text', |
| 603 |
'label_block' => true, |
| 604 |
'default' => __( 'Featured', 'shopbuilder' ), |
| 605 |
'condition' => [ |
| 606 |
'sb_pricing_table_badge' => 'yes', |
| 607 |
'sb_pricing_table_badge_style!' => 'rtsb-pricing-table-badge-preset4', |
| 608 |
], |
| 609 |
]; |
| 610 |
$fields['sb_pricing_table_badge_position'] = [ |
| 611 |
'mode' => 'responsive', |
| 612 |
'type' => 'choose', |
| 613 |
'label' => esc_html__( 'Position', 'shopbuilder' ), |
| 614 |
'options' => [ |
| 615 |
'left' => [ |
| 616 |
'title' => esc_html__( 'Left', 'shopbuilder' ), |
| 617 |
'icon' => 'eicon-h-align-left', |
| 618 |
], |
| 619 |
'right' => [ |
| 620 |
'title' => esc_html__( 'Right', 'shopbuilder' ), |
| 621 |
'icon' => 'eicon-h-align-right', |
| 622 |
], |
| 623 |
|
| 624 |
], |
| 625 |
'toggle' => true, |
| 626 |
'default' => 'right', |
| 627 |
'condition' => [ |
| 628 |
'sb_pricing_table_badge' => 'yes', |
| 629 |
], |
| 630 |
]; |
| 631 |
$fields['badge_horizontal_position'] = [ |
| 632 |
'type' => 'slider', |
| 633 |
'mode' => 'responsive', |
| 634 |
'label' => esc_html__( 'Horizontal Position', 'shopbuilder' ), |
| 635 |
'size_units' => [ 'px','%' ], |
| 636 |
'range' => [ |
| 637 |
'px' => [ |
| 638 |
'min' => -100, |
| 639 |
'max' => 1000, |
| 640 |
], |
| 641 |
'%' => [ |
| 642 |
'min' => 0, |
| 643 |
'max' => 100, |
| 644 |
], |
| 645 |
], |
| 646 |
'selectors' => [ |
| 647 |
$obj->selectors['pricing_table_badge_style']['vertical_horizontal_position'] => '--rtsb-badge-horizontal-position: {{SIZE}}{{UNIT}};', |
| 648 |
], |
| 649 |
'condition' => [ |
| 650 |
'sb_pricing_table_badge' => 'yes', |
| 651 |
], |
| 652 |
]; |
| 653 |
$fields['badge_vertical_position'] = [ |
| 654 |
'type' => 'slider', |
| 655 |
'mode' => 'responsive', |
| 656 |
'label' => esc_html__( 'Vertical Position', 'shopbuilder' ), |
| 657 |
'size_units' => [ 'px','%' ], |
| 658 |
'range' => [ |
| 659 |
'px' => [ |
| 660 |
'min' => -100, |
| 661 |
'max' => 1000, |
| 662 |
], |
| 663 |
'%' => [ |
| 664 |
'min' => 0, |
| 665 |
'max' => 100, |
| 666 |
], |
| 667 |
], |
| 668 |
'selectors' => [ |
| 669 |
$obj->selectors['pricing_table_badge_style']['vertical_horizontal_position'] => '--rtsb-badge-vertical-position: {{SIZE}}{{UNIT}};', |
| 670 |
], |
| 671 |
'condition' => [ |
| 672 |
'sb_pricing_table_badge' => 'yes', |
| 673 |
], |
| 674 |
]; |
| 675 |
$fields['sb_pricing_table_badge_sec_end'] = $obj->end_section(); |
| 676 |
return $fields; |
| 677 |
} |
| 678 |
|
| 679 |
|
| 680 |
|
| 681 |
|
| 682 |
/** |
| 683 |
* Title style section |
| 684 |
* |
| 685 |
* @param object $obj Reference object. |
| 686 |
* |
| 687 |
* @return array |
| 688 |
*/ |
| 689 |
private static function title_style( $obj ) { |
| 690 |
$css_selectors = $obj->selectors['title_style']; |
| 691 |
$title = esc_html__( 'Title Style', 'shopbuilder' ); |
| 692 |
$selectors = [ |
| 693 |
'typography' => $css_selectors['typography'], |
| 694 |
'color' => [ $css_selectors['color'] => 'color: {{VALUE}};' ], |
| 695 |
'border' => $css_selectors['border'], |
| 696 |
'padding' => [ $css_selectors['padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ], |
| 697 |
'margin' => [ $css_selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}!important;' ], |
| 698 |
]; |
| 699 |
|
| 700 |
$fields = ControlHelper::general_elementor_style( 'pricing_table_title_style', $title, $obj, [], $selectors ); |
| 701 |
|
| 702 |
unset( |
| 703 |
$fields['pricing_table_title_style_alignment'], |
| 704 |
$fields['pricing_table_title_style_color_tabs'], |
| 705 |
$fields['pricing_table_title_style_color_tab'], |
| 706 |
$fields['pricing_table_title_style_bg_color'], |
| 707 |
$fields['pricing_table_title_style_color_tab_end'], |
| 708 |
$fields['pricing_table_title_style_hover_color_tab'], |
| 709 |
$fields['pricing_table_title_style_hover_color'], |
| 710 |
$fields['pricing_table_title_style_hover_bg_color'], |
| 711 |
$fields['pricing_table_title_style_hover_color_tab_end'], |
| 712 |
$fields['pricing_table_title_style_color_tabs_end'], |
| 713 |
$fields['pricing_table_title_style_border_hover_color'] |
| 714 |
); |
| 715 |
return $fields; |
| 716 |
} |
| 717 |
|
| 718 |
/** |
| 719 |
* Content Box style section |
| 720 |
* |
| 721 |
* @param object $obj Reference object. |
| 722 |
* |
| 723 |
* @return array |
| 724 |
*/ |
| 725 |
private static function content_box_style( $obj ) { |
| 726 |
$css_selectors = $obj->selectors['content_box_style']; |
| 727 |
$title = esc_html__( 'Content Box Style', 'shopbuilder' ); |
| 728 |
$selectors = [ |
| 729 |
'typography' => $css_selectors['typography'], |
| 730 |
'box_shadow' => $css_selectors['box_shadow'], |
| 731 |
'hover_box_shadow' => $css_selectors['hover_box_shadow'], |
| 732 |
'gradient_bg' => $css_selectors['gradient_bg'], |
| 733 |
'hover_gradient_bg' => $css_selectors['hover_gradient_bg'], |
| 734 |
'bg_overlay' => $css_selectors['bg_overlay'], |
| 735 |
'hover_bg_overlay' => $css_selectors['hover_bg_overlay'], |
| 736 |
'border' => $css_selectors['border'], |
| 737 |
'border_hover_color' => [ $css_selectors['border_hover_color'] => 'border-color: {{VALUE}};' ], |
| 738 |
'padding' => [ $css_selectors['padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ], |
| 739 |
'border_radius' => [ $css_selectors['border_radius'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ], |
| 740 |
]; |
| 741 |
|
| 742 |
$fields = ControlHelper::general_elementor_style( 'pricing_table_content_box_style', $title, $obj, [], $selectors ); |
| 743 |
|
| 744 |
unset( |
| 745 |
$fields['pricing_table_content_box_style_typo_note'], |
| 746 |
$fields['rtsb_el_pricing_table_content_box_style_typography'], |
| 747 |
$fields['pricing_table_content_box_style_color'], |
| 748 |
$fields['pricing_table_content_box_style_bg_color'], |
| 749 |
$fields['pricing_table_content_box_style_alignment'], |
| 750 |
$fields['pricing_table_content_box_style_hover_color'], |
| 751 |
$fields['pricing_table_content_box_style_hover_bg_color'], |
| 752 |
$fields['pricing_table_content_box_style_margin'] |
| 753 |
); |
| 754 |
$fields['pricing_table_content_box_style_border_note']['separator'] = 'default'; |
| 755 |
$fields['pricing_table_content_box_style_color_note']['separator'] = 'default'; |
| 756 |
$extra_controls['pricing_table_content_box_style_border_radius'] = [ |
| 757 |
'label' => esc_html__( 'Border Radius', 'shopbuilder' ), |
| 758 |
'type' => 'dimensions', |
| 759 |
'mode' => 'responsive', |
| 760 |
'size_units' => [ 'px' ], |
| 761 |
'selectors' => $selectors['border_radius'], |
| 762 |
]; |
| 763 |
$fields = Fns::insert_controls( 'pricing_table_content_box_style_spacing_note', $fields, $extra_controls ); |
| 764 |
|
| 765 |
$extra_controls2['pricing_table_content_box_style_gradient_bg'] = [ |
| 766 |
'label' => esc_html__( 'Background', 'shopbuilder' ), |
| 767 |
'type' => 'background', |
| 768 |
'mode' => 'group', |
| 769 |
'selector' => $selectors['gradient_bg'], |
| 770 |
]; |
| 771 |
$extra_controls2['pricing_table_content_box_style_bg_overlay'] = [ |
| 772 |
'label' => esc_html__( 'Background Overlay', 'shopbuilder' ), |
| 773 |
'type' => 'background', |
| 774 |
'mode' => 'group', |
| 775 |
'exclude' => [ 'image' ], // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude |
| 776 |
'selector' => $selectors['bg_overlay'], |
| 777 |
'fields_options' => [ |
| 778 |
'background' => [ |
| 779 |
'label' => esc_html__( 'Overlay Background Type', 'shopbuilder' ), |
| 780 |
], |
| 781 |
], |
| 782 |
]; |
| 783 |
$extra_controls2['pricing_table_content_box_style_box_shadow'] = [ |
| 784 |
'type' => 'box-shadow', |
| 785 |
'mode' => 'group', |
| 786 |
'label' => esc_html__( 'Box Shadow', 'shopbuilder' ), |
| 787 |
'selector' => $selectors['box_shadow'], |
| 788 |
]; |
| 789 |
$fields = Fns::insert_controls( 'pricing_table_content_box_style_color_tab', $fields, $extra_controls2, true ); |
| 790 |
$extra_controls3['pricing_table_content_box_style_hover_gradient_bg'] = [ |
| 791 |
'label' => esc_html__( 'Background', 'shopbuilder' ), |
| 792 |
'type' => 'background', |
| 793 |
'mode' => 'group', |
| 794 |
'selector' => $selectors['hover_gradient_bg'], |
| 795 |
]; |
| 796 |
$extra_controls3['pricing_table_content_box_style_hover_bg_overlay'] = [ |
| 797 |
'label' => esc_html__( 'Background Overlay', 'shopbuilder' ), |
| 798 |
'type' => 'background', |
| 799 |
'mode' => 'group', |
| 800 |
'exclude' => [ 'image' ], // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude |
| 801 |
'selector' => $selectors['hover_bg_overlay'], |
| 802 |
'fields_options' => [ |
| 803 |
'background' => [ |
| 804 |
'label' => esc_html__( 'Overlay Background Type', 'shopbuilder' ), |
| 805 |
], |
| 806 |
], |
| 807 |
]; |
| 808 |
$extra_controls3['pricing_table_content_box_style_hover_box_shadow'] = [ |
| 809 |
'type' => 'box-shadow', |
| 810 |
'mode' => 'group', |
| 811 |
'label' => esc_html__( 'Box Shadow', 'shopbuilder' ), |
| 812 |
'selector' => $selectors['hover_box_shadow'], |
| 813 |
]; |
| 814 |
$fields = Fns::insert_controls( 'pricing_table_content_box_style_hover_color_tab', $fields, $extra_controls3, true ); |
| 815 |
|
| 816 |
return $fields; |
| 817 |
} |
| 818 |
/** |
| 819 |
* Content style section |
| 820 |
* |
| 821 |
* @param object $obj Reference object. |
| 822 |
* |
| 823 |
* @return array |
| 824 |
*/ |
| 825 |
private static function content_style( $obj ) { |
| 826 |
$condition = [ |
| 827 |
'display_content' => 'yes', |
| 828 |
]; |
| 829 |
$css_selectors = $obj->selectors['content_style']; |
| 830 |
$title = esc_html__( 'Description Style', 'shopbuilder' ); |
| 831 |
$selectors = [ |
| 832 |
'typography' => $css_selectors['typography'], |
| 833 |
'color' => [ $css_selectors['color'] => 'color: {{VALUE}};' ], |
| 834 |
'border' => $css_selectors['border'], |
| 835 |
'padding' => [ $css_selectors['padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ], |
| 836 |
'margin' => [ $css_selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ], |
| 837 |
]; |
| 838 |
|
| 839 |
$fields = ControlHelper::general_elementor_style( 'pricing_table_content_style', $title, $obj, $condition, $selectors ); |
| 840 |
|
| 841 |
unset( |
| 842 |
$fields['pricing_table_content_style_alignment'], |
| 843 |
$fields['pricing_table_content_style_color_tabs'], |
| 844 |
$fields['pricing_table_content_style_color_tab'], |
| 845 |
$fields['pricing_table_content_style_bg_color'], |
| 846 |
$fields['pricing_table_content_style_color_tab_end'], |
| 847 |
$fields['pricing_table_content_style_hover_color_tab'], |
| 848 |
$fields['pricing_table_content_style_hover_color'], |
| 849 |
$fields['pricing_table_content_style_hover_bg_color'], |
| 850 |
$fields['pricing_table_content_style_hover_color_tab_end'], |
| 851 |
$fields['pricing_table_content_style_color_tabs_end'], |
| 852 |
$fields['pricing_table_content_style_border_hover_color'] |
| 853 |
); |
| 854 |
|
| 855 |
return $fields; |
| 856 |
} |
| 857 |
/** |
| 858 |
* Button style section |
| 859 |
* |
| 860 |
* @param object $obj Reference object. |
| 861 |
* |
| 862 |
* @return array |
| 863 |
*/ |
| 864 |
private static function button_style( $obj, $type = 'primary' ) { |
| 865 |
$condition = [ |
| 866 |
'display_button' => 'yes', |
| 867 |
]; |
| 868 |
$css_selectors = $obj->selectors[ $type . '_button_style' ]; |
| 869 |
$title = esc_html__( 'Button Style', 'shopbuilder' ); |
| 870 |
$selectors = [ |
| 871 |
'typography' => $css_selectors['typography'], |
| 872 |
'icon_size' => [ |
| 873 |
$css_selectors['icon_size']['font_size'] => 'font-size: {{SIZE}}{{UNIT}};', |
| 874 |
$css_selectors['icon_size']['svg'] => 'height: {{SIZE}}{{UNIT}};width: {{SIZE}}{{UNIT}};', |
| 875 |
], |
| 876 |
'icon_gap' => [ $css_selectors['icon_gap'] => 'gap: {{SIZE}}{{UNIT}};' ], |
| 877 |
'btn_width' => [ $css_selectors['btn_width'] => 'min-width: {{SIZE}}{{UNIT}};' ], |
| 878 |
'btn_height' => [ $css_selectors['btn_height'] => 'height: {{SIZE}}{{UNIT}};' ], |
| 879 |
'color' => [ $css_selectors['color'] => 'color: {{VALUE}};' ], |
| 880 |
'line_color' => [ $css_selectors['line_color'] => 'background-color: {{VALUE}};' ], |
| 881 |
'hover_color' => [ $css_selectors['hover_color'] => 'color: {{VALUE}};' ], |
| 882 |
'gradient_bg' => $css_selectors['gradient_bg'], |
| 883 |
'hover_gradient_bg' => $css_selectors['hover_gradient_bg'], |
| 884 |
'border' => $css_selectors['border'], |
| 885 |
'box_shadow' => $css_selectors['box_shadow'], |
| 886 |
'hover_box_shadow' => $css_selectors['hover_box_shadow'], |
| 887 |
'border_hover_color' => [ $css_selectors['border_hover_color'] => 'border-color: {{VALUE}};' ], |
| 888 |
'padding' => [ $css_selectors['padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ], |
| 889 |
'margin' => [ $css_selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ], |
| 890 |
'border_radius' => [ $css_selectors['border_radius'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ], |
| 891 |
]; |
| 892 |
|
| 893 |
$fields = ControlHelper::general_elementor_style( 'sb_' . $type . '_button_style', $title, $obj, $condition, $selectors ); |
| 894 |
unset( |
| 895 |
$fields[ 'sb_' . $type . '_button_style_bg_color' ], |
| 896 |
$fields[ 'sb_' . $type . '_button_style_alignment' ], |
| 897 |
$fields[ 'sb_' . $type . '_button_style_hover_bg_color' ], |
| 898 |
); |
| 899 |
$extra_controls[ 'sb_' . $type . '_button_style_border_radius' ] = [ |
| 900 |
'label' => esc_html__( 'Border Radius', 'shopbuilder' ), |
| 901 |
'type' => 'dimensions', |
| 902 |
'mode' => 'responsive', |
| 903 |
'size_units' => [ 'px' ], |
| 904 |
'selectors' => $selectors['border_radius'], |
| 905 |
]; |
| 906 |
$fields = Fns::insert_controls( 'sb_' . $type . '_button_style_spacing_note', $fields, $extra_controls ); |
| 907 |
$extra_controls2[ 'sb_' . $type . '_button_style_btn_width' ] = [ |
| 908 |
'type' => 'slider', |
| 909 |
'mode' => 'responsive', |
| 910 |
'label' => esc_html__( 'Button Width', 'shopbuilder' ), |
| 911 |
'size_units' => [ 'px','%' ], |
| 912 |
'range' => [ |
| 913 |
'px' => [ |
| 914 |
'min' => 10, |
| 915 |
'max' => 1000, |
| 916 |
], |
| 917 |
'%' => [ |
| 918 |
'min' => 0, |
| 919 |
'max' => 100, |
| 920 |
], |
| 921 |
], |
| 922 |
'selectors' => $selectors['btn_width'], |
| 923 |
]; |
| 924 |
$extra_controls2[ 'sb_' . $type . '_button_style_btn_height' ] = [ |
| 925 |
'type' => 'slider', |
| 926 |
'mode' => 'responsive', |
| 927 |
'label' => esc_html__( 'Button Height', 'shopbuilder' ), |
| 928 |
'size_units' => [ 'px','%' ], |
| 929 |
'range' => [ |
| 930 |
'px' => [ |
| 931 |
'min' => 10, |
| 932 |
'max' => 1000, |
| 933 |
], |
| 934 |
'%' => [ |
| 935 |
'min' => 0, |
| 936 |
'max' => 100, |
| 937 |
], |
| 938 |
], |
| 939 |
'selectors' => $selectors['btn_height'], |
| 940 |
]; |
| 941 |
|
| 942 |
$extra_controls2[ 'sb_' . $type . '_button_style_icon_size' ] = [ |
| 943 |
'type' => 'slider', |
| 944 |
'mode' => 'responsive', |
| 945 |
'label' => esc_html__( 'Icon Size', 'shopbuilder' ), |
| 946 |
'size_units' => [ 'px' ], |
| 947 |
'range' => [ |
| 948 |
'px' => [ |
| 949 |
'min' => 0, |
| 950 |
'max' => 100, |
| 951 |
], |
| 952 |
], |
| 953 |
'selectors' => $selectors['icon_size'], |
| 954 |
]; |
| 955 |
$extra_controls2[ 'sb_' . $type . '_button_style_icon_gap' ] = [ |
| 956 |
'type' => 'slider', |
| 957 |
'mode' => 'responsive', |
| 958 |
'label' => esc_html__( 'Icon Gap', 'shopbuilder' ), |
| 959 |
'size_units' => [ 'px' ], |
| 960 |
'range' => [ |
| 961 |
'px' => [ |
| 962 |
'min' => 0, |
| 963 |
'max' => 100, |
| 964 |
], |
| 965 |
], |
| 966 |
'selectors' => $selectors['icon_gap'], |
| 967 |
]; |
| 968 |
$extra_controls2[ 'sb_' . $type . '_button_style_box_shadow' ] = [ |
| 969 |
'type' => 'box-shadow', |
| 970 |
'mode' => 'group', |
| 971 |
'label' => esc_html__( 'Box Shadow', 'shopbuilder' ), |
| 972 |
'selector' => $selectors['box_shadow'], |
| 973 |
]; |
| 974 |
$extra_controls2[ 'sb_' . $type . '_button_style_hover_box_shadow' ] = [ |
| 975 |
'type' => 'box-shadow', |
| 976 |
'mode' => 'group', |
| 977 |
'label' => esc_html__( 'Hover Box Shadow', 'shopbuilder' ), |
| 978 |
'selector' => $selectors['hover_box_shadow'], |
| 979 |
]; |
| 980 |
$fields = Fns::insert_controls( 'sb_' . $type . '_button_style_spacing_note', $fields, $extra_controls2, true ); |
| 981 |
|
| 982 |
$extra_controls3[ 'sb_' . $type . '_button_style_gradient_bg' ] = [ |
| 983 |
'label' => esc_html__( 'Background', 'shopbuilder' ), |
| 984 |
'type' => 'background', |
| 985 |
'mode' => 'group', |
| 986 |
'selector' => $selectors['gradient_bg'], |
| 987 |
]; |
| 988 |
$extra_controls3[ 'sb_' . $type . '_button_line_color' ] = [ |
| 989 |
'label' => esc_html__( 'Line Color', 'shopbuilder' ), |
| 990 |
'type' => 'color', |
| 991 |
'selectors' => $selectors['line_color'] , |
| 992 |
'condition' => [ |
| 993 |
'layout_style' => [ 'rtsb-pricing-table-layout3' ], |
| 994 |
], |
| 995 |
]; |
| 996 |
$fields = Fns::insert_controls( 'sb_' . $type . '_button_style_color', $fields, $extra_controls3, true ); |
| 997 |
|
| 998 |
$extra_controls4[ 'sb_' . $type . '_button_style_hover_gradient_bg' ] = [ |
| 999 |
'label' => esc_html__( 'Hover Background', 'shopbuilder' ), |
| 1000 |
'type' => 'background', |
| 1001 |
'mode' => 'group', |
| 1002 |
'selector' => $selectors['hover_gradient_bg'], |
| 1003 |
]; |
| 1004 |
$fields = Fns::insert_controls( 'sb_' . $type . '_button_style_hover_color', $fields, $extra_controls4, true ); |
| 1005 |
|
| 1006 |
return $fields; |
| 1007 |
} |
| 1008 |
/** |
| 1009 |
* Icon style section |
| 1010 |
* |
| 1011 |
* @param object $obj Reference object. |
| 1012 |
* |
| 1013 |
* @return array |
| 1014 |
*/ |
| 1015 |
private static function icon_box_style( $obj ) { |
| 1016 |
$condition = [ |
| 1017 |
'sb_pricing_table_display_icon' => 'yes', |
| 1018 |
]; |
| 1019 |
$css_selectors = $obj->selectors['pricing_table_icon_style']; |
| 1020 |
$title = esc_html__( 'Icon Style', 'shopbuilder' ); |
| 1021 |
$selectors = [ |
| 1022 |
'icon_size' => [ |
| 1023 |
$css_selectors['icon_size']['font_size'] => 'font-size: {{SIZE}}{{UNIT}};', |
| 1024 |
$css_selectors['icon_size']['svg'] => 'height: {{SIZE}}{{UNIT}};width: {{SIZE}}{{UNIT}};', |
| 1025 |
], |
| 1026 |
'box_shadow' => $css_selectors['box_shadow'], |
| 1027 |
'icon_width' => [ $css_selectors['icon_width'] => 'width: {{SIZE}}{{UNIT}};' ], |
| 1028 |
'icon_height' => [ $css_selectors['icon_height'] => 'height: {{SIZE}}{{UNIT}};' ], |
| 1029 |
'color' => [ $css_selectors['color'] => 'color: {{VALUE}};' ], |
| 1030 |
'gradient_bg' => $css_selectors['gradient_bg'], |
| 1031 |
'border' => $css_selectors['border'], |
| 1032 |
'margin' => [ $css_selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ], |
| 1033 |
'border_radius' => [ $css_selectors['border_radius'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ], |
| 1034 |
]; |
| 1035 |
|
| 1036 |
$fields = ControlHelper::general_elementor_style( 'pricing_table_icon_style', $title, $obj, $condition, $selectors ); |
| 1037 |
unset( |
| 1038 |
$fields['pricing_table_icon_style_typo_note'], |
| 1039 |
$fields['rtsb_el_pricing_table_icon_style_typography'], |
| 1040 |
$fields['pricing_table_icon_style_color_tabs'], |
| 1041 |
$fields['pricing_table_icon_style_color_tab'], |
| 1042 |
$fields['pricing_table_icon_style_color_tab_end'], |
| 1043 |
$fields['pricing_table_icon_style_hover_color_tab'], |
| 1044 |
$fields['pricing_table_icon_style_bg_color'], |
| 1045 |
$fields['pricing_table_icon_style_hover_bg_color'], |
| 1046 |
$fields['pricing_table_icon_style_alignment'], |
| 1047 |
$fields['pricing_table_icon_style_padding'], |
| 1048 |
$fields['pricing_table_icon_style_hover_color'], |
| 1049 |
$fields['pricing_table_icon_style_border_hover_color'], |
| 1050 |
); |
| 1051 |
$extra_controls['pricing_table_icon_style_border_radius'] = [ |
| 1052 |
'label' => esc_html__( 'Border Radius', 'shopbuilder' ), |
| 1053 |
'type' => 'dimensions', |
| 1054 |
'mode' => 'responsive', |
| 1055 |
'size_units' => [ 'px' ], |
| 1056 |
'selectors' => $selectors['border_radius'], |
| 1057 |
]; |
| 1058 |
$extra_controls['pricing_table_icon_style_box_shadow'] = [ |
| 1059 |
'type' => 'box-shadow', |
| 1060 |
'mode' => 'group', |
| 1061 |
'label' => esc_html__( 'Box Shadow', 'shopbuilder' ), |
| 1062 |
'selector' => $selectors['box_shadow'], |
| 1063 |
]; |
| 1064 |
$fields = Fns::insert_controls( 'pricing_table_icon_style_spacing_note', $fields, $extra_controls ); |
| 1065 |
$extra_controls2['pricing_table_icon_style_icon_width'] = [ |
| 1066 |
'type' => 'slider', |
| 1067 |
'mode' => 'responsive', |
| 1068 |
'label' => esc_html__( 'Icon Width', 'shopbuilder' ), |
| 1069 |
'size_units' => [ 'px','%' ], |
| 1070 |
'range' => [ |
| 1071 |
'px' => [ |
| 1072 |
'min' => 10, |
| 1073 |
'max' => 1000, |
| 1074 |
], |
| 1075 |
'%' => [ |
| 1076 |
'min' => 0, |
| 1077 |
'max' => 100, |
| 1078 |
], |
| 1079 |
], |
| 1080 |
'selectors' => $selectors['icon_width'], |
| 1081 |
]; |
| 1082 |
$extra_controls2['pricing_table_icon_style_icon_height'] = [ |
| 1083 |
'type' => 'slider', |
| 1084 |
'mode' => 'responsive', |
| 1085 |
'label' => esc_html__( 'Icon Height', 'shopbuilder' ), |
| 1086 |
'size_units' => [ 'px','%' ], |
| 1087 |
'range' => [ |
| 1088 |
'px' => [ |
| 1089 |
'min' => 10, |
| 1090 |
'max' => 1000, |
| 1091 |
], |
| 1092 |
'%' => [ |
| 1093 |
'min' => 0, |
| 1094 |
'max' => 100, |
| 1095 |
], |
| 1096 |
], |
| 1097 |
'selectors' => $selectors['icon_height'], |
| 1098 |
]; |
| 1099 |
|
| 1100 |
$extra_controls2['pricing_table_icon_style_icon_size'] = [ |
| 1101 |
'type' => 'slider', |
| 1102 |
'mode' => 'responsive', |
| 1103 |
'label' => esc_html__( 'Icon Size', 'shopbuilder' ), |
| 1104 |
'size_units' => [ 'px' ], |
| 1105 |
'range' => [ |
| 1106 |
'px' => [ |
| 1107 |
'min' => 0, |
| 1108 |
'max' => 100, |
| 1109 |
], |
| 1110 |
], |
| 1111 |
'selectors' => $selectors['icon_size'], |
| 1112 |
]; |
| 1113 |
|
| 1114 |
$fields = Fns::insert_controls( 'pricing_table_icon_style_spacing_note', $fields, $extra_controls2, true ); |
| 1115 |
$extra_controls3['pricing_table_icon_style_gradient_bg'] = [ |
| 1116 |
'label' => esc_html__( 'Background', 'shopbuilder' ), |
| 1117 |
'type' => 'background', |
| 1118 |
'mode' => 'group', |
| 1119 |
'selector' => $selectors['gradient_bg'], |
| 1120 |
]; |
| 1121 |
$fields = Fns::insert_controls( 'pricing_table_icon_style_color', $fields, $extra_controls3, true ); |
| 1122 |
|
| 1123 |
return $fields; |
| 1124 |
} |
| 1125 |
/** |
| 1126 |
* Icon style section |
| 1127 |
* |
| 1128 |
* @param object $obj Reference object. |
| 1129 |
* |
| 1130 |
* @return array |
| 1131 |
*/ |
| 1132 |
private static function pricing_table_price_style( $obj ) { |
| 1133 |
|
| 1134 |
$css_selectors = $obj->selectors['price_style']; |
| 1135 |
$title = esc_html__( 'Price Style', 'shopbuilder' ); |
| 1136 |
$selectors = [ |
| 1137 |
'typography' => $css_selectors['typography'], |
| 1138 |
'offer_typo' => $css_selectors['offer_typo'], |
| 1139 |
'unit_typo' => $css_selectors['unit_typo'], |
| 1140 |
'color' => [ $css_selectors['color'] => 'color: {{VALUE}};' ], |
| 1141 |
'offer_color' => [ $css_selectors['offer_color'] => 'color: {{VALUE}};' ], |
| 1142 |
'offer_bg_color' => [ $css_selectors['offer_bg_color'] => 'background-color: {{VALUE}};' ], |
| 1143 |
'sale_price_color' => [ $css_selectors['sale_price_color'] => 'color: {{VALUE}};' ], |
| 1144 |
'price_unit_color' => [ $css_selectors['price_unit_color'] => 'color: {{VALUE}};' ], |
| 1145 |
'border' => $css_selectors['border'], |
| 1146 |
'padding' => [ $css_selectors['padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ], |
| 1147 |
'margin' => [ $css_selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ], |
| 1148 |
]; |
| 1149 |
|
| 1150 |
$fields = ControlHelper::general_elementor_style( 'pricing_table_price_style', $title, $obj, [], $selectors ); |
| 1151 |
|
| 1152 |
unset( |
| 1153 |
$fields['pricing_table_price_style_alignment'], |
| 1154 |
$fields['pricing_table_price_style_color_tabs'], |
| 1155 |
$fields['pricing_table_price_style_color_tab'], |
| 1156 |
$fields['pricing_table_price_style_bg_color'], |
| 1157 |
$fields['pricing_table_price_style_color_tab_end'], |
| 1158 |
$fields['pricing_table_price_style_hover_color_tab'], |
| 1159 |
$fields['pricing_table_price_style_hover_color'], |
| 1160 |
$fields['pricing_table_price_style_hover_bg_color'], |
| 1161 |
$fields['pricing_table_price_style_hover_color_tab_end'], |
| 1162 |
$fields['pricing_table_price_style_color_tabs_end'], |
| 1163 |
$fields['pricing_table_price_style_border_hover_color'] |
| 1164 |
); |
| 1165 |
$extra_controls['pricing_table_price_style_unit_typo'] = [ |
| 1166 |
'mode' => 'group', |
| 1167 |
'type' => 'typography', |
| 1168 |
'label' => __( 'Price Unit Typography', 'shopbuilder' ), |
| 1169 |
'selector' => $selectors['unit_typo'], |
| 1170 |
]; |
| 1171 |
$extra_controls['pricing_table_price_style_offer_typo'] = [ |
| 1172 |
'mode' => 'group', |
| 1173 |
'type' => 'typography', |
| 1174 |
'label' => __( 'Offer Text Typography', 'shopbuilder' ), |
| 1175 |
'selector' => $selectors['offer_typo'], |
| 1176 |
'condition' => [ |
| 1177 |
'sale_price' => 'yes', |
| 1178 |
'layout_style' => [ 'rtsb-pricing-table-layout3' ], |
| 1179 |
], |
| 1180 |
]; |
| 1181 |
$fields = Fns::insert_controls( 'rtsb_el_pricing_table_price_style_typography', $fields, $extra_controls, true ); |
| 1182 |
|
| 1183 |
$extra_controls2['pricing_table_price_style_sale_price_color'] = [ |
| 1184 |
'label' => __( 'Sale Price Color', 'shopbuilder' ), |
| 1185 |
'type' => 'color', |
| 1186 |
'selectors' => $selectors['sale_price_color'], |
| 1187 |
'condition' => [ |
| 1188 |
'sale_price' => 'yes', |
| 1189 |
], |
| 1190 |
]; |
| 1191 |
$extra_controls2['pricing_table_price_style_price_unit_color'] = [ |
| 1192 |
'label' => __( 'Price Unit Color', 'shopbuilder' ), |
| 1193 |
'type' => 'color', |
| 1194 |
'selectors' => $selectors['price_unit_color'], |
| 1195 |
]; |
| 1196 |
$extra_controls2['pricing_table_price_style_price_offer_color'] = [ |
| 1197 |
'label' => __( 'Offer Text Color', 'shopbuilder' ), |
| 1198 |
'type' => 'color', |
| 1199 |
'selectors' => $selectors['offer_color'], |
| 1200 |
'condition' => [ |
| 1201 |
'sale_price' => 'yes', |
| 1202 |
'layout_style' => [ 'rtsb-pricing-table-layout3' ], |
| 1203 |
], |
| 1204 |
]; |
| 1205 |
$extra_controls2['pricing_table_price_style_price_offer_bg_color'] = [ |
| 1206 |
'label' => __( 'Offer Text Background Color', 'shopbuilder' ), |
| 1207 |
'type' => 'color', |
| 1208 |
'selectors' => $selectors['offer_bg_color'], |
| 1209 |
'condition' => [ |
| 1210 |
'sale_price' => 'yes', |
| 1211 |
'layout_style' => [ 'rtsb-pricing-table-layout3' ], |
| 1212 |
], |
| 1213 |
]; |
| 1214 |
$fields = Fns::insert_controls( 'pricing_table_price_style_color', $fields, $extra_controls2, true ); |
| 1215 |
return $fields; |
| 1216 |
} |
| 1217 |
/** |
| 1218 |
* Feature style section |
| 1219 |
* |
| 1220 |
* @param object $obj Reference object. |
| 1221 |
* |
| 1222 |
* @return array |
| 1223 |
*/ |
| 1224 |
private static function pricing_table_feature_style( $obj ) { |
| 1225 |
|
| 1226 |
$css_selectors = $obj->selectors['feature_item_style']; |
| 1227 |
$title = esc_html__( 'Feature Item Style', 'shopbuilder' ); |
| 1228 |
$selectors = [ |
| 1229 |
'typography' => $css_selectors['typography'], |
| 1230 |
'icon_size' => [ |
| 1231 |
$css_selectors['icon_size']['font_size'] => 'font-size: {{SIZE}}{{UNIT}};', |
| 1232 |
$css_selectors['icon_size']['svg'] => 'height: {{SIZE}}{{UNIT}};width: {{SIZE}}{{UNIT}};', |
| 1233 |
], |
| 1234 |
'color' => [ $css_selectors['color'] => 'color: {{VALUE}};' ], |
| 1235 |
'list_icon_color' => [ $css_selectors['list_icon_color'] => 'color: {{VALUE}};' ], |
| 1236 |
'list_dot_color' => [ $css_selectors['list_dot_color'] => 'background-color: {{VALUE}};' ], |
| 1237 |
'border' => $css_selectors['border'], |
| 1238 |
'padding' => [ $css_selectors['padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ], |
| 1239 |
'margin' => [ $css_selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ], |
| 1240 |
]; |
| 1241 |
|
| 1242 |
$fields = ControlHelper::general_elementor_style( 'pricing_table_feature_item_style', $title, $obj, [], $selectors ); |
| 1243 |
|
| 1244 |
unset( |
| 1245 |
$fields['pricing_table_feature_item_style_alignment'], |
| 1246 |
$fields['pricing_table_feature_item_style_color_tabs'], |
| 1247 |
$fields['pricing_table_feature_item_style_color_tab'], |
| 1248 |
$fields['pricing_table_feature_item_style_bg_color'], |
| 1249 |
$fields['pricing_table_feature_item_style_color_tab_end'], |
| 1250 |
$fields['pricing_table_feature_item_style_hover_color_tab'], |
| 1251 |
$fields['pricing_table_feature_item_style_hover_color'], |
| 1252 |
$fields['pricing_table_feature_item_style_hover_bg_color'], |
| 1253 |
$fields['pricing_table_feature_item_style_hover_color_tab_end'], |
| 1254 |
$fields['pricing_table_feature_item_style_color_tabs_end'], |
| 1255 |
$fields['pricing_table_feature_item_style_border_hover_color'] |
| 1256 |
); |
| 1257 |
$extra_controls['pricing_table_feature_item_style_icon_size'] = [ |
| 1258 |
'type' => 'slider', |
| 1259 |
'mode' => 'responsive', |
| 1260 |
'label' => esc_html__( 'Icon Size', 'shopbuilder' ), |
| 1261 |
'size_units' => [ 'px' ], |
| 1262 |
'range' => [ |
| 1263 |
'px' => [ |
| 1264 |
'min' => 10, |
| 1265 |
'max' => 100, |
| 1266 |
], |
| 1267 |
|
| 1268 |
], |
| 1269 |
'selectors' => $selectors['icon_size'], |
| 1270 |
]; |
| 1271 |
$fields = Fns::insert_controls( 'rtsb_el_pricing_table_feature_item_style_typography', $fields, $extra_controls, true ); |
| 1272 |
$extra_controls2['pricing_table_feature_item_style_list_icon_color'] = [ |
| 1273 |
'label' => __( 'Icon Color', 'shopbuilder' ), |
| 1274 |
'type' => 'color', |
| 1275 |
'selectors' => $selectors['list_icon_color'], |
| 1276 |
]; |
| 1277 |
$extra_controls2['pricing_table_feature_item_style_list_dot_color'] = [ |
| 1278 |
'label' => __( 'Dot Color', 'shopbuilder' ), |
| 1279 |
'type' => 'color', |
| 1280 |
'selectors' => $selectors['list_dot_color'], |
| 1281 |
]; |
| 1282 |
$extra_controls2['pricing_table_feature_item_cross_color'] = [ |
| 1283 |
'label' => __( 'Cross Out Text Color', 'shopbuilder' ), |
| 1284 |
'type' => 'color', |
| 1285 |
'selectors' => [ $css_selectors['cross_color'] => 'color: {{VALUE}};' ], |
| 1286 |
]; |
| 1287 |
$fields = Fns::insert_controls( 'pricing_table_feature_item_style_color', $fields, $extra_controls2, true ); |
| 1288 |
return $fields; |
| 1289 |
} |
| 1290 |
/** |
| 1291 |
* Badge style section |
| 1292 |
* |
| 1293 |
* @param object $obj Reference object. |
| 1294 |
* |
| 1295 |
* @return array |
| 1296 |
*/ |
| 1297 |
private static function pricing_table_badge_style( $obj ) { |
| 1298 |
$condition = [ |
| 1299 |
'sb_pricing_table_badge' => 'yes', |
| 1300 |
]; |
| 1301 |
$css_selectors = $obj->selectors['pricing_table_badge_style']; |
| 1302 |
$title = esc_html__( 'Badge Style', 'shopbuilder' ); |
| 1303 |
$selectors = [ |
| 1304 |
'typography' => $css_selectors['typography'], |
| 1305 |
'color' => [ |
| 1306 |
$css_selectors['color']['color'] => 'color: {{VALUE}};' , |
| 1307 |
$css_selectors['color']['svg'] => 'fill: {{VALUE}};', |
| 1308 |
], |
| 1309 |
'box_shadow' => $css_selectors['box_shadow'], |
| 1310 |
'gradient_bg' => $css_selectors['gradient_bg'], |
| 1311 |
'border' => $css_selectors['border'], |
| 1312 |
'padding' => [ $css_selectors['padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ], |
| 1313 |
'border_radius' => [ $css_selectors['border_radius'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ], |
| 1314 |
]; |
| 1315 |
|
| 1316 |
$fields = ControlHelper::general_elementor_style( 'pricing_table_badge_style', $title, $obj, $condition, $selectors ); |
| 1317 |
|
| 1318 |
unset( |
| 1319 |
$fields['pricing_table_badge_style_bg_color'], |
| 1320 |
$fields['pricing_table_badge_style_alignment'], |
| 1321 |
$fields['pricing_table_badge_style_color_tabs'], |
| 1322 |
$fields['pricing_table_badge_style_color_tab'], |
| 1323 |
$fields['pricing_table_badge_style_color_tab_end'], |
| 1324 |
$fields['pricing_table_badge_style_hover_color_tab'], |
| 1325 |
$fields['pricing_table_badge_style_hover_color'], |
| 1326 |
$fields['pricing_table_badge_style_hover_bg_color'], |
| 1327 |
$fields['pricing_table_badge_style_hover_color_tab_end'], |
| 1328 |
$fields['pricing_table_badge_style_color_tabs_end'], |
| 1329 |
$fields['pricing_table_badge_style_border_hover_color'], |
| 1330 |
$fields['pricing_table_badge_style_margin'] |
| 1331 |
); |
| 1332 |
$fields['pricing_table_badge_style_border_note']['separator'] = 'default'; |
| 1333 |
$fields['pricing_table_badge_style_color_note']['separator'] = 'default'; |
| 1334 |
$fields['pricing_table_badge_style_border_note']['condition'] = [ |
| 1335 |
'sb_pricing_table_badge_style' => [ 'rtsb-pricing-table-badge-preset1' ], |
| 1336 |
]; |
| 1337 |
$fields['rtsb_el_pricing_table_badge_style_border']['condition'] = [ |
| 1338 |
'sb_pricing_table_badge_style' => [ 'rtsb-pricing-table-badge-preset1' ], |
| 1339 |
]; |
| 1340 |
|
| 1341 |
$fields['pricing_table_badge_style_typo_note']['condition'] = [ |
| 1342 |
'sb_pricing_table_badge_style!' => [ 'rtsb-pricing-table-badge-preset4' ], |
| 1343 |
]; |
| 1344 |
$fields['rtsb_el_pricing_table_badge_style_typography']['condition'] = [ |
| 1345 |
'sb_pricing_table_badge_style!' => [ 'rtsb-pricing-table-badge-preset4' ], |
| 1346 |
]; |
| 1347 |
|
| 1348 |
$fields['pricing_table_badge_style_spacing_note']['condition'] = [ |
| 1349 |
'sb_pricing_table_badge_style!' => [ 'rtsb-pricing-table-badge-preset4' ], |
| 1350 |
]; |
| 1351 |
$fields['pricing_table_badge_style_padding']['condition'] = [ |
| 1352 |
'sb_pricing_table_badge_style!' => [ 'rtsb-pricing-table-badge-preset4' ], |
| 1353 |
]; |
| 1354 |
$extra_controls['pricing_table_badge_style_border_radius'] = [ |
| 1355 |
'label' => esc_html__( 'Border Radius', 'shopbuilder' ), |
| 1356 |
'type' => 'dimensions', |
| 1357 |
'mode' => 'responsive', |
| 1358 |
'size_units' => [ 'px' ], |
| 1359 |
'selectors' => $selectors['border_radius'], |
| 1360 |
'condition' => [ |
| 1361 |
'sb_pricing_table_badge_style' => [ 'rtsb-pricing-table-badge-preset1' ], |
| 1362 |
], |
| 1363 |
]; |
| 1364 |
$fields = Fns::insert_controls( 'pricing_table_badge_style_spacing_note', $fields, $extra_controls ); |
| 1365 |
|
| 1366 |
$extra_controls2['pricing_table_badge_style_gradient_bg'] = [ |
| 1367 |
'label' => esc_html__( 'Background', 'shopbuilder' ), |
| 1368 |
'type' => 'background', |
| 1369 |
'mode' => 'group', |
| 1370 |
'selector' => $selectors['gradient_bg'], |
| 1371 |
]; |
| 1372 |
$extra_controls2['pricing_table_badge_style_box_shadow'] = [ |
| 1373 |
'type' => 'box-shadow', |
| 1374 |
'mode' => 'group', |
| 1375 |
'label' => esc_html__( 'Box Shadow', 'shopbuilder' ), |
| 1376 |
'selector' => $selectors['box_shadow'], |
| 1377 |
]; |
| 1378 |
$fields = Fns::insert_controls( 'pricing_table_badge_style_color', $fields, $extra_controls2, true ); |
| 1379 |
|
| 1380 |
return $fields; |
| 1381 |
} |
| 1382 |
} |
| 1383 |
|