| 1 |
<?php |
| 2 |
/** |
| 3 |
* Elementor Style Fields Class. |
| 4 |
* |
| 5 |
* This class contains all the common fields for Style tab. |
| 6 |
* |
| 7 |
* @package RadiusTheme\SB |
| 8 |
*/ |
| 9 |
|
| 10 |
namespace RadiusTheme\SB\Elementor\Widgets\Controls; |
| 11 |
|
| 12 |
use RadiusTheme\SB\Helpers\Fns; |
| 13 |
use RadiusTheme\SB\Elementor\Helper\ControlHelper; |
| 14 |
|
| 15 |
// Do not allow directly accessing this file. |
| 16 |
if ( ! defined( 'ABSPATH' ) ) { |
| 17 |
exit( 'This script cannot be accessed directly.' ); |
| 18 |
} |
| 19 |
|
| 20 |
/** |
| 21 |
* Elementor Style Fields Class. |
| 22 |
*/ |
| 23 |
class StyleFields { |
| 24 |
/** |
| 25 |
* Tab name. |
| 26 |
* |
| 27 |
* @access private |
| 28 |
* @static |
| 29 |
* |
| 30 |
* @var string |
| 31 |
*/ |
| 32 |
private static $tab = 'style'; |
| 33 |
|
| 34 |
/** |
| 35 |
* Color Scheme Section |
| 36 |
* |
| 37 |
* @param object $obj Reference object. |
| 38 |
* |
| 39 |
* @return array |
| 40 |
*/ |
| 41 |
public static function color_scheme( $obj ): array { |
| 42 |
$css_selectors = $obj->selectors['color_scheme']; |
| 43 |
|
| 44 |
$fields['color_scheme_section'] = $obj->start_section( esc_html__( 'Color Scheme', 'shopbuilder' ), self::$tab ); |
| 45 |
|
| 46 |
$fields['primary_color'] = [ |
| 47 |
'type' => 'color', |
| 48 |
'label' => esc_html__( 'Primary Color', 'shopbuilder' ), |
| 49 |
'default' => '#0066ff', |
| 50 |
'selectors' => [ |
| 51 |
$css_selectors['primary_color'] => '--rtsb-color-primary: {{VALUE}}', |
| 52 |
], |
| 53 |
]; |
| 54 |
|
| 55 |
$fields['secondary_color'] = [ |
| 56 |
'type' => 'color', |
| 57 |
'label' => esc_html__( 'Secondary Color', 'shopbuilder' ), |
| 58 |
'default' => '#111', |
| 59 |
'selectors' => [ |
| 60 |
$css_selectors['secondary_color'] => '--rtsb-color-secondary: {{VALUE}}', |
| 61 |
], |
| 62 |
]; |
| 63 |
|
| 64 |
$fields['loader_color'] = [ |
| 65 |
'type' => 'color', |
| 66 |
'label' => esc_html__( 'Pre-Loader Color', 'shopbuilder' ), |
| 67 |
'default' => '#111', |
| 68 |
'selectors' => [ |
| 69 |
$css_selectors['secondary_color'] => '--rtsb-color-loader: {{VALUE}}', |
| 70 |
], |
| 71 |
]; |
| 72 |
|
| 73 |
$fields['color_scheme_section_end'] = $obj->end_section(); |
| 74 |
|
| 75 |
return apply_filters( 'rtsb/elements/elementor/color_style_control', $fields, $obj ); |
| 76 |
} |
| 77 |
|
| 78 |
/** |
| 79 |
* Layout Design Section |
| 80 |
* |
| 81 |
* @param object $obj Reference object. |
| 82 |
* |
| 83 |
* @return array |
| 84 |
*/ |
| 85 |
public static function layout_design( $obj ): array { |
| 86 |
$css_selectors = $obj->selectors['advanced']; |
| 87 |
|
| 88 |
$fields['layout_design_section'] = $obj->start_section( esc_html__( 'Layout Design', 'shopbuilder' ), self::$tab ); |
| 89 |
|
| 90 |
$fields['layout_design_note'] = $obj->el_heading( esc_html__( 'Layout', 'shopbuilder' ) ); |
| 91 |
|
| 92 |
$fields['grid_gap'] = [ |
| 93 |
'type' => 'slider', |
| 94 |
'mode' => 'responsive', |
| 95 |
'label' => esc_html__( 'Grid Gap / Spacing (px)', 'shopbuilder' ), |
| 96 |
'size_units' => [ 'px' ], |
| 97 |
'range' => [ |
| 98 |
'px' => [ |
| 99 |
'min' => 0, |
| 100 |
'max' => 100, |
| 101 |
'step' => 1, |
| 102 |
], |
| 103 |
], |
| 104 |
'default' => [ |
| 105 |
'unit' => 'px', |
| 106 |
'size' => 30, |
| 107 |
], |
| 108 |
'description' => esc_html__( 'Please select the grid gap in px.', 'shopbuilder' ), |
| 109 |
'selectors' => [ |
| 110 |
$obj->selectors['columns']['grid_gap']['padding'] => 'padding-left: calc({{SIZE}}{{UNIT}} / 2); padding-right: calc({{SIZE}}{{UNIT}} / 2);', |
| 111 |
$obj->selectors['columns']['grid_gap']['margin'] => 'margin-left: calc(-{{SIZE}}{{UNIT}} / 2); margin-right: calc(-{{SIZE}}{{UNIT}} / 2);', |
| 112 |
$obj->selectors['columns']['grid_gap']['slider_layout3'] => '--rtsb-slider-layout3-spacing: {{SIZE}}{{UNIT}};', |
| 113 |
$obj->selectors['columns']['grid_gap']['slider_layout9'] => '--rtsb-slider-layout9-spacing: {{SIZE}}{{UNIT}};', |
| 114 |
$css_selectors['element_margin'] => 'margin-bottom: {{SIZE}}{{UNIT}};', |
| 115 |
], |
| 116 |
]; |
| 117 |
|
| 118 |
$fields['grid_alignment'] = [ |
| 119 |
'mode' => 'responsive', |
| 120 |
'type' => 'choose', |
| 121 |
'label' => esc_html__( 'Alignment', 'shopbuilder' ), |
| 122 |
'options' => [ |
| 123 |
'left' => [ |
| 124 |
'title' => esc_html__( 'Left', 'shopbuilder' ), |
| 125 |
'icon' => 'eicon-text-align-left', |
| 126 |
], |
| 127 |
'center' => [ |
| 128 |
'title' => esc_html__( 'Center', 'shopbuilder' ), |
| 129 |
'icon' => 'eicon-text-align-center', |
| 130 |
], |
| 131 |
'right' => [ |
| 132 |
'title' => esc_html__( 'Right', 'shopbuilder' ), |
| 133 |
'icon' => 'eicon-text-align-right', |
| 134 |
], |
| 135 |
], |
| 136 |
'selectors' => [ |
| 137 |
$obj->selectors['columns']['grid_alignment']['text_align'] => 'text-align: {{VALUE}};', |
| 138 |
$obj->selectors['columns']['grid_alignment']['justify_content'] => 'justify-content: {{VALUE}};', |
| 139 |
], |
| 140 |
]; |
| 141 |
|
| 142 |
$fields['wrapper_color_note'] = $obj->el_heading( esc_html__( 'Colors & Shadow', 'shopbuilder' ), 'before' ); |
| 143 |
|
| 144 |
$fields['advanced_color_tabs'] = $obj->start_tab_group(); |
| 145 |
$fields['advanced_color_tab'] = $obj->start_tab( esc_html__( 'Normal', 'shopbuilder' ) ); |
| 146 |
|
| 147 |
$fields['content_bg_color'] = [ |
| 148 |
'type' => 'color', |
| 149 |
'label' => esc_html__( 'Content Background', 'shopbuilder' ), |
| 150 |
'selectors' => [ $css_selectors['content_bg_color'] => 'background-color: {{VALUE}};' ], |
| 151 |
]; |
| 152 |
|
| 153 |
$fields['element_bg_color'] = [ |
| 154 |
'type' => 'color', |
| 155 |
'label' => esc_html__( 'Element Background', 'shopbuilder' ), |
| 156 |
'selectors' => [ $css_selectors['element_bg_color'] => 'background-color: {{VALUE}};' ], |
| 157 |
]; |
| 158 |
|
| 159 |
$fields['rtsb_el_element_shadow'] = [ |
| 160 |
'type' => 'box-shadow', |
| 161 |
'mode' => 'group', |
| 162 |
'label' => esc_html__( 'Element Drop Shadow', 'shopbuilder' ), |
| 163 |
'selector' => $css_selectors['rtsb_el_element_shadow'], |
| 164 |
]; |
| 165 |
|
| 166 |
$fields['advanced_color_tab_end'] = $obj->end_tab(); |
| 167 |
$fields['advanced_hover_color_tab'] = $obj->start_tab( esc_html__( 'Hover', 'shopbuilder' ) ); |
| 168 |
|
| 169 |
$fields['content_hover_bg_color'] = [ |
| 170 |
'type' => 'color', |
| 171 |
'label' => esc_html__( 'Content Hover Background', 'shopbuilder' ), |
| 172 |
'selectors' => [ $css_selectors['content_hover_bg_color'] => 'background-color: {{VALUE}};' ], |
| 173 |
]; |
| 174 |
|
| 175 |
$fields['element_hover_bg_color'] = [ |
| 176 |
'type' => 'color', |
| 177 |
'label' => esc_html__( 'Element Hover Background', 'shopbuilder' ), |
| 178 |
'selectors' => [ $css_selectors['element_hover_bg_color'] => 'background-color: {{VALUE}};' ], |
| 179 |
]; |
| 180 |
|
| 181 |
$fields['rtsb_el_element_hover_shadow'] = [ |
| 182 |
'type' => 'box-shadow', |
| 183 |
'mode' => 'group', |
| 184 |
'label' => esc_html__( 'Element Hover Drop Shadow', 'shopbuilder' ), |
| 185 |
'selector' => $css_selectors['rtsb_el_element_hover_shadow'], |
| 186 |
]; |
| 187 |
|
| 188 |
$fields['advanced_hover_color_tab_end'] = $obj->end_tab(); |
| 189 |
$fields['advanced_color_tabs_end'] = $obj->end_tab_group(); |
| 190 |
|
| 191 |
$fields['wrapper_note'] = $obj->el_heading( esc_html__( 'Border', 'shopbuilder' ), 'before' ); |
| 192 |
|
| 193 |
$fields['rtsb_el_element_border'] = [ |
| 194 |
'mode' => 'group', |
| 195 |
'type' => 'border', |
| 196 |
'label' => esc_html__( 'Element Border', 'shopbuilder' ), |
| 197 |
'fields_options' => [ |
| 198 |
'border' => [ |
| 199 |
'label' => esc_html__( 'Element Border Type', 'shopbuilder' ), |
| 200 |
'label_block' => true, |
| 201 |
], |
| 202 |
'color' => [ |
| 203 |
'label' => esc_html__( 'Border Color', 'shopbuilder' ), |
| 204 |
], |
| 205 |
], |
| 206 |
'selector' => $css_selectors['rtsb_el_element_border'], |
| 207 |
]; |
| 208 |
|
| 209 |
$fields['element_border_hover_color'] = [ |
| 210 |
'type' => 'color', |
| 211 |
'label' => esc_html__( 'Hover Border Color', 'shopbuilder' ), |
| 212 |
'condition' => [ 'rtsb_el_element_border_border!' => [ '' ] ], |
| 213 |
'selectors' => [ $css_selectors['element_border_hover_color'] => 'border-color: {{VALUE}};' ], |
| 214 |
]; |
| 215 |
|
| 216 |
$fields['element_border_radius'] = [ |
| 217 |
'mode' => 'responsive', |
| 218 |
'type' => 'dimensions', |
| 219 |
'label' => esc_html__( 'Element Border Radius', 'shopbuilder' ), |
| 220 |
'size_units' => [ 'px', '%', 'em' ], |
| 221 |
'selectors' => [ $css_selectors['element_border_radius'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; overflow: hidden;' ], |
| 222 |
]; |
| 223 |
|
| 224 |
$fields['rtsb_el_content_border'] = [ |
| 225 |
'mode' => 'group', |
| 226 |
'type' => 'border', |
| 227 |
'label' => esc_html__( 'Content Border', 'shopbuilder' ), |
| 228 |
'fields_options' => [ |
| 229 |
'border' => [ |
| 230 |
'label' => esc_html__( 'Content Border Type', 'shopbuilder' ), |
| 231 |
'label_block' => true, |
| 232 |
], |
| 233 |
'color' => [ |
| 234 |
'label' => esc_html__( 'Border Color', 'shopbuilder' ), |
| 235 |
], |
| 236 |
], |
| 237 |
'selector' => $css_selectors['rtsb_el_content_border'], |
| 238 |
]; |
| 239 |
|
| 240 |
$fields['content_border_hover_color'] = [ |
| 241 |
'type' => 'color', |
| 242 |
'label' => esc_html__( 'Hover Border Color', 'shopbuilder' ), |
| 243 |
'condition' => [ 'rtsb_el_content_border_border!' => [ '' ] ], |
| 244 |
'selectors' => [ $css_selectors['content_border_hover_color'] => 'border-color: {{VALUE}};' ], |
| 245 |
]; |
| 246 |
|
| 247 |
$fields['content_border_radius'] = [ |
| 248 |
'mode' => 'responsive', |
| 249 |
'type' => 'dimensions', |
| 250 |
'label' => esc_html__( 'Content Border Radius', 'shopbuilder' ), |
| 251 |
'size_units' => [ 'px', '%', 'em' ], |
| 252 |
'selectors' => [ $css_selectors['content_border_radius'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ], |
| 253 |
]; |
| 254 |
|
| 255 |
$fields['advanced_spacing_note'] = $obj->el_heading( esc_html__( 'Spacing', 'shopbuilder' ), 'before' ); |
| 256 |
|
| 257 |
$fields['element_padding'] = [ |
| 258 |
'mode' => 'responsive', |
| 259 |
'type' => 'dimensions', |
| 260 |
'label' => esc_html__( 'Element Padding', 'shopbuilder' ), |
| 261 |
'size_units' => [ 'px', '%', 'em' ], |
| 262 |
'selectors' => [ $css_selectors['element_padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ], |
| 263 |
]; |
| 264 |
|
| 265 |
$fields['content_padding'] = [ |
| 266 |
'mode' => 'responsive', |
| 267 |
'type' => 'dimensions', |
| 268 |
'label' => esc_html__( 'Content Padding', 'shopbuilder' ), |
| 269 |
'size_units' => [ 'px', '%', 'em' ], |
| 270 |
'selectors' => [ $css_selectors['content_padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ], |
| 271 |
]; |
| 272 |
|
| 273 |
$fields['layout_design_section_end'] = $obj->end_section(); |
| 274 |
|
| 275 |
return apply_filters( 'rtsb/elements/elementor/color_style_control', $fields, $obj ); |
| 276 |
} |
| 277 |
|
| 278 |
/** |
| 279 |
* Product Title Section |
| 280 |
* |
| 281 |
* @param object $obj Reference object. |
| 282 |
* |
| 283 |
* @return array |
| 284 |
*/ |
| 285 |
public static function product_title( $obj ): array { |
| 286 |
$css_selectors = $obj->selectors['product_title']; |
| 287 |
$title = esc_html__( 'Product Title', 'shopbuilder' ); |
| 288 |
$condition = [ |
| 289 |
'show_title' => [ 'yes' ], |
| 290 |
]; |
| 291 |
$selectors = self::title_selectors( $css_selectors ); |
| 292 |
|
| 293 |
$fields = ControlHelper::general_elementor_style( 'product_title', $title, $obj, $condition, $selectors ); |
| 294 |
|
| 295 |
return apply_filters( 'rtsb/elements/elementor/title_style_control', $fields, $obj ); |
| 296 |
} |
| 297 |
|
| 298 |
/** |
| 299 |
* Section Title Section |
| 300 |
* |
| 301 |
* @param object $obj Reference object. |
| 302 |
* |
| 303 |
* @return array |
| 304 |
*/ |
| 305 |
public static function section_title( $obj ): array { |
| 306 |
$css_selectors = $obj->selectors['section_title']; |
| 307 |
$title = esc_html__( 'Section Title', 'shopbuilder' ); |
| 308 |
$condition = [ |
| 309 |
'show_section_title' => [ 'yes' ], |
| 310 |
]; |
| 311 |
$selectors = self::title_selectors( $css_selectors ); |
| 312 |
|
| 313 |
$fields = ControlHelper::general_elementor_style( 'section_title', $title, $obj, $condition, $selectors ); |
| 314 |
|
| 315 |
return apply_filters( 'rtsb/elements/elementor/section_title_style_control', $fields, $obj ); |
| 316 |
} |
| 317 |
|
| 318 |
/** |
| 319 |
* Category Title Section |
| 320 |
* |
| 321 |
* @param object $obj Reference object. |
| 322 |
* |
| 323 |
* @return array |
| 324 |
*/ |
| 325 |
public static function cat_title( $obj ): array { |
| 326 |
$css_selectors = $obj->selectors['cat_title']; |
| 327 |
$title = esc_html__( 'Category Title', 'shopbuilder' ); |
| 328 |
$condition = [ |
| 329 |
'show_title' => [ 'yes' ], |
| 330 |
]; |
| 331 |
$selectors = self::title_selectors( $css_selectors ); |
| 332 |
|
| 333 |
$fields = ControlHelper::general_elementor_style( 'category_title', $title, $obj, $condition, $selectors ); |
| 334 |
|
| 335 |
return apply_filters( 'rtsb/elements/elementor/cat_title_style_control', $fields, $obj ); |
| 336 |
} |
| 337 |
|
| 338 |
/** |
| 339 |
* Short Description Section |
| 340 |
* |
| 341 |
* @param object $obj Reference object. |
| 342 |
* |
| 343 |
* @return array |
| 344 |
*/ |
| 345 |
public static function short_description( $obj ): array { |
| 346 |
$css_selectors = $obj->selectors['short_description']; |
| 347 |
$title = esc_html__( 'Short Description', 'shopbuilder' ); |
| 348 |
$condition = [ |
| 349 |
'show_short_desc' => [ 'yes' ], |
| 350 |
]; |
| 351 |
$selectors = self::excerpt_selectors( $css_selectors ); |
| 352 |
|
| 353 |
$fields = ControlHelper::general_elementor_style( 'short_description', $title, $obj, $condition, $selectors ); |
| 354 |
|
| 355 |
unset( |
| 356 |
$fields['short_description_color_tabs'], |
| 357 |
$fields['short_description_color_tab'], |
| 358 |
$fields['short_description_color_tab_end'], |
| 359 |
$fields['short_description_hover_color_tab'], |
| 360 |
$fields['short_description_hover_color'], |
| 361 |
$fields['short_description_hover_bg_color'], |
| 362 |
$fields['short_description_hover_color_tab_end'], |
| 363 |
$fields['short_description_color_tabs_end'], |
| 364 |
$fields['short_description_border_hover_color'] |
| 365 |
); |
| 366 |
|
| 367 |
return apply_filters( 'rtsb/elements/elementor/excerpt_style_control', $fields, $obj ); |
| 368 |
} |
| 369 |
|
| 370 |
/** |
| 371 |
* Category Description Section |
| 372 |
* |
| 373 |
* @param object $obj Reference object. |
| 374 |
* |
| 375 |
* @return array |
| 376 |
*/ |
| 377 |
public static function cat_description( $obj ): array { |
| 378 |
$css_selectors = $obj->selectors['cat_description']; |
| 379 |
$title = esc_html__( 'Category Description', 'shopbuilder' ); |
| 380 |
$condition = [ |
| 381 |
'show_short_desc' => [ 'yes' ], |
| 382 |
]; |
| 383 |
$selectors = self::excerpt_selectors( $css_selectors ); |
| 384 |
|
| 385 |
$fields = ControlHelper::general_elementor_style( 'category_description', $title, $obj, $condition, $selectors ); |
| 386 |
|
| 387 |
unset( |
| 388 |
$fields['category_description_color_tabs'], |
| 389 |
$fields['category_description_color_tab'], |
| 390 |
$fields['category_description_color_tab_end'], |
| 391 |
$fields['category_description_hover_color_tab'], |
| 392 |
$fields['category_description_hover_color'], |
| 393 |
$fields['category_description_hover_bg_color'], |
| 394 |
$fields['category_description_hover_color_tab_end'], |
| 395 |
$fields['category_description_color_tabs_end'], |
| 396 |
$fields['category_description_border_hover_color'] |
| 397 |
); |
| 398 |
|
| 399 |
return apply_filters( 'rtsb/elements/elementor/cat_excerpt_style_control', $fields, $obj ); |
| 400 |
} |
| 401 |
|
| 402 |
/** |
| 403 |
* Count Section |
| 404 |
* |
| 405 |
* @param object $obj Reference object. |
| 406 |
* |
| 407 |
* @return array |
| 408 |
*/ |
| 409 |
public static function count( $obj ): array { |
| 410 |
$css_selectors = $obj->selectors['count']; |
| 411 |
$title = esc_html__( 'Product Count', 'shopbuilder' ); |
| 412 |
$condition = [ |
| 413 |
'show_count' => [ 'yes' ], |
| 414 |
]; |
| 415 |
$selectors = [ |
| 416 |
'typography' => $css_selectors['typography'], |
| 417 |
'alignment' => [ $css_selectors['alignment'] => 'text-align: {{VALUE}};' ], |
| 418 |
'color' => [ $css_selectors['color'] => 'color: {{VALUE}};' ], |
| 419 |
'bg_color' => [ $css_selectors['bg_color'] => 'background-color: {{VALUE}};' ], |
| 420 |
'hover_color' => [ $css_selectors['hover_color'] => 'color: {{VALUE}};' ], |
| 421 |
'hover_bg_color' => [ $css_selectors['hover_bg_color'] => 'background-color: {{VALUE}};' ], |
| 422 |
'border' => $css_selectors['border'], |
| 423 |
'border_hover_color' => [ $css_selectors['border_hover_color'] => 'border-color: {{VALUE}};' ], |
| 424 |
'border_radius' => [ $css_selectors['border_radius'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ], |
| 425 |
'padding' => [ $css_selectors['padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ], |
| 426 |
'margin' => [ $css_selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ], |
| 427 |
]; |
| 428 |
|
| 429 |
$fields = ControlHelper::general_elementor_style( 'product_count', $title, $obj, $condition, $selectors ); |
| 430 |
|
| 431 |
$extra_controls = []; |
| 432 |
|
| 433 |
$extra_controls['product_count_radius'] = [ |
| 434 |
'mode' => 'responsive', |
| 435 |
'type' => 'dimensions', |
| 436 |
'label' => esc_html__( 'Border Radius', 'shopbuilder' ), |
| 437 |
'size_units' => [ 'px', '%', 'em' ], |
| 438 |
'selectors' => $selectors['border_radius'], |
| 439 |
]; |
| 440 |
|
| 441 |
$fields = Fns::insert_controls( 'product_count_border_hover_color', $fields, $extra_controls, true ); |
| 442 |
|
| 443 |
return apply_filters( 'rtsb/elements/elementor/cat_count_style_control', $fields, $obj ); |
| 444 |
} |
| 445 |
|
| 446 |
/** |
| 447 |
* Product Price Section |
| 448 |
* |
| 449 |
* @param object $obj Reference object. |
| 450 |
* |
| 451 |
* @return array |
| 452 |
*/ |
| 453 |
public static function product_price( $obj ): array { |
| 454 |
$css_selectors = $obj->selectors['product_price']; |
| 455 |
$title = esc_html__( 'Product Price', 'shopbuilder' ); |
| 456 |
$condition = [ |
| 457 |
'show_price' => [ 'yes' ], |
| 458 |
]; |
| 459 |
$selectors = [ |
| 460 |
'typography' => $css_selectors['typography'], |
| 461 |
'alignment' => [ $css_selectors['alignment'] => 'text-align: {{VALUE}};' ], |
| 462 |
'color' => [ $css_selectors['color'] => 'color: {{VALUE}};' ], |
| 463 |
'regular_color' => [ $css_selectors['regular_color'] => 'color: {{VALUE}};' ], |
| 464 |
'border' => $css_selectors['border'], |
| 465 |
'border_hover_color' => [ $css_selectors['border_hover_color'] => 'border-color: {{VALUE}};' ], |
| 466 |
'padding' => [ $css_selectors['padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ], |
| 467 |
'margin' => [ $css_selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ], |
| 468 |
]; |
| 469 |
|
| 470 |
$fields = ControlHelper::general_elementor_style( 'product_price', $title, $obj, $condition, $selectors ); |
| 471 |
|
| 472 |
unset( |
| 473 |
$fields['product_price_color_tabs'], |
| 474 |
$fields['product_price_color_tab'], |
| 475 |
$fields['product_price_color_tab_end'], |
| 476 |
$fields['product_price_hover_color_tab'], |
| 477 |
$fields['product_price_hover_color'], |
| 478 |
$fields['product_price_hover_bg_color'], |
| 479 |
$fields['product_price_hover_color_tab_end'], |
| 480 |
$fields['product_price_color_tabs_end'], |
| 481 |
$fields['product_price_border_hover_color'] |
| 482 |
); |
| 483 |
|
| 484 |
$fields['product_price_color']['label'] = esc_html__( 'Sale Price Color', 'shopbuilder' ); |
| 485 |
$fields['product_price_bg_color']['label'] = esc_html__( 'Regular Price Color', 'shopbuilder' ); |
| 486 |
$fields['product_price_bg_color']['selectors'] = $selectors['regular_color']; |
| 487 |
|
| 488 |
return apply_filters( 'rtsb/elements/elementor/price_style_control', $fields, $obj ); |
| 489 |
} |
| 490 |
|
| 491 |
/** |
| 492 |
* Product Rating Section |
| 493 |
* |
| 494 |
* @param object $obj Reference object. |
| 495 |
* |
| 496 |
* @return array |
| 497 |
*/ |
| 498 |
public static function product_rating( $obj ): array { |
| 499 |
$css_selectors = $obj->selectors['product_rating']; |
| 500 |
$title = esc_html__( 'Product Rating', 'shopbuilder' ); |
| 501 |
$condition = [ |
| 502 |
'show_rating' => [ 'yes' ], |
| 503 |
]; |
| 504 |
$selectors = [ |
| 505 |
'typography' => [ $css_selectors['typography'] => 'font-size: {{SIZE}}{{UNIT}};' ], |
| 506 |
'alignment' => [ $css_selectors['alignment'] => 'justify-content: {{VALUE}};' ], |
| 507 |
'color' => [ $css_selectors['color'] => 'color: {{VALUE}} !important;' ], |
| 508 |
'bg_color' => [ $css_selectors['bg_color'] => 'color: {{VALUE}} !important;' ], |
| 509 |
'padding' => [ $css_selectors['padding'] => 'letter-spacing: {{SIZE}}{{UNIT}};' ], |
| 510 |
'margin' => [ $css_selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ], |
| 511 |
]; |
| 512 |
|
| 513 |
$fields = ControlHelper::general_elementor_style( 'product_rating', $title, $obj, $condition, $selectors ); |
| 514 |
|
| 515 |
unset( |
| 516 |
$fields['product_rating_color_tabs'], |
| 517 |
$fields['product_rating_color_tab'], |
| 518 |
$fields['product_rating_color_tab_end'], |
| 519 |
$fields['product_rating_hover_color_tab'], |
| 520 |
$fields['product_rating_hover_color'], |
| 521 |
$fields['product_rating_hover_bg_color'], |
| 522 |
$fields['product_rating_hover_color_tab_end'], |
| 523 |
$fields['product_rating_color_tabs_end'], |
| 524 |
$fields['product_rating_border_note'], |
| 525 |
$fields['rtsb_el_product_rating_border'], |
| 526 |
$fields['product_rating_border_hover_color'] |
| 527 |
); |
| 528 |
|
| 529 |
$fields['rtsb_el_product_rating_typography'] = [ |
| 530 |
'type' => 'slider', |
| 531 |
'mode' => 'responsive', |
| 532 |
'label' => esc_html__( 'Star Size', 'shopbuilder' ), |
| 533 |
'size_units' => [ 'px' ], |
| 534 |
'range' => [ |
| 535 |
'px' => [ |
| 536 |
'min' => 0, |
| 537 |
'max' => 100, |
| 538 |
], |
| 539 |
], |
| 540 |
// 'default' => [ |
| 541 |
// 'unit' => 'px', |
| 542 |
// 'size' => 14, |
| 543 |
// ], |
| 544 |
'selectors' => $selectors['typography'], |
| 545 |
]; |
| 546 |
|
| 547 |
$fields['product_rating_bg_color']['label'] = esc_html__( 'Star Border Color', 'shopbuilder' ); |
| 548 |
|
| 549 |
$fields['product_rating_padding'] = [ |
| 550 |
'type' => 'slider', |
| 551 |
'mode' => 'responsive', |
| 552 |
'label' => esc_html__( 'Spacing', 'shopbuilder' ), |
| 553 |
'size_units' => [ 'px' ], |
| 554 |
'range' => [ |
| 555 |
'px' => [ |
| 556 |
'min' => -10, |
| 557 |
'max' => 50, |
| 558 |
], |
| 559 |
], |
| 560 |
'default' => [ |
| 561 |
'unit' => 'px', |
| 562 |
'size' => 3, |
| 563 |
], |
| 564 |
'selectors' => $selectors['padding'], |
| 565 |
]; |
| 566 |
|
| 567 |
return apply_filters( 'rtsb/elements/elementor/rating_style_control', $fields, $obj ); |
| 568 |
} |
| 569 |
|
| 570 |
/** |
| 571 |
* Product Badges Section |
| 572 |
* |
| 573 |
* @param object $obj Reference object. |
| 574 |
* |
| 575 |
* @return array |
| 576 |
*/ |
| 577 |
public static function product_badges( $obj ): array { |
| 578 |
$css_selectors = $obj->selectors['product_badges']; |
| 579 |
$title = esc_html__( 'Badges', 'shopbuilder' ); |
| 580 |
$condition = [ |
| 581 |
'show_badges' => [ 'yes' ], |
| 582 |
'layout!' => [ 'category-layout1', 'category-layout2' ], |
| 583 |
]; |
| 584 |
$selectors = [ |
| 585 |
'typography' => $css_selectors['typography'], |
| 586 |
'color' => [ $css_selectors['color'] => 'color: {{VALUE}};' ], |
| 587 |
'bg_color' => [ $css_selectors['bg_color'] => 'background-color: {{VALUE}};' ], |
| 588 |
'border_color' => [ $css_selectors['border_color'] => 'border-color: {{VALUE}};' ], |
| 589 |
'border_radius' => [ $css_selectors['border_radius'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ], |
| 590 |
'padding' => [ $css_selectors['padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ], |
| 591 |
'margin' => [ $css_selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ], |
| 592 |
'position_x' => [ $css_selectors['position_x'] => 'left: {{SIZE}}{{UNIT}};' ], |
| 593 |
'position_x_right' => [ $css_selectors['position_x'] => 'right: {{SIZE}}{{UNIT}}; left: auto;' ], |
| 594 |
'position_y' => [ $css_selectors['position_y'] => 'top: {{SIZE}}{{UNIT}};' ], |
| 595 |
'position_y_bottom' => [ $css_selectors['position_y'] => 'bottom: {{SIZE}}{{UNIT}}; top:auto;' ], |
| 596 |
]; |
| 597 |
|
| 598 |
$fields = ControlHelper::general_elementor_style( 'badges', $title, $obj, $condition, $selectors ); |
| 599 |
|
| 600 |
unset( |
| 601 |
$fields['badges_alignment'], |
| 602 |
$fields['badges_color_tabs'], |
| 603 |
$fields['badges_color_tab'], |
| 604 |
$fields['badges_color_tab_end'], |
| 605 |
$fields['badges_hover_color_tab'], |
| 606 |
$fields['badges_hover_color'], |
| 607 |
$fields['badges_hover_bg_color'], |
| 608 |
$fields['badges_hover_color_tab_end'], |
| 609 |
$fields['badges_color_tabs_end'], |
| 610 |
$fields['badges_border_note'], |
| 611 |
$fields['rtsb_el_badges_border'], |
| 612 |
$fields['badges_border_hover_color'] |
| 613 |
); |
| 614 |
|
| 615 |
$fields['badges_alignment']['label'] = esc_html__( 'Horizontal Alignment', 'shopbuilder' ); |
| 616 |
|
| 617 |
$extra_controls = []; |
| 618 |
|
| 619 |
$extra_controls['badges_alignment'] = [ |
| 620 |
'type' => 'select2', |
| 621 |
'label' => esc_html__( 'Horizontal Alignment', 'shopbuilder' ), |
| 622 |
'options' => [ |
| 623 |
'left' => esc_html__( 'Left', 'shopbuilder' ), |
| 624 |
'center' => esc_html__( 'Center', 'shopbuilder' ), |
| 625 |
'right' => esc_html__( 'Right', 'shopbuilder' ), |
| 626 |
], |
| 627 |
'label_block' => true, |
| 628 |
'default' => 'left', |
| 629 |
]; |
| 630 |
|
| 631 |
$extra_controls['badges_position'] = [ |
| 632 |
'type' => 'select2', |
| 633 |
'label' => esc_html__( 'Vertical Alignment', 'shopbuilder' ), |
| 634 |
'options' => [ |
| 635 |
'top' => esc_html__( 'Top', 'shopbuilder' ), |
| 636 |
'middle' => esc_html__( 'Middle', 'shopbuilder' ), |
| 637 |
'bottom' => esc_html__( 'Bottom', 'shopbuilder' ), |
| 638 |
], |
| 639 |
'label_block' => true, |
| 640 |
'default' => 'top', |
| 641 |
]; |
| 642 |
|
| 643 |
$extra_controls['badge_x_position'] = [ |
| 644 |
'type' => 'slider', |
| 645 |
'mode' => 'responsive', |
| 646 |
'label' => esc_html__( 'Position Offset (Horizontal)', 'shopbuilder' ), |
| 647 |
'size_units' => [ 'px', '%' ], |
| 648 |
'range' => [ |
| 649 |
'px' => [ |
| 650 |
'min' => 0, |
| 651 |
'max' => 300, |
| 652 |
'step' => 1, |
| 653 |
], |
| 654 |
'%' => [ |
| 655 |
'min' => 0, |
| 656 |
'max' => 100, |
| 657 |
'step' => 1, |
| 658 |
], |
| 659 |
], |
| 660 |
'condition' => [ |
| 661 |
'badges_alignment' => 'left', |
| 662 |
'badges_alignment!' => 'center', |
| 663 |
], |
| 664 |
'selectors' => $selectors['position_x'], |
| 665 |
]; |
| 666 |
|
| 667 |
$extra_controls['badge_x_position_right'] = [ |
| 668 |
'type' => 'slider', |
| 669 |
'mode' => 'responsive', |
| 670 |
'label' => esc_html__( 'Position Offset (Horizontal)', 'shopbuilder' ), |
| 671 |
'size_units' => [ 'px', '%' ], |
| 672 |
'range' => [ |
| 673 |
'px' => [ |
| 674 |
'min' => 0, |
| 675 |
'max' => 300, |
| 676 |
'step' => 1, |
| 677 |
], |
| 678 |
'%' => [ |
| 679 |
'min' => 0, |
| 680 |
'max' => 100, |
| 681 |
'step' => 1, |
| 682 |
], |
| 683 |
], |
| 684 |
'condition' => [ 'badges_alignment' => 'right' ], |
| 685 |
'selectors' => $selectors['position_x_right'], |
| 686 |
]; |
| 687 |
|
| 688 |
$extra_controls['badge_y_position'] = [ |
| 689 |
'type' => 'slider', |
| 690 |
'mode' => 'responsive', |
| 691 |
'label' => esc_html__( 'Position Offset (Vertical)', 'shopbuilder' ), |
| 692 |
'size_units' => [ 'px', '%' ], |
| 693 |
'range' => [ |
| 694 |
'px' => [ |
| 695 |
'min' => 0, |
| 696 |
'max' => 300, |
| 697 |
'step' => 1, |
| 698 |
], |
| 699 |
'%' => [ |
| 700 |
'min' => 0, |
| 701 |
'max' => 100, |
| 702 |
'step' => 1, |
| 703 |
], |
| 704 |
], |
| 705 |
'condition' => [ |
| 706 |
'badges_position' => 'top', |
| 707 |
'badges_position!' => 'center', |
| 708 |
], |
| 709 |
'selectors' => $selectors['position_y'], |
| 710 |
]; |
| 711 |
|
| 712 |
$extra_controls['badge_y_position_bottom'] = [ |
| 713 |
'type' => 'slider', |
| 714 |
'mode' => 'responsive', |
| 715 |
'label' => esc_html__( 'Position Offset (Vertical)', 'shopbuilder' ), |
| 716 |
'size_units' => [ 'px', '%' ], |
| 717 |
'range' => [ |
| 718 |
'px' => [ |
| 719 |
'min' => 0, |
| 720 |
'max' => 300, |
| 721 |
'step' => 1, |
| 722 |
], |
| 723 |
'%' => [ |
| 724 |
'min' => 0, |
| 725 |
'max' => 100, |
| 726 |
'step' => 1, |
| 727 |
], |
| 728 |
], |
| 729 |
'condition' => [ |
| 730 |
'badges_position' => 'bottom', |
| 731 |
'badges_position!' => 'center', |
| 732 |
], |
| 733 |
'selectors' => $selectors['position_y_bottom'], |
| 734 |
]; |
| 735 |
|
| 736 |
$fields = Fns::insert_controls( 'badges_color_note', $fields, $extra_controls ); |
| 737 |
|
| 738 |
$extra_controls['badges_border_color'] = [ |
| 739 |
'type' => 'color', |
| 740 |
'label' => esc_html__( 'border Color', 'shopbuilder' ), |
| 741 |
'selectors' => ! empty( $selectors['border_color'] ) ? $selectors['border_color'] : [], |
| 742 |
]; |
| 743 |
|
| 744 |
$extra_controls['badges_border_radius'] = [ |
| 745 |
'mode' => 'responsive', |
| 746 |
'type' => 'dimensions', |
| 747 |
'label' => esc_html__( 'Border Radius', 'shopbuilder' ), |
| 748 |
'size_units' => [ 'px', '%', 'em' ], |
| 749 |
'selectors' => $selectors['border_radius'], |
| 750 |
]; |
| 751 |
|
| 752 |
$fields = Fns::insert_controls( 'badges_bg_color', $fields, $extra_controls, true ); |
| 753 |
|
| 754 |
return apply_filters( 'rtsb/elements/elementor/badges_style_control', $fields, $obj ); |
| 755 |
} |
| 756 |
|
| 757 |
/** |
| 758 |
* Product Categories Section |
| 759 |
* |
| 760 |
* @param object $obj Reference object. |
| 761 |
* |
| 762 |
* @return array |
| 763 |
*/ |
| 764 |
public static function product_categories( $obj ): array { |
| 765 |
$css_selectors = $obj->selectors['product_categories']; |
| 766 |
$title = esc_html__( 'Product Categories', 'shopbuilder' ); |
| 767 |
$condition = [ |
| 768 |
'show_categories' => [ 'yes' ], |
| 769 |
]; |
| 770 |
$selectors = [ |
| 771 |
'typography' => $css_selectors['typography'], |
| 772 |
'alignment' => [ $css_selectors['alignment'] => 'justify-content: {{VALUE}};' ], |
| 773 |
'color' => [ $css_selectors['color'] => 'color: {{VALUE}};' ], |
| 774 |
'bg_color' => [ $css_selectors['bg_color'] => 'background-color: {{VALUE}};' ], |
| 775 |
'hover_color' => [ $css_selectors['hover_color'] => 'color: {{VALUE}};' ], |
| 776 |
'hover_bg_color' => [ $css_selectors['hover_bg_color'] => 'background-color: {{VALUE}};' ], |
| 777 |
'border' => $css_selectors['typography'], |
| 778 |
'border_hover_color' => [ $css_selectors['border_hover_color'] => 'border-color: {{VALUE}};' ], |
| 779 |
'border_radius' => [ $css_selectors['border_radius'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ], |
| 780 |
'padding' => [ $css_selectors['padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ], |
| 781 |
'margin' => [ $css_selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ], |
| 782 |
'wrapper_margin' => [ $css_selectors['wrapper_margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ], |
| 783 |
]; |
| 784 |
|
| 785 |
$fields = ControlHelper::general_elementor_style( 'product_categories', $title, $obj, $condition, $selectors ); |
| 786 |
|
| 787 |
$fields['product_categories_alignment']['options'] = [ |
| 788 |
'flex-start' => [ |
| 789 |
'title' => esc_html__( 'Left', 'shopbuilder' ), |
| 790 |
'icon' => 'eicon-text-align-left', |
| 791 |
], |
| 792 |
'center' => [ |
| 793 |
'title' => esc_html__( 'Center', 'shopbuilder' ), |
| 794 |
'icon' => 'eicon-text-align-center', |
| 795 |
], |
| 796 |
'flex-end' => [ |
| 797 |
'title' => esc_html__( 'Right', 'shopbuilder' ), |
| 798 |
'icon' => 'eicon-text-align-right', |
| 799 |
], |
| 800 |
]; |
| 801 |
|
| 802 |
$extra_controls = []; |
| 803 |
|
| 804 |
$extra_controls['product_categories_radius'] = [ |
| 805 |
'mode' => 'responsive', |
| 806 |
'type' => 'dimensions', |
| 807 |
'label' => esc_html__( 'Border Radius', 'shopbuilder' ), |
| 808 |
'size_units' => [ 'px', '%', 'em' ], |
| 809 |
'selectors' => $selectors['border_radius'], |
| 810 |
]; |
| 811 |
|
| 812 |
$fields = Fns::insert_controls( 'product_categories_border_hover_color', $fields, $extra_controls, true ); |
| 813 |
|
| 814 |
$extra_controls['product_categories_wrapper_margin'] = [ |
| 815 |
'mode' => 'responsive', |
| 816 |
'type' => 'dimensions', |
| 817 |
'label' => esc_html__( 'Wrapper Margin', 'shopbuilder' ), |
| 818 |
'size_units' => [ 'px', '%', 'em' ], |
| 819 |
'selectors' => $selectors['wrapper_margin'], |
| 820 |
]; |
| 821 |
|
| 822 |
$fields = Fns::insert_controls( 'product_categories_margin', $fields, $extra_controls, true ); |
| 823 |
|
| 824 |
return apply_filters( 'rtsb/elements/elementor/categories_style_control', $fields, $obj ); |
| 825 |
} |
| 826 |
|
| 827 |
/** |
| 828 |
* Image Section |
| 829 |
* |
| 830 |
* @param object $obj Reference object. |
| 831 |
* @param array $conditions Conditions. |
| 832 |
* |
| 833 |
* @return array |
| 834 |
*/ |
| 835 |
public static function image( $obj, $conditions ): array { |
| 836 |
$css_selectors = $obj->selectors['image']; |
| 837 |
$title = esc_html__( 'Image Styles', 'shopbuilder' ); |
| 838 |
$selectors = [ |
| 839 |
'overlay' => $css_selectors['overlay'], |
| 840 |
'hover_overlay' => $css_selectors['hover_overlay'], |
| 841 |
'border' => $css_selectors['border'], |
| 842 |
'width' => [ $css_selectors['width'] => 'width: {{SIZE}}{{UNIT}};' ], |
| 843 |
'img_bg_color' => [ $css_selectors['img_bg_color'] => 'background-color: {{VALUE}};' ], |
| 844 |
'img_wrapper_bg_color' => [ $css_selectors['img_wrapper_bg_color'] => 'background-color: {{VALUE}};' ], |
| 845 |
'max_width' => [ $css_selectors['max_width'] => 'max-width: {{SIZE}}{{UNIT}};' ], |
| 846 |
'border_radius' => [ $css_selectors['border_radius'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ], |
| 847 |
'margin' => [ $css_selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ], |
| 848 |
]; |
| 849 |
|
| 850 |
$fields = ControlHelper::general_elementor_style( 'image_styles', $title, $obj, [], $selectors, $conditions ); |
| 851 |
|
| 852 |
unset( |
| 853 |
$fields['rtsb_el_image_styles_typography'], |
| 854 |
$fields['image_styles_alignment'], |
| 855 |
$fields['image_styles_color_tabs'], |
| 856 |
$fields['image_styles_color_tab'], |
| 857 |
$fields['image_styles_color_note'], |
| 858 |
$fields['image_styles_color'], |
| 859 |
$fields['image_styles_bg_color'], |
| 860 |
$fields['image_styles_color_tab_end'], |
| 861 |
$fields['image_styles_hover_color_tab'], |
| 862 |
$fields['image_styles_hover_color'], |
| 863 |
$fields['image_styles_hover_bg_color'], |
| 864 |
$fields['image_styles_hover_color_tab_end'], |
| 865 |
$fields['image_styles_color_tabs_end'], |
| 866 |
$fields['image_styles_border_hover_color'], |
| 867 |
$fields['image_styles_padding'] |
| 868 |
); |
| 869 |
|
| 870 |
$fields['image_styles_typo_note']['raw'] = sprintf( |
| 871 |
'<h3 class="rtsb-elementor-group-heading">%s</h3>', |
| 872 |
esc_html__( 'Overlay', 'shopbuilder' ) |
| 873 |
); |
| 874 |
$fields['image_styles_border_note']['separator'] = 'before-short'; |
| 875 |
$fields['image_styles_typo_note']['separator'] = 'before'; |
| 876 |
$fields['image_styles_typo_note']['condition'] = [ 'show_overlay' => [ 'yes' ] ]; |
| 877 |
|
| 878 |
$extra_controls = []; |
| 879 |
|
| 880 |
$extra_controls['image_styles_dimension_note'] = $obj->el_heading( esc_html__( 'Dimension', 'shopbuilder' ) ); |
| 881 |
|
| 882 |
$extra_controls['image_styles_width'] = [ |
| 883 |
'type' => 'slider', |
| 884 |
'label' => esc_html__( 'Image Width', 'shopbuilder' ), |
| 885 |
'size_units' => [ '%', 'px' ], |
| 886 |
'range' => [ |
| 887 |
'%' => [ |
| 888 |
'min' => 0, |
| 889 |
'max' => 100, |
| 890 |
'step' => 1, |
| 891 |
], |
| 892 |
'px' => [ |
| 893 |
'min' => 0, |
| 894 |
'max' => 500, |
| 895 |
'step' => 1, |
| 896 |
], |
| 897 |
], |
| 898 |
'selectors' => $selectors['width'], |
| 899 |
]; |
| 900 |
|
| 901 |
$extra_controls['image_styles_max_width'] = [ |
| 902 |
'type' => 'slider', |
| 903 |
'label' => esc_html__( 'Image Max-Width', 'shopbuilder' ), |
| 904 |
'size_units' => [ '%', 'px' ], |
| 905 |
'range' => [ |
| 906 |
'%' => [ |
| 907 |
'min' => 0, |
| 908 |
'max' => 100, |
| 909 |
'step' => 1, |
| 910 |
], |
| 911 |
'px' => [ |
| 912 |
'min' => 0, |
| 913 |
'max' => 500, |
| 914 |
'step' => 1, |
| 915 |
], |
| 916 |
|
| 917 |
], |
| 918 |
'selectors' => $selectors['max_width'], |
| 919 |
]; |
| 920 |
|
| 921 |
$extra_controls['image_styles_color_note'] = $obj->el_heading( esc_html__( 'Colors', 'shopbuilder' ), 'before' ); |
| 922 |
|
| 923 |
$extra_controls['image_styles_color'] = [ |
| 924 |
'type' => 'color', |
| 925 |
'label' => esc_html__( 'Image Background Color', 'shopbuilder' ), |
| 926 |
'selectors' => $selectors['img_bg_color'], |
| 927 |
]; |
| 928 |
|
| 929 |
$extra_controls['image_wrapper_styles_color'] = [ |
| 930 |
'type' => 'color', |
| 931 |
'label' => esc_html__( 'Wrapper Background Color', 'shopbuilder' ), |
| 932 |
'selectors' => $selectors['img_wrapper_bg_color'], |
| 933 |
]; |
| 934 |
|
| 935 |
$fields = Fns::insert_controls( 'image_styles_typo_note', $fields, $extra_controls ); |
| 936 |
|
| 937 |
$extra_controls['rtsb_el_image_styles_overlay'] = [ |
| 938 |
'mode' => 'group', |
| 939 |
'type' => 'background', |
| 940 |
'label' => esc_html__( 'Image Overlay', 'shopbuilder' ), |
| 941 |
'types' => [ 'classic', 'gradient' ], |
| 942 |
'exclude' => [ 'image' ], |
| 943 |
'fields_options' => [ |
| 944 |
'background' => [ |
| 945 |
'label' => esc_html__( 'Overlay Background Type', 'shopbuilder' ), |
| 946 |
], |
| 947 |
'color' => [ |
| 948 |
'label' => 'Background', |
| 949 |
], |
| 950 |
'color_b' => [ |
| 951 |
'label' => 'Background 2', |
| 952 |
], |
| 953 |
], |
| 954 |
'selector' => $selectors['overlay'], |
| 955 |
'condition' => [ |
| 956 |
'show_overlay' => [ 'yes' ] |
| 957 |
], |
| 958 |
]; |
| 959 |
|
| 960 |
$extra_controls['rtsb_el_image_styles_hover_overlay'] = [ |
| 961 |
'mode' => 'group', |
| 962 |
'type' => 'background', |
| 963 |
'label' => esc_html__( 'Hover Image Overlay', 'shopbuilder' ), |
| 964 |
'types' => [ 'classic', 'gradient' ], |
| 965 |
'exclude' => [ 'image' ], |
| 966 |
'fields_options' => [ |
| 967 |
'background' => [ |
| 968 |
'label' => esc_html__( 'Hover Overlay Background Type', 'shopbuilder' ), |
| 969 |
], |
| 970 |
'color' => [ |
| 971 |
'label' => 'Hover Background', |
| 972 |
], |
| 973 |
'color_b' => [ |
| 974 |
'label' => 'Hover Background 2', |
| 975 |
], |
| 976 |
], |
| 977 |
'selector' => $selectors['hover_overlay'], |
| 978 |
'condition' => [ |
| 979 |
'show_overlay' => [ 'yes' ] |
| 980 |
], |
| 981 |
]; |
| 982 |
|
| 983 |
$fields = Fns::insert_controls( 'image_styles_typo_note', $fields, $extra_controls, true ); |
| 984 |
|
| 985 |
$extra_controls['image_styles_radius'] = [ |
| 986 |
'mode' => 'responsive', |
| 987 |
'type' => 'dimensions', |
| 988 |
'label' => esc_html__( 'Border Radius', 'shopbuilder' ), |
| 989 |
'size_units' => [ 'px', '%', 'em' ], |
| 990 |
'selectors' => $selectors['border_radius'], |
| 991 |
]; |
| 992 |
|
| 993 |
$fields = Fns::insert_controls( 'rtsb_el_image_styles_border', $fields, $extra_controls, true ); |
| 994 |
|
| 995 |
return apply_filters( 'rtsb/elements/elementor/image_style_control', $fields, $obj ); |
| 996 |
} |
| 997 |
|
| 998 |
/** |
| 999 |
* Product Image Section |
| 1000 |
* |
| 1001 |
* @param object $obj Reference object. |
| 1002 |
* |
| 1003 |
* @return array |
| 1004 |
*/ |
| 1005 |
public static function product_image( $obj ): array { |
| 1006 |
$conditions = [ |
| 1007 |
'relation' => 'and', |
| 1008 |
'terms' => [ |
| 1009 |
[ |
| 1010 |
'relation' => 'or', |
| 1011 |
'terms' => [ |
| 1012 |
[ |
| 1013 |
'name' => 'show_featured_image', |
| 1014 |
'operator' => '==', |
| 1015 |
'value' => 'yes', |
| 1016 |
], |
| 1017 |
], |
| 1018 |
], |
| 1019 |
], |
| 1020 |
]; |
| 1021 |
|
| 1022 |
return self::image( $obj, $conditions ); |
| 1023 |
} |
| 1024 |
|
| 1025 |
/** |
| 1026 |
* Category Image Section |
| 1027 |
* |
| 1028 |
* @param object $obj Reference object. |
| 1029 |
* |
| 1030 |
* @return array |
| 1031 |
*/ |
| 1032 |
public static function category_image( $obj ): array { |
| 1033 |
$conditions = [ |
| 1034 |
'relation' => 'and', |
| 1035 |
'terms' => [ |
| 1036 |
[ |
| 1037 |
'relation' => 'or', |
| 1038 |
'terms' => [ |
| 1039 |
[ |
| 1040 |
'name' => 'show_cat_image', |
| 1041 |
'operator' => '==', |
| 1042 |
'value' => 'yes', |
| 1043 |
], |
| 1044 |
[ |
| 1045 |
'name' => 'show_custom_image', |
| 1046 |
'operator' => '==', |
| 1047 |
'value' => 'yes', |
| 1048 |
], |
| 1049 |
], |
| 1050 |
], |
| 1051 |
], |
| 1052 |
]; |
| 1053 |
|
| 1054 |
return self::image( $obj, $conditions ); |
| 1055 |
} |
| 1056 |
|
| 1057 |
/** |
| 1058 |
* Pagination Section |
| 1059 |
* |
| 1060 |
* @param object $obj Reference object. |
| 1061 |
* |
| 1062 |
* @return array |
| 1063 |
*/ |
| 1064 |
public static function pagination( $obj ): array { |
| 1065 |
$css_selectors = $obj->selectors['pagination']; |
| 1066 |
$title = esc_html__( 'Pagination Buttons', 'shopbuilder' ); |
| 1067 |
$condition = [ 'show_pagination' => [ 'yes' ] ]; |
| 1068 |
$selectors = [ |
| 1069 |
'typography' => $css_selectors['typography'], |
| 1070 |
'alignment' => [ $css_selectors['alignment'] => 'justify-content: {{VALUE}};' ], |
| 1071 |
'width' => [ $css_selectors['width'] => 'width: {{SIZE}}{{UNIT}};' ], |
| 1072 |
'height' => [ $css_selectors['height'] => 'height: {{SIZE}}{{UNIT}};' ], |
| 1073 |
'color' => [ $css_selectors['color'] => 'color: {{VALUE}};' ], |
| 1074 |
'bg_color' => [ $css_selectors['bg_color'] => 'background-color: {{VALUE}};' ], |
| 1075 |
'active_color' => [ $css_selectors['active_color'] => 'color: {{VALUE}};' ], |
| 1076 |
'active_bg_color' => [ $css_selectors['active_bg_color'] => 'background-color: {{VALUE}};' ], |
| 1077 |
'hover_color' => [ $css_selectors['hover_color'] => 'color: {{VALUE}};' ], |
| 1078 |
'hover_bg_color' => [ $css_selectors['hover_bg_color'] => 'background-color: {{VALUE}};' ], |
| 1079 |
'border' => $css_selectors['border'], |
| 1080 |
'border_hover_color' => [ $css_selectors['border_hover_color'] => 'border-color: {{VALUE}};' ], |
| 1081 |
'border_active_color' => [ $css_selectors['border_active_color'] => 'border-color: {{VALUE}};' ], |
| 1082 |
'border_radius' => [ $css_selectors['border_radius'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ], |
| 1083 |
'spacing' => [ $css_selectors['spacing'] => 'gap: {{SIZE}}{{UNIT}};' ], |
| 1084 |
'padding' => [ $css_selectors['padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ], |
| 1085 |
'margin' => [ $css_selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ], |
| 1086 |
]; |
| 1087 |
|
| 1088 |
$fields = ControlHelper::general_elementor_style( 'pagination_buttons', $title, $obj, $condition, $selectors ); |
| 1089 |
|
| 1090 |
unset( $fields['pagination_buttons_padding'] ); |
| 1091 |
|
| 1092 |
$fields['pagination_buttons_alignment']['options'] = [ |
| 1093 |
'flex-start' => [ |
| 1094 |
'title' => esc_html__( 'Left', 'shopbuilder' ), |
| 1095 |
'icon' => 'eicon-text-align-left', |
| 1096 |
], |
| 1097 |
'center' => [ |
| 1098 |
'title' => esc_html__( 'Center', 'shopbuilder' ), |
| 1099 |
'icon' => 'eicon-text-align-center', |
| 1100 |
], |
| 1101 |
'flex-end' => [ |
| 1102 |
'title' => esc_html__( 'Right', 'shopbuilder' ), |
| 1103 |
'icon' => 'eicon-text-align-right', |
| 1104 |
], |
| 1105 |
]; |
| 1106 |
|
| 1107 |
$extra_controls = []; |
| 1108 |
|
| 1109 |
$extra_controls['pagination_buttons_width'] = [ |
| 1110 |
'type' => 'slider', |
| 1111 |
'mode' => 'responsive', |
| 1112 |
'label' => esc_html__( 'Width', 'shopbuilder' ), |
| 1113 |
'size_units' => [ 'px' ], |
| 1114 |
'range' => [ |
| 1115 |
'px' => [ |
| 1116 |
'min' => 0, |
| 1117 |
'max' => 100, |
| 1118 |
], |
| 1119 |
], |
| 1120 |
'selectors' => $selectors['width'], |
| 1121 |
]; |
| 1122 |
|
| 1123 |
$extra_controls['pagination_buttons_height'] = [ |
| 1124 |
'type' => 'slider', |
| 1125 |
'mode' => 'responsive', |
| 1126 |
'label' => esc_html__( 'Height', 'shopbuilder' ), |
| 1127 |
'size_units' => [ 'px' ], |
| 1128 |
'range' => [ |
| 1129 |
'px' => [ |
| 1130 |
'min' => 0, |
| 1131 |
'max' => 100, |
| 1132 |
], |
| 1133 |
], |
| 1134 |
'selectors' => $selectors['height'], |
| 1135 |
]; |
| 1136 |
|
| 1137 |
$fields = Fns::insert_controls( 'pagination_buttons_color_note', $fields, $extra_controls ); |
| 1138 |
|
| 1139 |
$extra_controls['pagination_buttons_active_color'] = [ |
| 1140 |
'type' => 'color', |
| 1141 |
'label' => esc_html__( 'Active Color', 'shopbuilder' ), |
| 1142 |
'selectors' => $selectors['active_color'], |
| 1143 |
'condition' => [ |
| 1144 |
'pagination_type!' => 'load_more', |
| 1145 |
], |
| 1146 |
]; |
| 1147 |
|
| 1148 |
$extra_controls['pagination_buttons_active_bg_color'] = [ |
| 1149 |
'type' => 'color', |
| 1150 |
'label' => esc_html__( 'Active Background Color', 'shopbuilder' ), |
| 1151 |
'selectors' => $selectors['active_bg_color'], |
| 1152 |
'condition' => [ |
| 1153 |
'pagination_type!' => 'load_more', |
| 1154 |
], |
| 1155 |
]; |
| 1156 |
|
| 1157 |
$fields = Fns::insert_controls( 'pagination_buttons_bg_color', $fields, $extra_controls, true ); |
| 1158 |
|
| 1159 |
$extra_controls['pagination_buttons_active_border_color'] = [ |
| 1160 |
'type' => 'color', |
| 1161 |
'label' => esc_html__( 'Active Border Color', 'shopbuilder' ), |
| 1162 |
'condition' => [ 'rtsb_el_pagination_buttons_border_border!' => [ '' ] ], |
| 1163 |
'selectors' => $selectors['border_active_color'], |
| 1164 |
]; |
| 1165 |
|
| 1166 |
$extra_controls['pagination_buttons_radius'] = [ |
| 1167 |
'mode' => 'responsive', |
| 1168 |
'type' => 'dimensions', |
| 1169 |
'label' => esc_html__( 'Border Radius', 'shopbuilder' ), |
| 1170 |
'size_units' => [ 'px', '%', 'em' ], |
| 1171 |
'selectors' => $selectors['border_radius'], |
| 1172 |
]; |
| 1173 |
|
| 1174 |
$fields = Fns::insert_controls( 'pagination_buttons_border_hover_color', $fields, $extra_controls, true ); |
| 1175 |
|
| 1176 |
$extra_controls['pagination_buttons_spacing'] = [ |
| 1177 |
'type' => 'slider', |
| 1178 |
'mode' => 'responsive', |
| 1179 |
'label' => esc_html__( 'Spacing', 'shopbuilder' ), |
| 1180 |
'size_units' => [ 'px' ], |
| 1181 |
'range' => [ |
| 1182 |
'px' => [ |
| 1183 |
'min' => 0, |
| 1184 |
'max' => 100, |
| 1185 |
], |
| 1186 |
], |
| 1187 |
'selectors' => $selectors['spacing'], |
| 1188 |
'condition' => [ |
| 1189 |
'pagination_type!' => 'load_more', |
| 1190 |
], |
| 1191 |
]; |
| 1192 |
|
| 1193 |
$extra_controls['pagination_buttons_padding'] = [ |
| 1194 |
'mode' => 'responsive', |
| 1195 |
'type' => 'dimensions', |
| 1196 |
'label' => esc_html__( 'Padding', 'shopbuilder' ), |
| 1197 |
'size_units' => [ 'px', '%', 'em' ], |
| 1198 |
'selectors' => ! empty( $selectors['padding'] ) ? $selectors['padding'] : [], |
| 1199 |
'condition' => [ |
| 1200 |
'pagination_type' => 'load_more', |
| 1201 |
], |
| 1202 |
]; |
| 1203 |
|
| 1204 |
$fields = Fns::insert_controls( 'pagination_buttons_spacing_note', $fields, $extra_controls, true ); |
| 1205 |
|
| 1206 |
return apply_filters( 'rtsb/elements/elementor/pagination_style_control', $fields, $obj ); |
| 1207 |
} |
| 1208 |
|
| 1209 |
/** |
| 1210 |
* Product Add to Cart Section |
| 1211 |
* |
| 1212 |
* @param object $obj Reference object. |
| 1213 |
* |
| 1214 |
* @return array |
| 1215 |
*/ |
| 1216 |
public static function product_add_to_cart( $obj ): array { |
| 1217 |
$css_selectors = $obj->selectors['product_add_to_cart']; |
| 1218 |
$title = esc_html__( 'Add to Cart Button', 'shopbuilder' ); |
| 1219 |
$condition = [ |
| 1220 |
'show_add_to_cart' => [ 'yes' ], |
| 1221 |
]; |
| 1222 |
$selectors = [ |
| 1223 |
'typography' => $css_selectors['typography'], |
| 1224 |
'icon_size' => [ |
| 1225 |
$css_selectors['icon_size']['font_size'] => 'font-size: {{SIZE}}{{UNIT}};', |
| 1226 |
$css_selectors['icon_size']['width'] => 'height: {{SIZE}}{{UNIT}};', |
| 1227 |
], |
| 1228 |
'cart_icon_spacing' => [ |
| 1229 |
$css_selectors['cart_icon_spacing']['margin_left'] => 'margin-left: {{SIZE}}{{UNIT}};', |
| 1230 |
$css_selectors['cart_icon_spacing']['margin_right'] => 'margin-right: {{SIZE}}{{UNIT}};', |
| 1231 |
], |
| 1232 |
'cart_width' => [ $css_selectors['cart_width'] => 'width: {{SIZE}}{{UNIT}} !important;' ], |
| 1233 |
'cart_height' => [ $css_selectors['cart_height'] => 'height: {{SIZE}}{{UNIT}} !important;' ], |
| 1234 |
'color' => [ $css_selectors['color'] => 'color: {{VALUE}};' ], |
| 1235 |
'bg_color' => [ $css_selectors['bg_color'] => 'background-color: {{VALUE}};' ], |
| 1236 |
'icon_color' => [ $css_selectors['icon_color'] => 'color: {{VALUE}};' ], |
| 1237 |
'hover_color' => [ $css_selectors['hover_color'] => 'color: {{VALUE}};' ], |
| 1238 |
'hover_bg_color' => [ $css_selectors['hover_bg_color'] => 'background-color: {{VALUE}};' ], |
| 1239 |
'hover_icon_color' => [ $css_selectors['hover_icon_color'] => 'color: {{VALUE}};' ], |
| 1240 |
'border' => $css_selectors['border'], |
| 1241 |
'border_hover_color' => [ $css_selectors['border_hover_color'] => 'border-color: {{VALUE}};' ], |
| 1242 |
'border_radius' => [ $css_selectors['border_radius'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ], |
| 1243 |
'padding' => [ $css_selectors['padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ], |
| 1244 |
'margin' => [ $css_selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ], |
| 1245 |
]; |
| 1246 |
|
| 1247 |
$fields = ControlHelper::general_elementor_style( 'add_to_cart_button', $title, $obj, $condition, $selectors ); |
| 1248 |
|
| 1249 |
$fields['add_to_cart_button_alignment'] = [ |
| 1250 |
'type' => 'slider', |
| 1251 |
'mode' => 'responsive', |
| 1252 |
'label' => esc_html__( 'Icon Size', 'shopbuilder' ), |
| 1253 |
'size_units' => [ 'px' ], |
| 1254 |
'range' => [ |
| 1255 |
'px' => [ |
| 1256 |
'min' => 0, |
| 1257 |
'max' => 100, |
| 1258 |
], |
| 1259 |
], |
| 1260 |
'condition' => [ |
| 1261 |
'show_cart_icon' => [ 'yes' ], |
| 1262 |
], |
| 1263 |
'selectors' => $selectors['icon_size'], |
| 1264 |
]; |
| 1265 |
|
| 1266 |
$extra_controls = []; |
| 1267 |
|
| 1268 |
$extra_controls['cart_icon_alignment'] = [ |
| 1269 |
'type' => 'choose', |
| 1270 |
'label' => esc_html__( 'Icon Alignment', 'shopbuilder' ), |
| 1271 |
'options' => [ |
| 1272 |
'left' => [ |
| 1273 |
'title' => esc_html__( 'Left', 'shopbuilder' ), |
| 1274 |
'icon' => 'eicon-arrow-left', |
| 1275 |
], |
| 1276 |
'right' => [ |
| 1277 |
'title' => esc_html__( 'Right', 'shopbuilder' ), |
| 1278 |
'icon' => 'eicon-arrow-right', |
| 1279 |
], |
| 1280 |
], |
| 1281 |
'default' => 'left', |
| 1282 |
'toggle' => true, |
| 1283 |
'condition' => [ |
| 1284 |
'show_cart_text' => [ 'yes' ], |
| 1285 |
'show_cart_icon' => [ 'yes' ], |
| 1286 |
], |
| 1287 |
]; |
| 1288 |
|
| 1289 |
$extra_controls['cart_icon_spacing'] = [ |
| 1290 |
'type' => 'slider', |
| 1291 |
'mode' => 'responsive', |
| 1292 |
'label' => esc_html__( 'Icon Spacing', 'shopbuilder' ), |
| 1293 |
'size_units' => [ 'px' ], |
| 1294 |
'range' => [ |
| 1295 |
'px' => [ |
| 1296 |
'min' => 0, |
| 1297 |
'max' => 100, |
| 1298 |
], |
| 1299 |
], |
| 1300 |
'default' => [ |
| 1301 |
'unit' => 'px', |
| 1302 |
'size' => 8, |
| 1303 |
], |
| 1304 |
'condition' => [ |
| 1305 |
'show_cart_text' => [ 'yes' ], |
| 1306 |
'show_cart_icon' => [ 'yes' ], |
| 1307 |
], |
| 1308 |
'selectors' => $selectors['cart_icon_spacing'], |
| 1309 |
]; |
| 1310 |
|
| 1311 |
$extra_controls['cart_width'] = [ |
| 1312 |
'type' => 'slider', |
| 1313 |
'mode' => 'responsive', |
| 1314 |
'label' => esc_html__( 'Width', 'shopbuilder' ), |
| 1315 |
'size_units' => [ 'px', '%' ], |
| 1316 |
'range' => [ |
| 1317 |
'px' => [ |
| 1318 |
'min' => 0, |
| 1319 |
'max' => 1000, |
| 1320 |
], |
| 1321 |
], |
| 1322 |
'selectors' => $selectors['cart_width'], |
| 1323 |
]; |
| 1324 |
|
| 1325 |
$extra_controls['cart_height'] = [ |
| 1326 |
'type' => 'slider', |
| 1327 |
'mode' => 'responsive', |
| 1328 |
'label' => esc_html__( 'height', 'shopbuilder' ), |
| 1329 |
'size_units' => [ 'px', '%' ], |
| 1330 |
'range' => [ |
| 1331 |
'px' => [ |
| 1332 |
'min' => 0, |
| 1333 |
'max' => 1000, |
| 1334 |
], |
| 1335 |
], |
| 1336 |
'selectors' => $selectors['cart_height'], |
| 1337 |
]; |
| 1338 |
|
| 1339 |
$fields = Fns::insert_controls( 'add_to_cart_button_alignment', $fields, $extra_controls, true ); |
| 1340 |
|
| 1341 |
$extra_controls['add_to_cart_button_icon_color'] = [ |
| 1342 |
'type' => 'color', |
| 1343 |
'label' => esc_html__( 'Icon Color', 'shopbuilder' ), |
| 1344 |
'selectors' => $selectors['icon_color'], |
| 1345 |
]; |
| 1346 |
|
| 1347 |
$fields = Fns::insert_controls( 'add_to_cart_button_bg_color', $fields, $extra_controls, true ); |
| 1348 |
|
| 1349 |
$extra_controls['add_to_cart_button_hover_icon_color'] = [ |
| 1350 |
'type' => 'color', |
| 1351 |
'label' => esc_html__( 'Hover Icon Color', 'shopbuilder' ), |
| 1352 |
'selectors' => $selectors['hover_icon_color'], |
| 1353 |
]; |
| 1354 |
|
| 1355 |
$fields = Fns::insert_controls( 'add_to_cart_button_hover_bg_color', $fields, $extra_controls, true ); |
| 1356 |
|
| 1357 |
$extra_controls['add_to_cart_button_radius'] = [ |
| 1358 |
'mode' => 'responsive', |
| 1359 |
'type' => 'dimensions', |
| 1360 |
'label' => esc_html__( 'Border Radius', 'shopbuilder' ), |
| 1361 |
'size_units' => [ 'px', '%', 'em' ], |
| 1362 |
'selectors' => $selectors['border_radius'], |
| 1363 |
]; |
| 1364 |
|
| 1365 |
$fields = Fns::insert_controls( 'add_to_cart_button_border_hover_color', $fields, $extra_controls, true ); |
| 1366 |
|
| 1367 |
return apply_filters( 'rtsb/elements/elementor/add_to_cart_style_control', $fields, $obj ); |
| 1368 |
} |
| 1369 |
|
| 1370 |
/** |
| 1371 |
* Product Compare Section |
| 1372 |
* |
| 1373 |
* @param object $obj Reference object. |
| 1374 |
* |
| 1375 |
* @return array |
| 1376 |
*/ |
| 1377 |
public static function product_compare( $obj ): array { |
| 1378 |
$css_selectors = $obj->selectors['product_compare']; |
| 1379 |
$title = esc_html__( 'Compare Button', 'shopbuilder' ); |
| 1380 |
$condition = [ |
| 1381 |
'show_compare' => [ 'yes' ], |
| 1382 |
]; |
| 1383 |
$selectors = self::action_btn_selectors( $css_selectors ); |
| 1384 |
|
| 1385 |
$fields = ControlHelper::general_elementor_style( 'compare_button', $title, $obj, $condition, $selectors ); |
| 1386 |
|
| 1387 |
unset( $fields['compare_button_alignment'] ); |
| 1388 |
|
| 1389 |
$fields['rtsb_el_compare_button_typography'] = [ |
| 1390 |
'type' => 'slider', |
| 1391 |
'mode' => 'responsive', |
| 1392 |
'label' => esc_html__( 'Icon Size', 'shopbuilder' ), |
| 1393 |
'size_units' => [ 'px' ], |
| 1394 |
'range' => [ |
| 1395 |
'px' => [ |
| 1396 |
'min' => 0, |
| 1397 |
'max' => 100, |
| 1398 |
], |
| 1399 |
], |
| 1400 |
'condition' => [ |
| 1401 |
'show_cart_icon' => [ 'yes' ], |
| 1402 |
], |
| 1403 |
'selectors' => $selectors['icon_size'], |
| 1404 |
]; |
| 1405 |
|
| 1406 |
$extra_controls = []; |
| 1407 |
|
| 1408 |
$extra_controls['compare_width'] = [ |
| 1409 |
'type' => 'slider', |
| 1410 |
'mode' => 'responsive', |
| 1411 |
'label' => esc_html__( 'Width', 'shopbuilder' ), |
| 1412 |
'size_units' => [ 'px' ], |
| 1413 |
'range' => [ |
| 1414 |
'px' => [ |
| 1415 |
'min' => 0, |
| 1416 |
'max' => 1000, |
| 1417 |
], |
| 1418 |
], |
| 1419 |
'selectors' => $selectors['width'], |
| 1420 |
]; |
| 1421 |
|
| 1422 |
$extra_controls['compare_height'] = [ |
| 1423 |
'type' => 'slider', |
| 1424 |
'mode' => 'responsive', |
| 1425 |
'label' => esc_html__( 'height', 'shopbuilder' ), |
| 1426 |
'size_units' => [ 'px' ], |
| 1427 |
'range' => [ |
| 1428 |
'px' => [ |
| 1429 |
'min' => 0, |
| 1430 |
'max' => 100, |
| 1431 |
], |
| 1432 |
], |
| 1433 |
'selectors' => $selectors['height'], |
| 1434 |
]; |
| 1435 |
|
| 1436 |
$fields = Fns::insert_controls( 'compare_button_color_note', $fields, $extra_controls ); |
| 1437 |
|
| 1438 |
$extra_controls['compare_button_radius'] = [ |
| 1439 |
'mode' => 'responsive', |
| 1440 |
'type' => 'dimensions', |
| 1441 |
'label' => esc_html__( 'Border Radius', 'shopbuilder' ), |
| 1442 |
'size_units' => [ 'px', '%', 'em' ], |
| 1443 |
'selectors' => $selectors['border_radius'], |
| 1444 |
]; |
| 1445 |
|
| 1446 |
$fields = Fns::insert_controls( 'compare_button_border_hover_color', $fields, $extra_controls, true ); |
| 1447 |
|
| 1448 |
return apply_filters( 'rtsb/elements/elementor/compare_style_control', $fields, $obj ); |
| 1449 |
} |
| 1450 |
|
| 1451 |
/** |
| 1452 |
* Product Wishlist Section |
| 1453 |
* |
| 1454 |
* @param object $obj Reference object. |
| 1455 |
* |
| 1456 |
* @return array |
| 1457 |
*/ |
| 1458 |
public static function product_wishlist( $obj ): array { |
| 1459 |
$css_selectors = $obj->selectors['product_wishlist']; |
| 1460 |
$title = esc_html__( 'Wishlist Button', 'shopbuilder' ); |
| 1461 |
$condition = [ |
| 1462 |
'show_wishlist' => [ 'yes' ], |
| 1463 |
]; |
| 1464 |
$selectors = self::action_btn_selectors( $css_selectors ); |
| 1465 |
|
| 1466 |
$fields = ControlHelper::general_elementor_style( 'wishlist_button', $title, $obj, $condition, $selectors ); |
| 1467 |
|
| 1468 |
unset( $fields['wishlist_button_alignment'] ); |
| 1469 |
|
| 1470 |
$fields['rtsb_el_wishlist_button_typography'] = [ |
| 1471 |
'type' => 'slider', |
| 1472 |
'mode' => 'responsive', |
| 1473 |
'label' => esc_html__( 'Icon Size', 'shopbuilder' ), |
| 1474 |
'size_units' => [ 'px' ], |
| 1475 |
'range' => [ |
| 1476 |
'px' => [ |
| 1477 |
'min' => 0, |
| 1478 |
'max' => 100, |
| 1479 |
], |
| 1480 |
], |
| 1481 |
'condition' => [ |
| 1482 |
'show_cart_icon' => [ 'yes' ], |
| 1483 |
], |
| 1484 |
'selectors' => $selectors['icon_size'], |
| 1485 |
]; |
| 1486 |
|
| 1487 |
$extra_controls = []; |
| 1488 |
|
| 1489 |
$extra_controls['wishlist_width'] = [ |
| 1490 |
'type' => 'slider', |
| 1491 |
'mode' => 'responsive', |
| 1492 |
'label' => esc_html__( 'Width', 'shopbuilder' ), |
| 1493 |
'size_units' => [ 'px' ], |
| 1494 |
'range' => [ |
| 1495 |
'px' => [ |
| 1496 |
'min' => 0, |
| 1497 |
'max' => 1000, |
| 1498 |
], |
| 1499 |
], |
| 1500 |
'selectors' => $selectors['width'], |
| 1501 |
]; |
| 1502 |
|
| 1503 |
$extra_controls['wishlist_height'] = [ |
| 1504 |
'type' => 'slider', |
| 1505 |
'mode' => 'responsive', |
| 1506 |
'label' => esc_html__( 'height', 'shopbuilder' ), |
| 1507 |
'size_units' => [ 'px' ], |
| 1508 |
'range' => [ |
| 1509 |
'px' => [ |
| 1510 |
'min' => 0, |
| 1511 |
'max' => 100, |
| 1512 |
], |
| 1513 |
], |
| 1514 |
'selectors' => $selectors['height'], |
| 1515 |
]; |
| 1516 |
|
| 1517 |
$fields = Fns::insert_controls( 'wishlist_button_color_note', $fields, $extra_controls ); |
| 1518 |
|
| 1519 |
$extra_controls['wishlist_button_radius'] = [ |
| 1520 |
'mode' => 'responsive', |
| 1521 |
'type' => 'dimensions', |
| 1522 |
'label' => esc_html__( 'Border Radius', 'shopbuilder' ), |
| 1523 |
'size_units' => [ 'px', '%', 'em' ], |
| 1524 |
'selectors' => $selectors['border_radius'], |
| 1525 |
]; |
| 1526 |
|
| 1527 |
$fields = Fns::insert_controls( 'wishlist_button_border_hover_color', $fields, $extra_controls, true ); |
| 1528 |
|
| 1529 |
return apply_filters( 'rtsb/elements/elementor/wishlist_style_control', $fields, $obj ); |
| 1530 |
} |
| 1531 |
|
| 1532 |
/** |
| 1533 |
* Product Quick View Section |
| 1534 |
* |
| 1535 |
* @param object $obj Reference object. |
| 1536 |
* |
| 1537 |
* @return array |
| 1538 |
*/ |
| 1539 |
public static function product_quick_view( $obj ): array { |
| 1540 |
$css_selectors = $obj->selectors['product_quick_view']; |
| 1541 |
$title = esc_html__( 'Quick View Button', 'shopbuilder' ); |
| 1542 |
$condition = [ |
| 1543 |
'show_quick_view' => [ 'yes' ], |
| 1544 |
]; |
| 1545 |
$selectors = self::action_btn_selectors( $css_selectors ); |
| 1546 |
|
| 1547 |
$fields = ControlHelper::general_elementor_style( 'quick_view_button', $title, $obj, $condition, $selectors ); |
| 1548 |
|
| 1549 |
unset( $fields['quick_view_button_alignment'] ); |
| 1550 |
|
| 1551 |
$fields['rtsb_el_quick_view_button_typography'] = [ |
| 1552 |
'type' => 'slider', |
| 1553 |
'mode' => 'responsive', |
| 1554 |
'label' => esc_html__( 'Icon Size', 'shopbuilder' ), |
| 1555 |
'size_units' => [ 'px' ], |
| 1556 |
'range' => [ |
| 1557 |
'px' => [ |
| 1558 |
'min' => 0, |
| 1559 |
'max' => 100, |
| 1560 |
], |
| 1561 |
], |
| 1562 |
'condition' => [ |
| 1563 |
'show_cart_icon' => [ 'yes' ], |
| 1564 |
], |
| 1565 |
'selectors' => $selectors['icon_size'], |
| 1566 |
]; |
| 1567 |
|
| 1568 |
$extra_controls = []; |
| 1569 |
|
| 1570 |
$extra_controls['quick_view_width'] = [ |
| 1571 |
'type' => 'slider', |
| 1572 |
'mode' => 'responsive', |
| 1573 |
'label' => esc_html__( 'Width', 'shopbuilder' ), |
| 1574 |
'size_units' => [ 'px' ], |
| 1575 |
'range' => [ |
| 1576 |
'px' => [ |
| 1577 |
'min' => 0, |
| 1578 |
'max' => 1000, |
| 1579 |
], |
| 1580 |
], |
| 1581 |
'selectors' => $selectors['width'], |
| 1582 |
]; |
| 1583 |
|
| 1584 |
$extra_controls['quick_view_height'] = [ |
| 1585 |
'type' => 'slider', |
| 1586 |
'mode' => 'responsive', |
| 1587 |
'label' => esc_html__( 'height', 'shopbuilder' ), |
| 1588 |
'size_units' => [ 'px' ], |
| 1589 |
'range' => [ |
| 1590 |
'px' => [ |
| 1591 |
'min' => 0, |
| 1592 |
'max' => 100, |
| 1593 |
], |
| 1594 |
], |
| 1595 |
'selectors' => $selectors['height'], |
| 1596 |
]; |
| 1597 |
|
| 1598 |
$fields = Fns::insert_controls( 'quick_view_button_color_note', $fields, $extra_controls ); |
| 1599 |
|
| 1600 |
$extra_controls['quick_view_button_radius'] = [ |
| 1601 |
'mode' => 'responsive', |
| 1602 |
'type' => 'dimensions', |
| 1603 |
'label' => esc_html__( 'Border Radius', 'shopbuilder' ), |
| 1604 |
'size_units' => [ 'px', '%', 'em' ], |
| 1605 |
'selectors' => $selectors['border_radius'], |
| 1606 |
]; |
| 1607 |
|
| 1608 |
$fields = Fns::insert_controls( 'quick_view_button_border_hover_color', $fields, $extra_controls, true ); |
| 1609 |
|
| 1610 |
return apply_filters( 'rtsb/elements/elementor/quick_view_style_control', $fields, $obj ); |
| 1611 |
} |
| 1612 |
|
| 1613 |
/** |
| 1614 |
* Hover Icon Button Section |
| 1615 |
* |
| 1616 |
* @param object $obj Reference object. |
| 1617 |
* |
| 1618 |
* @return array |
| 1619 |
*/ |
| 1620 |
public static function hover_icon_button( $obj ): array { |
| 1621 |
$css_selectors = $obj->selectors['hover_icon_button']; |
| 1622 |
$title = esc_html__( 'Hover Icon Button', 'shopbuilder' ); |
| 1623 |
$condition = [ |
| 1624 |
'layout' => [ 'grid-layout2', 'slider-layout2' ], |
| 1625 |
]; |
| 1626 |
$selectors = [ |
| 1627 |
'typography' => $css_selectors['typography'], |
| 1628 |
'icon_size' => [ $css_selectors['icon_size'] => 'font-size: {{SIZE}}{{UNIT}}' ], |
| 1629 |
'hover_icon_spacing' => [ $css_selectors['hover_icon_spacing'] => 'margin-left: {{SIZE}}{{UNIT}}' ], |
| 1630 |
'color' => [ $css_selectors['color'] => 'color: {{VALUE}}' ], |
| 1631 |
'bg_color' => [ $css_selectors['bg_color'] => 'background-color: {{VALUE}}' ], |
| 1632 |
'icon_color' => [ $css_selectors['icon_color'] => 'color: {{VALUE}}' ], |
| 1633 |
'hover_color' => [ $css_selectors['hover_color'] => 'color: {{VALUE}}' ], |
| 1634 |
'hover_bg_color' => [ $css_selectors['hover_bg_color'] => 'background-color: {{VALUE}}' ], |
| 1635 |
'hover_icon_color' => [ $css_selectors['hover_icon_color'] => 'color: {{VALUE}}' ], |
| 1636 |
'border' => $css_selectors['border'], |
| 1637 |
'border_hover_color' => [ $css_selectors['border_hover_color'] => 'border-color: {{VALUE}}' ], |
| 1638 |
'border_radius' => [ $css_selectors['border_radius'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}' ], |
| 1639 |
'padding' => [ $css_selectors['padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ], |
| 1640 |
'margin' => [ $css_selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ], |
| 1641 |
]; |
| 1642 |
|
| 1643 |
$fields = ControlHelper::general_elementor_style( 'hover_icon_button', $title, $obj, $condition, $selectors ); |
| 1644 |
|
| 1645 |
$fields['hover_icon_button_alignment'] = [ |
| 1646 |
'type' => 'slider', |
| 1647 |
'mode' => 'responsive', |
| 1648 |
'label' => esc_html__( 'Icon Size', 'shopbuilder' ), |
| 1649 |
'size_units' => [ 'px' ], |
| 1650 |
'range' => [ |
| 1651 |
'px' => [ |
| 1652 |
'min' => 0, |
| 1653 |
'max' => 100, |
| 1654 |
], |
| 1655 |
], |
| 1656 |
'default' => [ |
| 1657 |
'unit' => 'px', |
| 1658 |
'size' => 14, |
| 1659 |
], |
| 1660 |
'condition' => [ |
| 1661 |
'show_hover_btn_icon' => [ 'yes' ], |
| 1662 |
], |
| 1663 |
'selectors' => $selectors['icon_size'], |
| 1664 |
]; |
| 1665 |
|
| 1666 |
$extra_controls = []; |
| 1667 |
|
| 1668 |
$extra_controls['hover_icon_button_spacing'] = [ |
| 1669 |
'type' => 'slider', |
| 1670 |
'mode' => 'responsive', |
| 1671 |
'label' => esc_html__( 'Icon Spacing', 'shopbuilder' ), |
| 1672 |
'size_units' => [ 'px' ], |
| 1673 |
'range' => [ |
| 1674 |
'px' => [ |
| 1675 |
'min' => 0, |
| 1676 |
'max' => 100, |
| 1677 |
], |
| 1678 |
], |
| 1679 |
'default' => [ |
| 1680 |
'unit' => 'px', |
| 1681 |
'size' => 3, |
| 1682 |
], |
| 1683 |
'condition' => [ |
| 1684 |
'show_hover_btn_icon' => [ 'yes' ], |
| 1685 |
], |
| 1686 |
'selectors' => $selectors['hover_icon_spacing'], |
| 1687 |
]; |
| 1688 |
|
| 1689 |
$fields = Fns::insert_controls( 'hover_icon_button_alignment', $fields, $extra_controls, true ); |
| 1690 |
|
| 1691 |
$extra_controls['hover_icon_button_icon_color'] = [ |
| 1692 |
'type' => 'color', |
| 1693 |
'label' => esc_html__( 'Icon Color', 'shopbuilder' ), |
| 1694 |
'condition' => [ |
| 1695 |
'show_hover_btn_icon' => [ 'yes' ], |
| 1696 |
], |
| 1697 |
'selectors' => $selectors['icon_color'], |
| 1698 |
]; |
| 1699 |
|
| 1700 |
$fields = Fns::insert_controls( 'hover_icon_button_bg_color', $fields, $extra_controls, true ); |
| 1701 |
|
| 1702 |
$extra_controls['hover_icon_button_hover_icon_color'] = [ |
| 1703 |
'type' => 'color', |
| 1704 |
'label' => esc_html__( 'Hover Icon Color', 'shopbuilder' ), |
| 1705 |
'condition' => [ |
| 1706 |
'show_hover_btn_icon' => [ 'yes' ], |
| 1707 |
], |
| 1708 |
'selectors' => $selectors['hover_icon_color'], |
| 1709 |
]; |
| 1710 |
|
| 1711 |
$fields = Fns::insert_controls( 'hover_icon_button_hover_bg_color', $fields, $extra_controls, true ); |
| 1712 |
|
| 1713 |
$extra_controls['hover_icon_button_radius'] = [ |
| 1714 |
'mode' => 'responsive', |
| 1715 |
'type' => 'dimensions', |
| 1716 |
'label' => esc_html__( 'Border Radius', 'shopbuilder' ), |
| 1717 |
'size_units' => [ 'px', '%', 'em' ], |
| 1718 |
'selectors' => $selectors['border_radius'], |
| 1719 |
]; |
| 1720 |
|
| 1721 |
$fields = Fns::insert_controls( 'hover_icon_button_border_hover_color', $fields, $extra_controls, true ); |
| 1722 |
|
| 1723 |
return apply_filters( 'rtsb/elements/elementor/hover_icon_btn_style_control', $fields, $obj ); |
| 1724 |
} |
| 1725 |
|
| 1726 |
/** |
| 1727 |
* Share Items Section |
| 1728 |
* |
| 1729 |
* @param object $obj Reference object. |
| 1730 |
* |
| 1731 |
* @return array |
| 1732 |
*/ |
| 1733 |
public static function share_items( $obj ): array { |
| 1734 |
$css_selectors = $obj->selectors['share_items']; |
| 1735 |
$title = esc_html__( 'Share Items', 'shopbuilder' ); |
| 1736 |
$condition = [ |
| 1737 |
'layout!' => [ 'default' ], |
| 1738 |
]; |
| 1739 |
$selectors = [ |
| 1740 |
'share_icons_spacing' => [ $css_selectors['share_icons_spacing'] => 'gap: {{SIZE}}{{UNIT}}' ], |
| 1741 |
'share_items_min_width' => [ $css_selectors['share_items_min_width'] => 'min-width: {{SIZE}}{{UNIT}}' ], |
| 1742 |
'social_items_color' => [ $css_selectors['social_items_color'] => 'fill: {{VALUE}}; color: {{VALUE}}' ], |
| 1743 |
'social_items_bg_color' => [ $css_selectors['social_items_bg_color'] => 'background-color: {{VALUE}}' ], |
| 1744 |
'facebook_color' => [ $css_selectors['facebook_color'] => 'fill: {{VALUE}}; color: {{VALUE}}' ], |
| 1745 |
'twitter_color' => [ $css_selectors['twitter_color'] => 'fill: {{VALUE}}; color: {{VALUE}}' ], |
| 1746 |
'linkedin_color' => [ $css_selectors['linkedin_color'] => 'fill: {{VALUE}}; color: {{VALUE}}' ], |
| 1747 |
'pinterest_color' => [ $css_selectors['pinterest_color'] => 'fill: {{VALUE}}; color: {{VALUE}}' ], |
| 1748 |
'skype_color' => [ $css_selectors['skype_color'] => 'fill: {{VALUE}}; color: {{VALUE}}' ], |
| 1749 |
'whatsapp_color' => [ $css_selectors['whatsapp_color'] => 'fill: {{VALUE}}; color: {{VALUE}}' ], |
| 1750 |
'reddit_color' => [ $css_selectors['reddit_color'] => 'fill: {{VALUE}}; color: {{VALUE}}' ], |
| 1751 |
'telegram_color' => [ $css_selectors['telegram_color'] => 'fill: {{VALUE}}; color: {{VALUE}}' ], |
| 1752 |
'facebook_bg_color' => [ $css_selectors['facebook_bg_color'] => 'background-color: {{VALUE}}' ], |
| 1753 |
'twitter_bg_color' => [ $css_selectors['twitter_bg_color'] => 'background-color: {{VALUE}}' ], |
| 1754 |
'linkedin_bg_color' => [ $css_selectors['linkedin_bg_color'] => 'background-color: {{VALUE}}' ], |
| 1755 |
'pinterest_bg_color' => [ $css_selectors['pinterest_bg_color'] => 'background-color: {{VALUE}}' ], |
| 1756 |
'skype_bg_color' => [ $css_selectors['skype_bg_color'] => 'background-color: {{VALUE}}' ], |
| 1757 |
'whatsapp_bg_color' => [ $css_selectors['whatsapp_bg_color'] => 'background-color: {{VALUE}}' ], |
| 1758 |
'reddit_bg_color' => [ $css_selectors['reddit_bg_color'] => 'background-color: {{VALUE}}' ], |
| 1759 |
'telegram_bg_color' => [ $css_selectors['telegram_bg_color'] => 'background-color: {{VALUE}}' ], |
| 1760 |
'social_items_hover_color' => [ $css_selectors['social_items_hover_color'] => 'fill: {{VALUE}}; color: {{VALUE}}' ], |
| 1761 |
'social_items_hover_bg_color' => [ $css_selectors['social_items_hover_bg_color'] => 'background-color: {{VALUE}}' ], |
| 1762 |
'facebook_hover_color' => [ $css_selectors['facebook_hover_color'] => 'fill: {{VALUE}}; color: {{VALUE}}' ], |
| 1763 |
'twitter_hover_color' => [ $css_selectors['twitter_hover_color'] => 'fill: {{VALUE}}; color: {{VALUE}}' ], |
| 1764 |
'linkedin_hover_color' => [ $css_selectors['linkedin_hover_color'] => 'fill: {{VALUE}}; color: {{VALUE}}' ], |
| 1765 |
'pinterest_hover_color' => [ $css_selectors['pinterest_hover_color'] => 'fill: {{VALUE}}; color: {{VALUE}}' ], |
| 1766 |
'skype_hover_color' => [ $css_selectors['skype_hover_color'] => 'fill: {{VALUE}}; color: {{VALUE}}' ], |
| 1767 |
'whatsapp_hover_color' => [ $css_selectors['whatsapp_hover_color'] => 'fill: {{VALUE}}; color: {{VALUE}}' ], |
| 1768 |
'reddit_hover_color' => [ $css_selectors['reddit_hover_color'] => 'fill: {{VALUE}}; color: {{VALUE}}' ], |
| 1769 |
'telegram_hover_color' => [ $css_selectors['telegram_hover_color'] => 'fill: {{VALUE}}; color: {{VALUE}}' ], |
| 1770 |
'facebook_hover_bg_color' => [ $css_selectors['facebook_hover_bg_color'] => 'background-color: {{VALUE}}' ], |
| 1771 |
'twitter_hover_bg_color' => [ $css_selectors['twitter_hover_bg_color'] => 'background-color: {{VALUE}}' ], |
| 1772 |
'linkedin_hover_bg_color' => [ $css_selectors['linkedin_hover_bg_color'] => 'background-color: {{VALUE}}' ], |
| 1773 |
'pinterest_hover_bg_color' => [ $css_selectors['pinterest_hover_bg_color'] => 'background-color: {{VALUE}}' ], |
| 1774 |
'skype_hover_bg_color' => [ $css_selectors['skype_hover_bg_color'] => 'background-color: {{VALUE}}' ], |
| 1775 |
'whatsapp_hover_bg_color' => [ $css_selectors['whatsapp_hover_bg_color'] => 'background-color: {{VALUE}}' ], |
| 1776 |
'reddit_hover_bg_color' => [ $css_selectors['reddit_hover_bg_color'] => 'background-color: {{VALUE}}' ], |
| 1777 |
'telegram_hover_bg_color' => [ $css_selectors['telegram_hover_bg_color'] => 'background-color: {{VALUE}}' ], |
| 1778 |
'border' => $css_selectors['border'], |
| 1779 |
'border_hover_color' => [ $css_selectors['border_hover_color'] => 'border-color: {{VALUE}}' ], |
| 1780 |
'border_radius' => [ $css_selectors['border_radius'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}' ], |
| 1781 |
'padding' => [ $css_selectors['padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ], |
| 1782 |
'margin' => [ $css_selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ], |
| 1783 |
]; |
| 1784 |
|
| 1785 |
$fields = ControlHelper::general_elementor_style( 'share_items', $title, $obj, $condition, $selectors ); |
| 1786 |
|
| 1787 |
unset( |
| 1788 |
$fields['rtsb_el_share_items_typography'], |
| 1789 |
$fields['share_items_alignment'], |
| 1790 |
$fields['share_items_hover_color'], |
| 1791 |
$fields['share_items_hover_bg_color'], |
| 1792 |
$fields['share_items_color'], |
| 1793 |
$fields['share_items_bg_color'] |
| 1794 |
); |
| 1795 |
|
| 1796 |
$extra_controls = []; |
| 1797 |
|
| 1798 |
$extra_controls['share_items_spacing'] = [ |
| 1799 |
'type' => 'slider', |
| 1800 |
'mode' => 'responsive', |
| 1801 |
'label' => esc_html__( 'Items Spacing', 'shopbuilder' ), |
| 1802 |
'size_units' => [ 'px' ], |
| 1803 |
'range' => [ |
| 1804 |
'px' => [ |
| 1805 |
'min' => 0, |
| 1806 |
'max' => 100, |
| 1807 |
], |
| 1808 |
], |
| 1809 |
'selectors' => $selectors['share_icons_spacing'], |
| 1810 |
]; |
| 1811 |
|
| 1812 |
$extra_controls['share_items_min_width'] = [ |
| 1813 |
'type' => 'slider', |
| 1814 |
'mode' => 'responsive', |
| 1815 |
'label' => esc_html__( 'Items Min Width', 'shopbuilder' ), |
| 1816 |
'size_units' => [ 'px' ], |
| 1817 |
'range' => [ |
| 1818 |
'px' => [ |
| 1819 |
'min' => 0, |
| 1820 |
'max' => 300, |
| 1821 |
], |
| 1822 |
], |
| 1823 |
'selectors' => $selectors['share_items_min_width'], |
| 1824 |
]; |
| 1825 |
|
| 1826 |
$fields = Fns::insert_controls( 'share_items_typo_note', $fields, $extra_controls, true ); |
| 1827 |
|
| 1828 |
$share_platforms = ControlHelper::sharing_settings(); |
| 1829 |
|
| 1830 |
$extra_controls['social_items_color'] = [ |
| 1831 |
'type' => 'color', |
| 1832 |
'label' => esc_html__( 'Items Color', 'shopbuilder' ), |
| 1833 |
'selectors' => $selectors['social_items_color'], |
| 1834 |
]; |
| 1835 |
|
| 1836 |
$extra_controls['social_items_bg_color'] = [ |
| 1837 |
'type' => 'color', |
| 1838 |
'label' => esc_html__( 'Items Background Color', 'shopbuilder' ), |
| 1839 |
'selectors' => $selectors['social_items_bg_color'], |
| 1840 |
]; |
| 1841 |
|
| 1842 |
foreach ( $share_platforms as $share_platform ) { |
| 1843 |
$extra_controls[ $share_platform . '_color' ] = [ |
| 1844 |
'type' => 'color', |
| 1845 |
'label' => ucfirst( $share_platform ) . esc_html__( ' Color', 'shopbuilder' ), |
| 1846 |
'selectors' => $selectors[ $share_platform . '_color' ], |
| 1847 |
]; |
| 1848 |
|
| 1849 |
$extra_controls[ $share_platform . '_bg_color' ] = [ |
| 1850 |
'type' => 'color', |
| 1851 |
'label' => ucfirst( $share_platform ) . esc_html__( ' Background', 'shopbuilder' ), |
| 1852 |
'selectors' => $selectors[ $share_platform . '_bg_color' ], |
| 1853 |
]; |
| 1854 |
|
| 1855 |
$fields = Fns::insert_controls( 'share_items_color_tab', $fields, $extra_controls, true ); |
| 1856 |
} |
| 1857 |
|
| 1858 |
$extra_controls['social_items_hover_color'] = [ |
| 1859 |
'type' => 'color', |
| 1860 |
'label' => esc_html__( 'Items Hover Color', 'shopbuilder' ), |
| 1861 |
'selectors' => $selectors['social_items_hover_color'], |
| 1862 |
]; |
| 1863 |
|
| 1864 |
$extra_controls['social_items_hover_bg_color'] = [ |
| 1865 |
'type' => 'color', |
| 1866 |
'label' => esc_html__( 'Items Background Hover Color', 'shopbuilder' ), |
| 1867 |
'selectors' => $selectors['social_items_hover_bg_color'], |
| 1868 |
]; |
| 1869 |
|
| 1870 |
foreach ( $share_platforms as $share_platform ) { |
| 1871 |
$extra_controls[ $share_platform . '_hover_color' ] = [ |
| 1872 |
'type' => 'color', |
| 1873 |
'label' => ucfirst( $share_platform ) . esc_html__( ' Hover Color', 'shopbuilder' ), |
| 1874 |
'selectors' => $selectors[ $share_platform . '_hover_color' ], |
| 1875 |
]; |
| 1876 |
|
| 1877 |
$extra_controls[ $share_platform . '_hover_bg_color' ] = [ |
| 1878 |
'type' => 'color', |
| 1879 |
'label' => ucfirst( $share_platform ) . esc_html__( ' Hover Background', 'shopbuilder' ), |
| 1880 |
'selectors' => $selectors[ $share_platform . '_hover_bg_color' ], |
| 1881 |
]; |
| 1882 |
|
| 1883 |
$fields = Fns::insert_controls( 'share_items_hover_color_tab', $fields, $extra_controls, true ); |
| 1884 |
} |
| 1885 |
|
| 1886 |
$extra_controls['share_items_radius'] = [ |
| 1887 |
'mode' => 'responsive', |
| 1888 |
'type' => 'dimensions', |
| 1889 |
'label' => esc_html__( 'Border Radius', 'shopbuilder' ), |
| 1890 |
'size_units' => [ 'px', '%', 'em' ], |
| 1891 |
'selectors' => $selectors['border_radius'], |
| 1892 |
]; |
| 1893 |
|
| 1894 |
$fields = Fns::insert_controls( 'share_items_border_hover_color', $fields, $extra_controls, true ); |
| 1895 |
|
| 1896 |
return apply_filters( 'rtsb/elements/elementor/share_icons_style_control', $fields, $obj ); |
| 1897 |
} |
| 1898 |
|
| 1899 |
/** |
| 1900 |
* Share Icons Section |
| 1901 |
* |
| 1902 |
* @param object $obj Reference object. |
| 1903 |
* |
| 1904 |
* @return array |
| 1905 |
*/ |
| 1906 |
public static function share_icons( $obj ): array { |
| 1907 |
$css_selectors = $obj->selectors['share_icons']; |
| 1908 |
$title = esc_html__( 'Share Icons', 'shopbuilder' ); |
| 1909 |
$condition = [ |
| 1910 |
'layout!' => [ 'default' ], |
| 1911 |
]; |
| 1912 |
$selectors = [ |
| 1913 |
'share_icons_width' => [ $css_selectors['share_icons_width'] => 'width: {{SIZE}}{{UNIT}}' ], |
| 1914 |
'share_icons_height' => [ $css_selectors['share_icons_height'] => 'height: {{SIZE}}{{UNIT}}' ], |
| 1915 |
'color' => [ $css_selectors['color'] => 'fill: {{VALUE}}' ], |
| 1916 |
'bg_color' => [ $css_selectors['bg_color'] => 'background-color: {{VALUE}}' ], |
| 1917 |
'hover_color' => [ $css_selectors['hover_color'] => 'fill: {{VALUE}}' ], |
| 1918 |
'hover_bg_color' => [ $css_selectors['hover_bg_color'] => 'background-color: {{VALUE}}' ], |
| 1919 |
'border' => $css_selectors['border'], |
| 1920 |
'border_hover_color' => [ $css_selectors['border_hover_color'] => 'border-color: {{VALUE}}' ], |
| 1921 |
'padding' => [ $css_selectors['padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ], |
| 1922 |
'margin' => [ $css_selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ], |
| 1923 |
]; |
| 1924 |
|
| 1925 |
$fields = ControlHelper::general_elementor_style( 'share_icons', $title, $obj, $condition, $selectors ); |
| 1926 |
|
| 1927 |
unset( |
| 1928 |
$fields['rtsb_el_share_icons_typography'], |
| 1929 |
$fields['share_icons_alignment'], |
| 1930 |
); |
| 1931 |
|
| 1932 |
$extra_controls = []; |
| 1933 |
|
| 1934 |
$extra_controls['share_icons_width'] = [ |
| 1935 |
'type' => 'slider', |
| 1936 |
'mode' => 'responsive', |
| 1937 |
'label' => esc_html__( 'Icon Width', 'shopbuilder' ), |
| 1938 |
'size_units' => [ 'px' ], |
| 1939 |
'range' => [ |
| 1940 |
'px' => [ |
| 1941 |
'min' => 0, |
| 1942 |
'max' => 100, |
| 1943 |
], |
| 1944 |
], |
| 1945 |
'selectors' => $selectors['share_icons_width'], |
| 1946 |
]; |
| 1947 |
|
| 1948 |
$extra_controls['share_icons_height'] = [ |
| 1949 |
'type' => 'slider', |
| 1950 |
'mode' => 'responsive', |
| 1951 |
'label' => esc_html__( 'Icon Height', 'shopbuilder' ), |
| 1952 |
'size_units' => [ 'px' ], |
| 1953 |
'range' => [ |
| 1954 |
'px' => [ |
| 1955 |
'min' => 0, |
| 1956 |
'max' => 100, |
| 1957 |
], |
| 1958 |
], |
| 1959 |
'selectors' => $selectors['share_icons_height'], |
| 1960 |
]; |
| 1961 |
|
| 1962 |
$fields = Fns::insert_controls( 'share_icons_typo_note', $fields, $extra_controls, true ); |
| 1963 |
|
| 1964 |
$fields['share_icons_typo_note']['raw'] = sprintf( |
| 1965 |
'<h3 class="rtsb-elementor-group-heading">%s</h3>', |
| 1966 |
esc_html__( 'Dimension', 'shopbuilder' ) |
| 1967 |
); |
| 1968 |
|
| 1969 |
return apply_filters( 'rtsb/elements/elementor/share_icons_style_control', $fields, $obj ); |
| 1970 |
} |
| 1971 |
|
| 1972 |
/** |
| 1973 |
* Share Text Section |
| 1974 |
* |
| 1975 |
* @param object $obj Reference object. |
| 1976 |
* |
| 1977 |
* @return array |
| 1978 |
*/ |
| 1979 |
public static function share_text( $obj ): array { |
| 1980 |
$css_selectors = $obj->selectors['share_text']; |
| 1981 |
$title = esc_html__( 'Share Text', 'shopbuilder' ); |
| 1982 |
$condition = [ |
| 1983 |
'layout!' => [ 'default' ], |
| 1984 |
]; |
| 1985 |
$selectors = [ |
| 1986 |
'typography' => $css_selectors['typography'], |
| 1987 |
'alignment' => [ $css_selectors['alignment'] => 'text-align: {{VALUE}};' ], |
| 1988 |
'color' => [ $css_selectors['color'] => 'color: {{VALUE}};' ], |
| 1989 |
'bg_color' => [ $css_selectors['bg_color'] => 'background-color: {{VALUE}}' ], |
| 1990 |
'hover_color' => [ $css_selectors['hover_color'] => 'color: {{VALUE}}' ], |
| 1991 |
'hover_bg_color' => [ $css_selectors['hover_bg_color'] => 'background-color: {{VALUE}}' ], |
| 1992 |
'border' => $css_selectors['border'], |
| 1993 |
'border_hover_color' => [ $css_selectors['border_hover_color'] => 'border-color: {{VALUE}}' ], |
| 1994 |
'padding' => [ $css_selectors['padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ], |
| 1995 |
'margin' => [ $css_selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ], |
| 1996 |
]; |
| 1997 |
|
| 1998 |
$fields = ControlHelper::general_elementor_style( 'share_text', $title, $obj, $condition, $selectors ); |
| 1999 |
|
| 2000 |
return apply_filters( 'rtsb/elements/elementor/share_text_style_control', $fields, $obj ); |
| 2001 |
} |
| 2002 |
|
| 2003 |
/** |
| 2004 |
* Share Text Section |
| 2005 |
* |
| 2006 |
* @param object $obj Reference object. |
| 2007 |
* |
| 2008 |
* @return array |
| 2009 |
*/ |
| 2010 |
public static function share_header( $obj ): array { |
| 2011 |
$css_selectors = $obj->selectors['share_header']; |
| 2012 |
$title = esc_html__( 'Share Header', 'shopbuilder' ); |
| 2013 |
$condition = [ |
| 2014 |
'show_share_pre_text' => [ 'yes' ], |
| 2015 |
]; |
| 2016 |
$selectors = [ |
| 2017 |
'typography' => $css_selectors['typography'], |
| 2018 |
'share_header_type' => [ $css_selectors['share_header_type'] => 'display: {{VALUE}};' ], |
| 2019 |
'color' => [ $css_selectors['color'] => 'color: {{VALUE}};' ], |
| 2020 |
'bg_color' => [ $css_selectors['bg_color'] => 'background-color: {{VALUE}}' ], |
| 2021 |
'border' => $css_selectors['border'], |
| 2022 |
'padding' => [ $css_selectors['padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ], |
| 2023 |
'margin' => [ $css_selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ], |
| 2024 |
]; |
| 2025 |
|
| 2026 |
$fields = ControlHelper::general_elementor_style( 'share_header', $title, $obj, $condition, $selectors ); |
| 2027 |
|
| 2028 |
unset( |
| 2029 |
$fields['share_header_alignment'], |
| 2030 |
$fields['share_header_color_tabs'], |
| 2031 |
$fields['share_header_color_tab'], |
| 2032 |
$fields['share_header_color_tab_end'], |
| 2033 |
$fields['share_header_hover_color_tab'], |
| 2034 |
$fields['share_header_hover_color'], |
| 2035 |
$fields['share_header_hover_bg_color'], |
| 2036 |
$fields['share_header_hover_color_tab_end'], |
| 2037 |
$fields['share_header_color_tabs_end'], |
| 2038 |
$fields['share_header_border_hover_color'], |
| 2039 |
); |
| 2040 |
|
| 2041 |
$extra_controls = []; |
| 2042 |
|
| 2043 |
$extra_controls['share_header_type'] = [ |
| 2044 |
'type' => 'choose', |
| 2045 |
'label' => esc_html__( 'Display Type', 'shopbuilder' ), |
| 2046 |
'options' => [ |
| 2047 |
'flex' => [ |
| 2048 |
'title' => esc_html__( 'Inline', 'shopbuilder' ), |
| 2049 |
'icon' => 'eicon-h-align-right', |
| 2050 |
], |
| 2051 |
'block' => [ |
| 2052 |
'title' => esc_html__( 'New Line', 'shopbuilder' ), |
| 2053 |
'icon' => 'eicon-v-align-bottom', |
| 2054 |
], |
| 2055 |
], |
| 2056 |
'default' => 'flex', |
| 2057 |
'toggle' => true, |
| 2058 |
'selectors' => $selectors['share_header_type'], |
| 2059 |
]; |
| 2060 |
|
| 2061 |
return Fns::insert_controls( 'share_header_color_note', $fields, $extra_controls ); |
| 2062 |
} |
| 2063 |
|
| 2064 |
/** |
| 2065 |
* Advanced section |
| 2066 |
* |
| 2067 |
* @param object $obj Reference object. |
| 2068 |
* |
| 2069 |
* @return array |
| 2070 |
*/ |
| 2071 |
public static function advanced( $obj ): array { |
| 2072 |
|
| 2073 |
$fields['advanced_section'] = $obj->start_section( esc_html__( 'Advanced', 'shopbuilder' ), self::$tab ); |
| 2074 |
|
| 2075 |
$fields['gutter_section_end'] = $obj->end_section(); |
| 2076 |
|
| 2077 |
return apply_filters( 'rtsb/elements/elementor/advanced_control', $fields, $obj ); |
| 2078 |
} |
| 2079 |
|
| 2080 |
/** |
| 2081 |
* Slider buttons section |
| 2082 |
* |
| 2083 |
* @param object $obj Reference object. |
| 2084 |
* |
| 2085 |
* @return array |
| 2086 |
*/ |
| 2087 |
public static function slider_buttons( $obj ): array { |
| 2088 |
$css_selectors = $obj->selectors['slider_buttons']; |
| 2089 |
$title = esc_html__( 'Slider Buttons', 'shopbuilder' ); |
| 2090 |
$selectors = [ |
| 2091 |
'arrow_size' => [ $css_selectors['arrow_size'] => 'font-size: {{SIZE}}{{UNIT}};' ], |
| 2092 |
'arrow_width' => [ $css_selectors['arrow_width'] => 'width: {{SIZE}}{{UNIT}};' ], |
| 2093 |
'arrow_height' => [ $css_selectors['arrow_height'] => 'height: {{SIZE}}{{UNIT}};' ], |
| 2094 |
'arrow_line_height' => [ $css_selectors['arrow_line_height'] => 'line-height: {{SIZE}}{{UNIT}};' ], |
| 2095 |
'dot_width' => [ $css_selectors['dot_width'] => 'width: {{SIZE}}{{UNIT}};' ], |
| 2096 |
'dot_height' => [ $css_selectors['dot_height'] => 'height: {{SIZE}}{{UNIT}};' ], |
| 2097 |
'dot_spacing' => [ $css_selectors['dot_spacing'] => 'margin-left: calc({{SIZE}}{{UNIT}} / 2); margin-right: calc({{SIZE}}{{UNIT}} / 2);' ], |
| 2098 |
'color' => [ $css_selectors['color'] => 'color: {{VALUE}};' ], |
| 2099 |
'bg_color' => [ $css_selectors['bg_color'] => 'background-color: {{VALUE}};' ], |
| 2100 |
'hover_color' => [ $css_selectors['hover_color'] => 'color: {{VALUE}};' ], |
| 2101 |
'hover_bg_color' => [ $css_selectors['hover_bg_color'] => 'background-color: {{VALUE}};' ], |
| 2102 |
'dot_color' => [ $css_selectors['dot_color'] => 'background-color: {{VALUE}};' ], |
| 2103 |
'dot_active_color' => [ $css_selectors['dot_active_color'] => 'background-color: {{VALUE}};' ], |
| 2104 |
'border' => $css_selectors['border'], |
| 2105 |
'border_hover_color' => [ $css_selectors['border_hover_color'] => 'border-color: {{VALUE}};' ], |
| 2106 |
'active_border_color' => [ $css_selectors['active_border_color'] => 'border-color: {{VALUE}};' ], |
| 2107 |
'border_radius' => [ $css_selectors['border_radius'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ], |
| 2108 |
'wrapper_padding' => [ $css_selectors['wrapper_padding'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ], |
| 2109 |
]; |
| 2110 |
|
| 2111 |
$conditions = [ |
| 2112 |
'relation' => 'or', |
| 2113 |
'terms' => [ |
| 2114 |
[ |
| 2115 |
'name' => 'slider_nav', |
| 2116 |
'operator' => '==', |
| 2117 |
'value' => 'yes', |
| 2118 |
], |
| 2119 |
[ |
| 2120 |
'name' => 'slider_pagi', |
| 2121 |
'operator' => '==', |
| 2122 |
'value' => 'yes', |
| 2123 |
], |
| 2124 |
], |
| 2125 |
]; |
| 2126 |
|
| 2127 |
$fields = ControlHelper::general_elementor_style( 'slider_buttons', $title, $obj, [], $selectors, $conditions ); |
| 2128 |
|
| 2129 |
unset( |
| 2130 |
$fields['rtsb_el_slider_buttons_typography'], |
| 2131 |
$fields['slider_buttons_alignment'], |
| 2132 |
$fields['slider_buttons_padding'], |
| 2133 |
$fields['slider_buttons_margin'] |
| 2134 |
); |
| 2135 |
|
| 2136 |
$extra_controls = []; |
| 2137 |
$arrow_condition = [ 'slider_nav' => [ 'yes' ] ]; |
| 2138 |
$dot_condition = [ 'slider_pagi' => [ 'yes' ] ]; |
| 2139 |
|
| 2140 |
$fields['slider_buttons_typo_note']['raw'] = sprintf( |
| 2141 |
'<h3 class="rtsb-elementor-group-heading">%s</h3>', |
| 2142 |
esc_html__( 'Arrow Size (px)', 'shopbuilder' ) |
| 2143 |
); |
| 2144 |
|
| 2145 |
$fields['slider_buttons_typo_note']['condition'] = $arrow_condition; |
| 2146 |
|
| 2147 |
$extra_controls['slider_buttons_arrow_size'] = [ |
| 2148 |
'type' => 'slider', |
| 2149 |
'mode' => 'responsive', |
| 2150 |
'label' => esc_html__( 'Arrow Size', 'shopbuilder' ), |
| 2151 |
'range' => [ |
| 2152 |
'px' => [ |
| 2153 |
'min' => 1, |
| 2154 |
'max' => 100, |
| 2155 |
'step' => 1, |
| 2156 |
], |
| 2157 |
], |
| 2158 |
'condition' => $arrow_condition, |
| 2159 |
'selectors' => $selectors['arrow_size'], |
| 2160 |
]; |
| 2161 |
|
| 2162 |
$extra_controls['slider_buttons_arrow_width'] = [ |
| 2163 |
'type' => 'slider', |
| 2164 |
'mode' => 'responsive', |
| 2165 |
'label' => esc_html__( 'Arrow Width', 'shopbuilder' ), |
| 2166 |
'range' => [ |
| 2167 |
'px' => [ |
| 2168 |
'min' => 1, |
| 2169 |
'max' => 100, |
| 2170 |
'step' => 1, |
| 2171 |
], |
| 2172 |
], |
| 2173 |
'condition' => $arrow_condition, |
| 2174 |
'selectors' => $selectors['arrow_width'], |
| 2175 |
]; |
| 2176 |
|
| 2177 |
$extra_controls['slider_buttons_arrow_height'] = [ |
| 2178 |
'type' => 'slider', |
| 2179 |
'mode' => 'responsive', |
| 2180 |
'label' => esc_html__( 'Arrow Height', 'shopbuilder' ), |
| 2181 |
'range' => [ |
| 2182 |
'px' => [ |
| 2183 |
'min' => 1, |
| 2184 |
'max' => 100, |
| 2185 |
'step' => 1, |
| 2186 |
], |
| 2187 |
], |
| 2188 |
'condition' => $arrow_condition, |
| 2189 |
'selectors' => $selectors['arrow_height'], |
| 2190 |
]; |
| 2191 |
|
| 2192 |
$extra_controls['slider_buttons_arrow_line_height'] = [ |
| 2193 |
'type' => 'slider', |
| 2194 |
'mode' => 'responsive', |
| 2195 |
'label' => esc_html__( 'Arrow Line Height', 'shopbuilder' ), |
| 2196 |
'range' => [ |
| 2197 |
'px' => [ |
| 2198 |
'min' => 1, |
| 2199 |
'max' => 100, |
| 2200 |
'step' => 1, |
| 2201 |
], |
| 2202 |
], |
| 2203 |
'condition' => $arrow_condition, |
| 2204 |
'selectors' => $selectors['arrow_line_height'], |
| 2205 |
]; |
| 2206 |
|
| 2207 |
$extra_controls['slider_buttons_dot_size_note'] = $obj->el_heading( |
| 2208 |
esc_html__( 'Dot Size (px)', 'shopbuilder' ), |
| 2209 |
'before', |
| 2210 |
[], |
| 2211 |
$dot_condition |
| 2212 |
); |
| 2213 |
|
| 2214 |
$extra_controls['slider_buttons_dot_width'] = [ |
| 2215 |
'type' => 'slider', |
| 2216 |
'mode' => 'responsive', |
| 2217 |
'label' => esc_html__( 'Dot Width', 'shopbuilder' ), |
| 2218 |
'range' => [ |
| 2219 |
'px' => [ |
| 2220 |
'min' => 1, |
| 2221 |
'max' => 100, |
| 2222 |
'step' => 1, |
| 2223 |
], |
| 2224 |
], |
| 2225 |
'selectors' => $selectors['dot_width'], |
| 2226 |
'condition' => $dot_condition, |
| 2227 |
]; |
| 2228 |
|
| 2229 |
$extra_controls['slider_buttons_dot_height'] = [ |
| 2230 |
'type' => 'slider', |
| 2231 |
'mode' => 'responsive', |
| 2232 |
'label' => esc_html__( 'Dot Height', 'shopbuilder' ), |
| 2233 |
'range' => [ |
| 2234 |
'px' => [ |
| 2235 |
'min' => 1, |
| 2236 |
'max' => 100, |
| 2237 |
'step' => 1, |
| 2238 |
], |
| 2239 |
], |
| 2240 |
'selectors' => $selectors['dot_height'], |
| 2241 |
'condition' => $dot_condition, |
| 2242 |
]; |
| 2243 |
|
| 2244 |
$extra_controls['slider_buttons_dot_spacing'] = [ |
| 2245 |
'type' => 'slider', |
| 2246 |
'mode' => 'responsive', |
| 2247 |
'label' => esc_html__( 'Dot Spacing', 'shopbuilder' ), |
| 2248 |
'range' => [ |
| 2249 |
'px' => [ |
| 2250 |
'min' => 1, |
| 2251 |
'max' => 100, |
| 2252 |
'step' => 1, |
| 2253 |
], |
| 2254 |
], |
| 2255 |
'selectors' => $selectors['dot_spacing'], |
| 2256 |
'condition' => $dot_condition, |
| 2257 |
]; |
| 2258 |
|
| 2259 |
$fields = Fns::insert_controls( 'slider_buttons_typo_note', $fields, $extra_controls, true ); |
| 2260 |
|
| 2261 |
$extra_controls['slider_buttons_active_color_tab'] = $obj->start_tab( esc_html__( 'Dot', 'shopbuilder' ) ); |
| 2262 |
|
| 2263 |
$extra_controls['slider_buttons_active_color'] = [ |
| 2264 |
'type' => 'color', |
| 2265 |
'label' => esc_html__( 'Dot Color', 'shopbuilder' ), |
| 2266 |
'selectors' => $selectors['dot_color'], |
| 2267 |
]; |
| 2268 |
|
| 2269 |
$extra_controls['slider_buttons_active_bg_color'] = [ |
| 2270 |
'type' => 'color', |
| 2271 |
'label' => esc_html__( 'Dot Active Color', 'shopbuilder' ), |
| 2272 |
'selectors' => $selectors['dot_active_color'], |
| 2273 |
]; |
| 2274 |
|
| 2275 |
$extra_controls['slider_buttons_active_color_tab_end'] = $obj->end_tab(); |
| 2276 |
|
| 2277 |
$fields = Fns::insert_controls( 'slider_buttons_hover_color_tab_end', $fields, $extra_controls, true ); |
| 2278 |
|
| 2279 |
$extra_controls['slider_buttons_border_active_color'] = [ |
| 2280 |
'type' => 'color', |
| 2281 |
'label' => esc_html__( 'Active Color', 'shopbuilder' ), |
| 2282 |
'condition' => [ 'rtsb_el_slider_buttons_border_border!' => [ '' ] ], |
| 2283 |
'selectors' => $selectors['active_border_color'], |
| 2284 |
]; |
| 2285 |
|
| 2286 |
$extra_controls['slider_buttons_buttons_radius'] = [ |
| 2287 |
'mode' => 'responsive', |
| 2288 |
'type' => 'dimensions', |
| 2289 |
'label' => esc_html__( 'Border Radius', 'shopbuilder' ), |
| 2290 |
'size_units' => [ 'px', '%', 'em' ], |
| 2291 |
'selectors' => $selectors['border_radius'], |
| 2292 |
]; |
| 2293 |
|
| 2294 |
$fields = Fns::insert_controls( 'slider_buttons_border_hover_color', $fields, $extra_controls, true ); |
| 2295 |
|
| 2296 |
$extra_controls['slider_buttons_wrapper_padding'] = [ |
| 2297 |
'mode' => 'responsive', |
| 2298 |
'type' => 'dimensions', |
| 2299 |
'label' => esc_html__( 'Wrapper Margin', 'shopbuilder' ), |
| 2300 |
'size_units' => [ 'px', '%', 'em' ], |
| 2301 |
'selectors' => $selectors['wrapper_padding'], |
| 2302 |
]; |
| 2303 |
|
| 2304 |
$fields = Fns::insert_controls( 'slider_buttons_spacing_note', $fields, $extra_controls, true ); |
| 2305 |
|
| 2306 |
return apply_filters( 'rtsb/elements/elementor/slider_buttons_style_control', $fields, $obj ); |
| 2307 |
} |
| 2308 |
|
| 2309 |
/** |
| 2310 |
* Not Found Notice Section |
| 2311 |
* |
| 2312 |
* @param object $obj Reference object. |
| 2313 |
* |
| 2314 |
* @return array |
| 2315 |
*/ |
| 2316 |
public static function not_found_notice( $obj ): array { |
| 2317 |
$css_selectors = $obj->selectors['not_found_notice']; |
| 2318 |
$title = esc_html__( 'Not Found Notice', 'shopbuilder' ); |
| 2319 |
$selectors = [ |
| 2320 |
'typography' => $css_selectors['typography'], |
| 2321 |
'alignment' => [ $css_selectors['alignment'] => 'text-align: {{VALUE}}; justify-content: {{VALUE}};' ], |
| 2322 |
'color' => [ $css_selectors['color'] => 'color: {{VALUE}};' ], |
| 2323 |
'bg_color' => [ $css_selectors['bg_color'] => 'background-color: {{VALUE}};' ], |
| 2324 |
'border' => $css_selectors['border'], |
| 2325 |
'padding' => [ $css_selectors['padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ], |
| 2326 |
'margin' => [ $css_selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ], |
| 2327 |
]; |
| 2328 |
|
| 2329 |
$fields = ControlHelper::general_elementor_style( 'not_found_notice', $title, $obj, [], $selectors ); |
| 2330 |
|
| 2331 |
unset( |
| 2332 |
$fields['not_found_notice_color_tabs'], |
| 2333 |
$fields['not_found_notice_color_tab'], |
| 2334 |
$fields['not_found_notice_color_tab_end'], |
| 2335 |
$fields['not_found_notice_hover_color_tab'], |
| 2336 |
$fields['not_found_notice_hover_color'], |
| 2337 |
$fields['not_found_notice_hover_bg_color'], |
| 2338 |
$fields['not_found_notice_hover_color_tab_end'], |
| 2339 |
$fields['not_found_notice_color_tabs_end'], |
| 2340 |
$fields['not_found_notice_border_hover_color'] |
| 2341 |
); |
| 2342 |
|
| 2343 |
return $fields; |
| 2344 |
} |
| 2345 |
|
| 2346 |
/** |
| 2347 |
* Title Selectors. |
| 2348 |
* |
| 2349 |
* @param array $selectors Selector array. |
| 2350 |
* |
| 2351 |
* @return array |
| 2352 |
*/ |
| 2353 |
public static function title_selectors( $selectors ): array { |
| 2354 |
return [ |
| 2355 |
'typography' => $selectors['typography'], |
| 2356 |
'alignment' => [ $selectors['alignment'] => 'text-align: {{VALUE}};' ], |
| 2357 |
'color' => [ $selectors['color'] => 'color: {{VALUE}};' ], |
| 2358 |
'bg_color' => [ $selectors['bg_color'] => 'background-color: {{VALUE}};' ], |
| 2359 |
'hover_color' => [ $selectors['hover_color'] => 'color: {{VALUE}};' ], |
| 2360 |
'hover_bg_color' => [ $selectors['hover_bg_color'] => 'background-color: {{VALUE}};' ], |
| 2361 |
'border' => $selectors['border'], |
| 2362 |
'border_hover_color' => [ $selectors['border_hover_color'] => 'border-color: {{VALUE}};' ], |
| 2363 |
'padding' => [ $selectors['padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ], |
| 2364 |
'margin' => [ $selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ], |
| 2365 |
]; |
| 2366 |
} |
| 2367 |
|
| 2368 |
/** |
| 2369 |
* Excerpt Selectors. |
| 2370 |
* |
| 2371 |
* @param array $selectors Selector array. |
| 2372 |
* |
| 2373 |
* @return array |
| 2374 |
*/ |
| 2375 |
private static function excerpt_selectors( $selectors ): array { |
| 2376 |
return [ |
| 2377 |
'typography' => $selectors['typography'], |
| 2378 |
'alignment' => [ $selectors['alignment'] => 'text-align: {{VALUE}};' ], |
| 2379 |
'color' => [ $selectors['color'] => 'color: {{VALUE}};' ], |
| 2380 |
'bg_color' => [ $selectors['bg_color'] => 'background-color: {{VALUE}};' ], |
| 2381 |
'border' => $selectors['border'], |
| 2382 |
'padding' => [ $selectors['padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ], |
| 2383 |
'margin' => [ $selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ], |
| 2384 |
]; |
| 2385 |
} |
| 2386 |
|
| 2387 |
/** |
| 2388 |
* Action Button Selectors. |
| 2389 |
* |
| 2390 |
* @param array $selectors Selector array. |
| 2391 |
* |
| 2392 |
* @return array |
| 2393 |
*/ |
| 2394 |
public static function action_btn_selectors( $selectors ): array { |
| 2395 |
return [ |
| 2396 |
'icon_size' => [ |
| 2397 |
$selectors['icon_size']['font_size'] => 'font-size: {{SIZE}}{{UNIT}} !important;', |
| 2398 |
$selectors['icon_size']['width'] => 'width: {{SIZE}}{{UNIT}} !important;', |
| 2399 |
], |
| 2400 |
'width' => [ $selectors['width'] => 'width: {{SIZE}}{{UNIT}} !important;' ], |
| 2401 |
'height' => [ $selectors['height'] => 'height: {{SIZE}}{{UNIT}} !important;' ], |
| 2402 |
'color' => [ $selectors['color'] => 'color: {{VALUE}};' ], |
| 2403 |
'bg_color' => [ $selectors['bg_color'] => 'background-color: {{VALUE}} !important;' ], |
| 2404 |
'hover_color' => [ $selectors['hover_color'] => 'color: {{VALUE}};' ], |
| 2405 |
'hover_bg_color' => [ $selectors['hover_bg_color'] => 'background-color: {{VALUE}} !important;' ], |
| 2406 |
'border' => $selectors['border'], |
| 2407 |
'border_hover_color' => [ $selectors['border_hover_color'] => 'border-color: {{VALUE}};' ], |
| 2408 |
'border_radius' => [ $selectors['border_radius'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ], |
| 2409 |
'padding' => [ $selectors['padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ], |
| 2410 |
'margin' => [ $selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ], |
| 2411 |
]; |
| 2412 |
} |
| 2413 |
} |
| 2414 |
|