| 1 |
<?php |
| 2 |
/** |
| 3 |
* Main ProductDescription class. |
| 4 |
* |
| 5 |
* @package RadiusTheme\SB |
| 6 |
*/ |
| 7 |
|
| 8 |
namespace RadiusTheme\SB\Elementor\Widgets\Controls; |
| 9 |
|
| 10 |
use Elementor\Controls_Manager; |
| 11 |
use RadiusTheme\SB\Helpers\Fns; |
| 12 |
use RadiusTheme\SB\Elementor\Helper\ControlHelper; |
| 13 |
use RadiusTheme\SB\Elementor\Widgets\Controls\ButtonSettings; |
| 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 |
* Product Description class |
| 22 |
*/ |
| 23 |
class CartTableSettings { |
| 24 |
/** |
| 25 |
* Widget Control Selectors |
| 26 |
* |
| 27 |
* @var array |
| 28 |
*/ |
| 29 |
private static $selectors = []; |
| 30 |
|
| 31 |
/** |
| 32 |
* @param object $widget widget. |
| 33 |
* @return array |
| 34 |
*/ |
| 35 |
public static function widget_fields( $widget ) { |
| 36 |
self::$selectors = $widget->selectors; |
| 37 |
|
| 38 |
return self::general_settings( $widget ) + |
| 39 |
self::cart_table() + |
| 40 |
self::quantity_fields( $widget ) + |
| 41 |
self::action_control() + |
| 42 |
self::image_settings() + |
| 43 |
self::table_button( $widget ) + |
| 44 |
self::input_style() + |
| 45 |
QuantityFields::quantity_style_fields( $widget ) + |
| 46 |
self::return_shop_button_style() + |
| 47 |
self::notice_style(); |
| 48 |
} |
| 49 |
|
| 50 |
/** |
| 51 |
* @param object $widget widget. |
| 52 |
* |
| 53 |
* @return array |
| 54 |
*/ |
| 55 |
public static function quantity_fields( $widget ) { |
| 56 |
$fields = QuantityFields::quantity_fields( $widget ); |
| 57 |
return $fields; |
| 58 |
} |
| 59 |
|
| 60 |
/** |
| 61 |
* @param object $widget widget. |
| 62 |
* |
| 63 |
* @return array |
| 64 |
*/ |
| 65 |
public static function table_button( $widget ) { |
| 66 |
$fields = ButtonSettings::style_settings( $widget ); |
| 67 |
|
| 68 |
$extra_controls = [ |
| 69 |
'clear_cart_button_heading' => [ |
| 70 |
'type' => 'html', |
| 71 |
'raw' => sprintf( |
| 72 |
'<h3 class="rtsb-elementor-group-heading">%s</h3>', |
| 73 |
esc_html__( 'Clear Cart Button', 'shopbuilder' ) |
| 74 |
), |
| 75 |
'content_classes' => 'elementor-panel-heading-title', |
| 76 |
], |
| 77 |
'clear_cart_button_tabs_start' => [ |
| 78 |
'mode' => 'tabs_start', |
| 79 |
], |
| 80 |
'clear_cart_button_normal' => [ |
| 81 |
'mode' => 'tab_start', |
| 82 |
'label' => esc_html__( 'Normal', 'shopbuilder' ), |
| 83 |
], |
| 84 |
'clear_cart_button_bg_color' => [ |
| 85 |
'label' => esc_html__( 'Background Color', 'shopbuilder' ), |
| 86 |
'type' => 'color', |
| 87 |
|
| 88 |
'separator' => 'default', |
| 89 |
'selectors' => [ |
| 90 |
self::$selectors['clear_cart_button_bg_color'] => 'background-color: {{VALUE}} !important;', |
| 91 |
], |
| 92 |
], |
| 93 |
'clear_cart_button_text_color' => [ |
| 94 |
'label' => esc_html__( 'Color', 'shopbuilder' ), |
| 95 |
'type' => 'color', |
| 96 |
|
| 97 |
'selectors' => [ |
| 98 |
self::$selectors['clear_cart_button_text_color'] => 'color: {{VALUE}} !important;', |
| 99 |
], |
| 100 |
], |
| 101 |
'clear_cart_button_border_color' => [ |
| 102 |
'label' => esc_html__( 'Border Color', 'shopbuilder' ), |
| 103 |
'type' => 'color', |
| 104 |
|
| 105 |
'selectors' => [ |
| 106 |
self::$selectors['clear_cart_button_border_color'] => 'border-color: {{VALUE}} !important;', |
| 107 |
], |
| 108 |
], |
| 109 |
'clear_cart_button_normal_end' => [ |
| 110 |
'mode' => 'tab_end', |
| 111 |
], |
| 112 |
'clear_cart_button_hover' => [ |
| 113 |
'mode' => 'tab_start', |
| 114 |
'label' => esc_html__( 'Hover', 'shopbuilder' ), |
| 115 |
], |
| 116 |
'clear_cart_button_bg_color_hover' => [ |
| 117 |
'label' => esc_html__( 'Background Color', 'shopbuilder' ), |
| 118 |
'type' => 'color', |
| 119 |
'separator' => 'default', |
| 120 |
|
| 121 |
'selectors' => [ |
| 122 |
self::$selectors['clear_cart_button_bg_color_hover'] => 'background-color: {{VALUE}} !important;', |
| 123 |
], |
| 124 |
], |
| 125 |
'clear_cart_button_text_color_hover' => [ |
| 126 |
'label' => esc_html__( 'Color', 'shopbuilder' ), |
| 127 |
'type' => 'color', |
| 128 |
|
| 129 |
'selectors' => [ |
| 130 |
self::$selectors['clear_cart_button_text_color_hover'] => 'color: {{VALUE}} !important;', |
| 131 |
], |
| 132 |
], |
| 133 |
'clear_cart_button_border_color_hover' => [ |
| 134 |
'label' => esc_html__( 'Border Color', 'shopbuilder' ), |
| 135 |
'type' => 'color', |
| 136 |
|
| 137 |
'selectors' => [ |
| 138 |
self::$selectors['clear_cart_button_border_color_hover'] => 'border-color: {{VALUE}} !important;', |
| 139 |
], |
| 140 |
], |
| 141 |
'clear_cart_button_hover_end' => [ |
| 142 |
'mode' => 'tab_end', |
| 143 |
], |
| 144 |
'clear_cart_button_tabs_end' => [ |
| 145 |
'mode' => 'tabs_end', |
| 146 |
], |
| 147 |
]; |
| 148 |
$fields = Fns::insert_controls( 'button_section_end', $fields, $extra_controls, false ); |
| 149 |
|
| 150 |
return $fields; |
| 151 |
} |
| 152 |
|
| 153 |
/** |
| 154 |
* Widget Field |
| 155 |
* |
| 156 |
* @return array |
| 157 |
*/ |
| 158 |
public static function cart_table() { |
| 159 |
$fields = [ |
| 160 |
'cart_table_settings' => [ |
| 161 |
'mode' => 'section_start', |
| 162 |
'tab' => 'style', |
| 163 |
'label' => esc_html__( 'Cart Table', 'shopbuilder' ), |
| 164 |
], |
| 165 |
|
| 166 |
'cart_element_alignment' => [ |
| 167 |
'mode' => 'responsive', |
| 168 |
'type' => 'choose', |
| 169 |
'label' => esc_html__( 'Element Alignment', 'shopbuilder' ), |
| 170 |
'options' => [ |
| 171 |
'left' => [ |
| 172 |
'title' => esc_html__( 'Left', 'shopbuilder' ), |
| 173 |
'icon' => 'eicon-text-align-left', |
| 174 |
], |
| 175 |
'center' => [ |
| 176 |
'title' => esc_html__( 'Center', 'shopbuilder' ), |
| 177 |
'icon' => 'eicon-text-align-center', |
| 178 |
], |
| 179 |
'right' => [ |
| 180 |
'title' => esc_html__( 'Right', 'shopbuilder' ), |
| 181 |
'icon' => 'eicon-text-align-right', |
| 182 |
], |
| 183 |
], |
| 184 |
'selectors' => [ |
| 185 |
self::$selectors['cart_element_alignment'] => 'text-align: {{VALUE}}; justify-content: {{VALUE}} !important;', |
| 186 |
], |
| 187 |
], |
| 188 |
'cart_table_border' => [ |
| 189 |
'mode' => 'group', |
| 190 |
'type' => 'border', |
| 191 |
'label' => esc_html__( 'Table Border', 'shopbuilder' ), |
| 192 |
'selector' => self::$selectors['cart_table_border'], |
| 193 |
'size_units' => [ 'px' ], |
| 194 |
], |
| 195 |
'table_column_header_padding' => [ |
| 196 |
'label' => esc_html__( 'Column Header Padding(px)', 'shopbuilder' ), |
| 197 |
'type' => 'dimensions', |
| 198 |
'mode' => 'responsive', |
| 199 |
'size_units' => [ 'px' ], |
| 200 |
'selectors' => [ |
| 201 |
self::$selectors['table_column_header_padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 202 |
], |
| 203 |
], |
| 204 |
|
| 205 |
'cart_table_col_padding' => [ |
| 206 |
'label' => esc_html__( 'Column Padding(px)', 'shopbuilder' ), |
| 207 |
'type' => 'dimensions', |
| 208 |
'mode' => 'responsive', |
| 209 |
'size_units' => [ 'px' ], |
| 210 |
'selectors' => [ |
| 211 |
self::$selectors['cart_table_col_padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 212 |
], |
| 213 |
], |
| 214 |
|
| 215 |
'cart_table_row_padding' => [ |
| 216 |
'label' => esc_html__( 'Row Padding on mobile devices (px)', 'shopbuilder' ), |
| 217 |
'description' => esc_html__( 'It will work only for mobile devices.', 'shopbuilder' ), |
| 218 |
'type' => 'dimensions', |
| 219 |
'mode' => 'responsive', |
| 220 |
'size_units' => [ 'px' ], |
| 221 |
'selectors' => [ |
| 222 |
self::$selectors['cart_table_row_padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 223 |
], |
| 224 |
], |
| 225 |
|
| 226 |
'table_row_border' => [ |
| 227 |
'mode' => 'group', |
| 228 |
'type' => 'border', |
| 229 |
'selector' => self::$selectors['table_row_border'], |
| 230 |
'size_units' => [ 'px' ], |
| 231 |
'fields_options' => [ |
| 232 |
'border' => [ |
| 233 |
'label' => esc_html__( 'Row Border', 'shopbuilder' ), |
| 234 |
'label_block' => true, |
| 235 |
], |
| 236 |
'color' => [ |
| 237 |
'label' => esc_html__( 'Border Color', 'shopbuilder' ), |
| 238 |
], |
| 239 |
], |
| 240 |
], |
| 241 |
'table_wrapper_margin' => [ |
| 242 |
'label' => esc_html__( 'Table Wrapper Margin(px)', 'shopbuilder' ), |
| 243 |
'type' => 'dimensions', |
| 244 |
'mode' => 'responsive', |
| 245 |
'size_units' => [ 'px' ], |
| 246 |
'selectors' => [ |
| 247 |
self::$selectors['table_wrapper_margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 248 |
], |
| 249 |
], |
| 250 |
'cart_table_link' => [ |
| 251 |
'type' => 'html', |
| 252 |
'raw' => sprintf( |
| 253 |
'<h3 class="rtsb-elementor-group-heading">%s</h3>', |
| 254 |
esc_html__( 'Link Settings', 'shopbuilder' ) |
| 255 |
), |
| 256 |
'content_classes' => 'elementor-panel-heading-title', |
| 257 |
], |
| 258 |
'cart_link_color' => [ |
| 259 |
'label' => esc_html__( 'Link Color', 'shopbuilder' ), |
| 260 |
'type' => 'color', |
| 261 |
'separator' => 'default', |
| 262 |
'selectors' => [ |
| 263 |
self::$selectors['cart_link_color'] => 'color: {{VALUE}};', |
| 264 |
], |
| 265 |
], |
| 266 |
'cart_link_hover_color' => [ |
| 267 |
'label' => esc_html__( 'Link Hover Color', 'shopbuilder' ), |
| 268 |
'type' => 'color', |
| 269 |
'selectors' => [ |
| 270 |
self::$selectors['cart_link_hover_color'] => 'color: {{VALUE}};', |
| 271 |
], |
| 272 |
], |
| 273 |
'cart_price_settings' => [ |
| 274 |
'type' => 'html', |
| 275 |
'raw' => sprintf( |
| 276 |
'<h3 class="rtsb-elementor-group-heading">%s</h3>', |
| 277 |
esc_html__( 'Price Settings', 'shopbuilder' ) |
| 278 |
), |
| 279 |
'content_classes' => 'elementor-panel-heading-title', |
| 280 |
], |
| 281 |
'cart_subtotal_price_typo' => [ |
| 282 |
'mode' => 'group', |
| 283 |
'type' => 'typography', |
| 284 |
'label' => esc_html__( 'Price Typography', 'shopbuilder' ), |
| 285 |
'selector' => self::$selectors['cart_subtotal_price_typo'], |
| 286 |
], |
| 287 |
|
| 288 |
'cart_price_color' => [ |
| 289 |
'mode' => 'responsive', |
| 290 |
'label' => esc_html__( 'Price Color', 'shopbuilder' ), |
| 291 |
'type' => 'color', |
| 292 |
'separator' => 'default', |
| 293 |
'selectors' => [ |
| 294 |
self::$selectors['cart_price_color'] => 'color: {{VALUE}};', |
| 295 |
], |
| 296 |
], |
| 297 |
'cart_table_heading' => [ |
| 298 |
'type' => 'html', |
| 299 |
'raw' => sprintf( |
| 300 |
'<h3 class="rtsb-elementor-group-heading">%s</h3>', |
| 301 |
esc_html__( 'Cart Table Heading', 'shopbuilder' ) |
| 302 |
), |
| 303 |
'content_classes' => 'elementor-panel-heading-title', |
| 304 |
], |
| 305 |
'cart_heading_element_alignment' => [ |
| 306 |
'mode' => 'responsive', |
| 307 |
'type' => 'choose', |
| 308 |
'label' => esc_html__( 'Element Alignment', 'shopbuilder' ), |
| 309 |
'options' => [ |
| 310 |
'left' => [ |
| 311 |
'title' => esc_html__( 'Left', 'shopbuilder' ), |
| 312 |
'icon' => 'eicon-text-align-left', |
| 313 |
], |
| 314 |
'center' => [ |
| 315 |
'title' => esc_html__( 'Center', 'shopbuilder' ), |
| 316 |
'icon' => 'eicon-text-align-center', |
| 317 |
], |
| 318 |
'right' => [ |
| 319 |
'title' => esc_html__( 'Right', 'shopbuilder' ), |
| 320 |
'icon' => 'eicon-text-align-right', |
| 321 |
], |
| 322 |
], |
| 323 |
'selectors' => [ |
| 324 |
self::$selectors['cart_heading_element_alignment'] => 'text-align: {{VALUE}};', |
| 325 |
], |
| 326 |
], |
| 327 |
'cart_table_header_typography' => [ |
| 328 |
'mode' => 'group', |
| 329 |
'type' => 'typography', |
| 330 |
'label' => esc_html__( 'Typography', 'shopbuilder' ), |
| 331 |
'selector' => self::$selectors['cart_table_header_typography'], |
| 332 |
], |
| 333 |
'cart_table_header_bg_color' => [ |
| 334 |
'mode' => 'responsive', |
| 335 |
'label' => esc_html__( 'Table Header Background Color', 'shopbuilder' ), |
| 336 |
'type' => 'color', |
| 337 |
'selectors' => [ |
| 338 |
self::$selectors['cart_table_header_bg_color'] => 'background-color: {{VALUE}};', |
| 339 |
], |
| 340 |
], |
| 341 |
'cart_table_header_text_color' => [ |
| 342 |
'label' => esc_html__( 'Table Header Text Color', 'shopbuilder' ), |
| 343 |
'type' => 'color', |
| 344 |
'mode' => 'responsive', |
| 345 |
'selectors' => [ |
| 346 |
self::$selectors['cart_table_header_text_color'] => 'color: {{VALUE}};', |
| 347 |
], |
| 348 |
], |
| 349 |
'cart_table_odd_row' => [ |
| 350 |
'type' => 'html', |
| 351 |
'raw' => sprintf( |
| 352 |
'<h3 class="rtsb-elementor-group-heading">%s</h3>', |
| 353 |
esc_html__( 'Cart Table Odd Row', 'shopbuilder' ) |
| 354 |
), |
| 355 |
'content_classes' => 'elementor-panel-heading-title', |
| 356 |
], |
| 357 |
'cart_table_odd_row_bg_color' => [ |
| 358 |
'label' => esc_html__( 'Table Odd Row Background Color', 'shopbuilder' ), |
| 359 |
'mode' => 'responsive', |
| 360 |
'type' => 'color', |
| 361 |
'selectors' => [ |
| 362 |
self::$selectors['cart_table_odd_row_bg_color'] => 'background-color: {{VALUE}};', |
| 363 |
], |
| 364 |
], |
| 365 |
'cart_table_odd_row_text_color' => [ |
| 366 |
'label' => esc_html__( 'Table Odd Row Text Color', 'shopbuilder' ), |
| 367 |
'mode' => 'responsive', |
| 368 |
'type' => 'color', |
| 369 |
'selectors' => [ |
| 370 |
self::$selectors['cart_table_odd_row_text_color'] => 'color: {{VALUE}};', |
| 371 |
], |
| 372 |
], |
| 373 |
|
| 374 |
'cart_table_even_row' => [ |
| 375 |
'type' => 'html', |
| 376 |
'raw' => sprintf( |
| 377 |
'<h3 class="rtsb-elementor-group-heading">%s</h3>', |
| 378 |
esc_html__( 'Cart Table Even Row', 'shopbuilder' ) |
| 379 |
), |
| 380 |
'content_classes' => 'elementor-panel-heading-title', |
| 381 |
], |
| 382 |
'cart_table_even_row_bg_color' => [ |
| 383 |
'label' => esc_html__( 'Table Even Row Background Color', 'shopbuilder' ), |
| 384 |
'type' => 'color', |
| 385 |
'mode' => 'responsive', |
| 386 |
'selectors' => [ |
| 387 |
self::$selectors['cart_table_even_row_bg_color'] => 'background-color: {{VALUE}};', |
| 388 |
], |
| 389 |
], |
| 390 |
'cart_table_even_row_text_color' => [ |
| 391 |
'label' => esc_html__( 'Table Even Row Text Color', 'shopbuilder' ), |
| 392 |
'type' => 'color', |
| 393 |
'mode' => 'responsive', |
| 394 |
'selectors' => [ |
| 395 |
self::$selectors['cart_table_even_row_text_color'] => 'color: {{VALUE}};', |
| 396 |
], |
| 397 |
], |
| 398 |
|
| 399 |
'cart_remove_icon_heading' => [ |
| 400 |
'type' => 'html', |
| 401 |
'raw' => sprintf( |
| 402 |
'<h3 class="rtsb-elementor-group-heading">%s</h3>', |
| 403 |
esc_html__( 'Remove Cart Column', 'shopbuilder' ) |
| 404 |
), |
| 405 |
'content_classes' => 'elementor-panel-heading-title', |
| 406 |
], |
| 407 |
'cart_remove_button_size' => [ |
| 408 |
'mode' => 'responsive', |
| 409 |
'label' => esc_html__( 'Remove Button Size', 'shopbuilder' ), |
| 410 |
'type' => 'slider', |
| 411 |
'range' => [ |
| 412 |
'px' => [ |
| 413 |
'min' => 10, |
| 414 |
'max' => 100, |
| 415 |
], |
| 416 |
], |
| 417 |
'selectors' => [ |
| 418 |
self::$selectors['cart_remove_button_size'] => 'width: {{SIZE}}{{UNIT}};height: {{SIZE}}{{UNIT}};', |
| 419 |
], |
| 420 |
], |
| 421 |
'cart_remove_icon_size' => [ |
| 422 |
'label' => esc_html__( 'Remove Icon Font Size', 'shopbuilder' ), |
| 423 |
'type' => 'slider', |
| 424 |
'range' => [ |
| 425 |
'px' => [ |
| 426 |
'min' => 10, |
| 427 |
'max' => 100, |
| 428 |
], |
| 429 |
], |
| 430 |
'selectors' => [ |
| 431 |
self::$selectors['cart_remove_icon_size'] => 'font-size: {{SIZE}}{{UNIT}};', |
| 432 |
], |
| 433 |
], |
| 434 |
'cart_icon_color' => [ |
| 435 |
'mode' => 'responsive', |
| 436 |
'label' => esc_html__( 'Cart Icon Color', 'shopbuilder' ), |
| 437 |
'type' => 'color', |
| 438 |
'separator' => 'default', |
| 439 |
'selectors' => [ |
| 440 |
self::$selectors['cart_icon_color'] => 'color: {{VALUE}} !important;', |
| 441 |
], |
| 442 |
], |
| 443 |
'cart_icon_bg_color' => [ |
| 444 |
'mode' => 'responsive', |
| 445 |
'label' => esc_html__( 'Cart Icon Background Color', 'shopbuilder' ), |
| 446 |
'type' => 'color', |
| 447 |
'separator' => 'default', |
| 448 |
'selectors' => [ |
| 449 |
self::$selectors['cart_icon_bg_color'] => 'background-color: {{VALUE}} !important;', |
| 450 |
], |
| 451 |
], |
| 452 |
'cart_icon_hover_color' => [ |
| 453 |
'mode' => 'responsive', |
| 454 |
'label' => esc_html__( 'Cart Icon Hover Color', 'shopbuilder' ), |
| 455 |
'type' => 'color', |
| 456 |
'separator' => 'default', |
| 457 |
'selectors' => [ |
| 458 |
self::$selectors['cart_icon_hover_color'] => 'color: {{VALUE}} !important;', |
| 459 |
], |
| 460 |
], |
| 461 |
'cart_icon_hover_bg_color' => [ |
| 462 |
'mode' => 'responsive', |
| 463 |
'label' => esc_html__( 'Cart Icon Hover Background Color', 'shopbuilder' ), |
| 464 |
'type' => 'color', |
| 465 |
'separator' => 'default', |
| 466 |
'selectors' => [ |
| 467 |
self::$selectors['cart_icon_hover_bg_color'] => 'background-color: {{VALUE}} !important;', |
| 468 |
], |
| 469 |
], |
| 470 |
|
| 471 |
'cart_product_title_area' => [ |
| 472 |
'type' => 'html', |
| 473 |
'raw' => sprintf( |
| 474 |
'<h3 class="rtsb-elementor-group-heading">%s</h3>', |
| 475 |
esc_html__( 'Product Title Column', 'shopbuilder' ) |
| 476 |
), |
| 477 |
'content_classes' => 'elementor-panel-heading-title', |
| 478 |
], |
| 479 |
|
| 480 |
'cart_title_element_alignment' => [ |
| 481 |
'mode' => 'responsive', |
| 482 |
'type' => 'choose', |
| 483 |
'label' => esc_html__( 'Title Alignment', 'shopbuilder' ), |
| 484 |
'options' => [ |
| 485 |
'left' => [ |
| 486 |
'title' => esc_html__( 'Left', 'shopbuilder' ), |
| 487 |
'icon' => 'eicon-text-align-left', |
| 488 |
], |
| 489 |
'center' => [ |
| 490 |
'title' => esc_html__( 'Center', 'shopbuilder' ), |
| 491 |
'icon' => 'eicon-text-align-center', |
| 492 |
], |
| 493 |
'right' => [ |
| 494 |
'title' => esc_html__( 'Right', 'shopbuilder' ), |
| 495 |
'icon' => 'eicon-text-align-right', |
| 496 |
], |
| 497 |
], |
| 498 |
'selectors' => [ |
| 499 |
self::$selectors['cart_title_element_alignment'] => 'text-align: {{VALUE}} !important; justify-content: {{VALUE}} !important;', |
| 500 |
], |
| 501 |
], |
| 502 |
|
| 503 |
'cart_product_title_color' => [ |
| 504 |
'label' => esc_html__( 'Title Color', 'shopbuilder' ), |
| 505 |
'type' => 'color', |
| 506 |
'selectors' => [ |
| 507 |
self::$selectors['cart_product_title_color'] => 'color: {{VALUE}};', |
| 508 |
], |
| 509 |
], |
| 510 |
'cart_product_title_typo' => [ |
| 511 |
'mode' => 'group', |
| 512 |
'type' => 'typography', |
| 513 |
'label' => esc_html__( 'Title Typography', 'shopbuilder' ), |
| 514 |
'selector' => self::$selectors['cart_product_title_typo'], |
| 515 |
], |
| 516 |
|
| 517 |
'cart_product_title_meta_color' => [ |
| 518 |
'label' => esc_html__( 'Meta Color', 'shopbuilder' ), |
| 519 |
'type' => 'color', |
| 520 |
'selectors' => [ |
| 521 |
self::$selectors['cart_product_title_meta_color'] => 'color: {{VALUE}};', |
| 522 |
], |
| 523 |
], |
| 524 |
'cart_product_title_meta_typo' => [ |
| 525 |
'mode' => 'group', |
| 526 |
'type' => 'typography', |
| 527 |
'label' => esc_html__( 'Title Meta Typography', 'shopbuilder' ), |
| 528 |
'selector' => self::$selectors['cart_product_title_meta_typo'], |
| 529 |
], |
| 530 |
'cart_product_title_padding' => [ |
| 531 |
'label' => esc_html__( 'Padding (px)', 'shopbuilder' ), |
| 532 |
'type' => 'dimensions', |
| 533 |
'mode' => 'responsive', |
| 534 |
'size_units' => [ 'px' ], |
| 535 |
'selectors' => [ |
| 536 |
self::$selectors['cart_product_title_padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 537 |
], |
| 538 |
], |
| 539 |
|
| 540 |
'cart_table_col_attributes_padding' => [ |
| 541 |
'label' => esc_html__( 'Attributes Padding(px)', 'shopbuilder' ), |
| 542 |
'type' => 'dimensions', |
| 543 |
'mode' => 'responsive', |
| 544 |
'size_units' => [ 'px' ], |
| 545 |
'selectors' => [ |
| 546 |
self::$selectors['cart_table_col_attributes_padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 547 |
], |
| 548 |
], |
| 549 |
|
| 550 |
'cart_subtotal_heading' => [ |
| 551 |
'type' => 'html', |
| 552 |
'raw' => sprintf( |
| 553 |
'<h3 class="rtsb-elementor-group-heading">%s</h3>', |
| 554 |
esc_html__( 'Subtotal Column', 'shopbuilder' ) |
| 555 |
), |
| 556 |
'content_classes' => 'elementor-panel-heading-title', |
| 557 |
], |
| 558 |
'element_alignment' => [ |
| 559 |
'mode' => 'responsive', |
| 560 |
'type' => 'choose', |
| 561 |
'label' => esc_html__( 'Element Alignment', 'shopbuilder' ), |
| 562 |
'options' => [ |
| 563 |
'left' => [ |
| 564 |
'title' => esc_html__( 'Left', 'shopbuilder' ), |
| 565 |
'icon' => 'eicon-text-align-left', |
| 566 |
], |
| 567 |
'center' => [ |
| 568 |
'title' => esc_html__( 'Center', 'shopbuilder' ), |
| 569 |
'icon' => 'eicon-text-align-center', |
| 570 |
], |
| 571 |
'right' => [ |
| 572 |
'title' => esc_html__( 'Right', 'shopbuilder' ), |
| 573 |
'icon' => 'eicon-text-align-right', |
| 574 |
], |
| 575 |
], |
| 576 |
'selectors' => [ |
| 577 |
self::$selectors['element_alignment'] => 'text-align: {{VALUE}} !important;', |
| 578 |
], |
| 579 |
], |
| 580 |
|
| 581 |
'cart_subtotal_button_typo' => [ |
| 582 |
'mode' => 'group', |
| 583 |
'type' => 'typography', |
| 584 |
'label' => esc_html__( 'Button Typography', 'shopbuilder' ), |
| 585 |
'selector' => self::$selectors['cart_subtotal_button_typo'], |
| 586 |
], |
| 587 |
|
| 588 |
'cart_subtotal_price_padding' => [ |
| 589 |
'label' => esc_html__( 'Price Padding (px)', 'shopbuilder' ), |
| 590 |
'type' => 'dimensions', |
| 591 |
'mode' => 'responsive', |
| 592 |
'size_units' => [ 'px' ], |
| 593 |
'selectors' => [ |
| 594 |
self::$selectors['cart_subtotal_price_padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 595 |
], |
| 596 |
], |
| 597 |
|
| 598 |
'cart_subtotal_price_margin' => [ |
| 599 |
'label' => esc_html__( 'Price Margin (px)', 'shopbuilder' ), |
| 600 |
'type' => 'dimensions', |
| 601 |
'mode' => 'responsive', |
| 602 |
'size_units' => [ 'px' ], |
| 603 |
'selectors' => [ |
| 604 |
self::$selectors['cart_subtotal_price_margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 605 |
], |
| 606 |
], |
| 607 |
|
| 608 |
'cart_subtotal_button_wrapper_padding' => [ |
| 609 |
'label' => esc_html__( 'Button Wrapper Padding (px)', 'shopbuilder' ), |
| 610 |
'type' => 'dimensions', |
| 611 |
'mode' => 'responsive', |
| 612 |
'size_units' => [ 'px' ], |
| 613 |
'selectors' => [ |
| 614 |
self::$selectors['cart_subtotal_button_wrapper_padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 615 |
], |
| 616 |
], |
| 617 |
|
| 618 |
'cart_subtotal_button_gap' => [ |
| 619 |
'label' => esc_html__( 'Button Gap', 'shopbuilder' ), |
| 620 |
'type' => 'slider', |
| 621 |
'range' => [ |
| 622 |
'px' => [ |
| 623 |
'min' => 1, |
| 624 |
'max' => 100, |
| 625 |
], |
| 626 |
], |
| 627 |
'selectors' => [ |
| 628 |
self::$selectors['cart_subtotal_button_gap'] => 'gap: {{SIZE}}{{UNIT}};', |
| 629 |
], |
| 630 |
], |
| 631 |
|
| 632 |
'cart_subtotal_col_wrapper_padding' => [ |
| 633 |
'label' => esc_html__( 'Column Wrapper Padding (px)', 'shopbuilder' ), |
| 634 |
'type' => 'dimensions', |
| 635 |
'mode' => 'responsive', |
| 636 |
'size_units' => [ 'px' ], |
| 637 |
'selectors' => [ |
| 638 |
self::$selectors['cart_subtotal_col_wrapper_padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 639 |
], |
| 640 |
], |
| 641 |
|
| 642 |
'action_button_section' => [ |
| 643 |
'type' => 'html', |
| 644 |
'raw' => sprintf( |
| 645 |
'<h3 class="rtsb-elementor-group-heading">%s</h3>', |
| 646 |
esc_html__( 'Action Button', 'shopbuilder' ) |
| 647 |
), |
| 648 |
'content_classes' => 'elementor-panel-heading-title', |
| 649 |
], |
| 650 |
'action_button_padding' => [ |
| 651 |
'label' => esc_html__( 'Action Button Area padding(px)', 'shopbuilder' ), |
| 652 |
'type' => 'dimensions', |
| 653 |
'mode' => 'responsive', |
| 654 |
'size_units' => [ 'px' ], |
| 655 |
'selectors' => [ |
| 656 |
self::$selectors['action_button_padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 657 |
], |
| 658 |
], |
| 659 |
|
| 660 |
'cart_table_settings_end' => [ |
| 661 |
'mode' => 'section_end', |
| 662 |
], |
| 663 |
]; |
| 664 |
|
| 665 |
return $fields; |
| 666 |
} |
| 667 |
|
| 668 |
/** |
| 669 |
* Widget Field |
| 670 |
* |
| 671 |
* @return array |
| 672 |
*/ |
| 673 |
public static function image_settings() { |
| 674 |
$fields = [ |
| 675 |
'table_image_section' => [ |
| 676 |
'mode' => 'section_start', |
| 677 |
'label' => esc_html__( 'Image ', 'shopbuilder' ), |
| 678 |
'tab' => 'style', |
| 679 |
], |
| 680 |
'table_thumbnail_width' => [ |
| 681 |
'mode' => 'responsive', |
| 682 |
'label' => esc_html__( 'Thumbnail Image Width', 'shopbuilder' ), |
| 683 |
'type' => 'slider', |
| 684 |
'size_units' => [ '%', 'px' ], |
| 685 |
'separator' => 'default', |
| 686 |
'range' => [ |
| 687 |
'%' => [ |
| 688 |
'min' => 0, |
| 689 |
'max' => 100, |
| 690 |
'step' => 1, |
| 691 |
], |
| 692 |
'px' => [ |
| 693 |
'min' => 0, |
| 694 |
'max' => 2000, |
| 695 |
'step' => 1, |
| 696 |
], |
| 697 |
], |
| 698 |
'default' => [ |
| 699 |
'unit' => 'px', |
| 700 |
'size' => '130', |
| 701 |
], |
| 702 |
'selectors' => [ |
| 703 |
self::$selectors['table_thumbnail_width'] => 'width: {{SIZE}}{{UNIT}} !important;', |
| 704 |
], |
| 705 |
], |
| 706 |
'table_thumbnail_padding' => [ |
| 707 |
'label' => esc_html__( 'Padding (px)', 'shopbuilder' ), |
| 708 |
'type' => 'dimensions', |
| 709 |
'mode' => 'responsive', |
| 710 |
'size_units' => [ 'px' ], |
| 711 |
'selectors' => [ |
| 712 |
self::$selectors['table_thumbnail_padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 713 |
], |
| 714 |
'separator' => 'before', |
| 715 |
], |
| 716 |
'table_thumbnail_border_radius' => [ |
| 717 |
'label' => esc_html__( 'Border Radius (px)', 'shopbuilder' ), |
| 718 |
'type' => 'dimensions', |
| 719 |
'mode' => 'responsive', |
| 720 |
'size_units' => [ 'px' ], |
| 721 |
'separator' => 'before', |
| 722 |
'selectors' => [ |
| 723 |
self::$selectors['table_thumbnail_border_radius'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 724 |
], |
| 725 |
], |
| 726 |
'table_image_section_end' => [ |
| 727 |
'mode' => 'section_end', |
| 728 |
], |
| 729 |
]; |
| 730 |
|
| 731 |
return $fields; |
| 732 |
} |
| 733 |
|
| 734 |
/** |
| 735 |
* @param object $widget widget. |
| 736 |
* @return array |
| 737 |
*/ |
| 738 |
public static function general_settings( $widget ) { |
| 739 |
$fields = [ |
| 740 |
'general_section' => [ |
| 741 |
'mode' => 'section_start', |
| 742 |
'label' => esc_html__( 'General ', 'shopbuilder' ), |
| 743 |
], |
| 744 |
'show_coupon_field' => [ |
| 745 |
'label' => esc_html__( 'Show Coupon field?', 'shopbuilder' ), |
| 746 |
'type' => 'switch', |
| 747 |
'description' => esc_html__( 'Switch on to show Coupon.', 'shopbuilder' ), |
| 748 |
'separator' => rtsb()->has_pro() ? 'default' : 'after', |
| 749 |
'default' => 'yes', |
| 750 |
], |
| 751 |
'show_clear_cart_button' => [ |
| 752 |
'label' => esc_html__( 'Show Clear Cart Button?', 'shopbuilder' ), |
| 753 |
'type' => 'switch', |
| 754 |
'description' => esc_html__( 'Switch on to show cart clear button.', 'shopbuilder' ), |
| 755 |
'classes' => $widget->pro_class(), |
| 756 |
], |
| 757 |
'table_horizontal_scroll_on_mobile' => [ |
| 758 |
'label' => esc_html__( 'Show default Table View On Mobile?', 'shopbuilder' ), |
| 759 |
'type' => 'switch', |
| 760 |
'description' => esc_html__( 'Show default Table View On Mobile?', 'shopbuilder' ), |
| 761 |
'default' => '', |
| 762 |
'separator' => rtsb()->has_pro() ? 'default' : 'before-short', |
| 763 |
], |
| 764 |
'table_min_width' => [ |
| 765 |
'mode' => 'responsive', |
| 766 |
'label' => esc_html__( 'Table Minimum Width', 'shopbuilder' ), |
| 767 |
'description' => esc_html__( 'Enter table min-width (in px),', 'shopbuilder' ), |
| 768 |
'type' => 'slider', |
| 769 |
'size_units' => [ 'px' ], |
| 770 |
'range' => [ |
| 771 |
'px' => [ |
| 772 |
'min' => 0, |
| 773 |
'max' => 1000, |
| 774 |
'step' => 5, |
| 775 |
], |
| 776 |
], |
| 777 |
'condition' => [ |
| 778 |
'table_horizontal_scroll_on_mobile' => 'yes', |
| 779 |
], |
| 780 |
'selectors' => [ |
| 781 |
self::$selectors['table_min_width'] => 'min-width: {{SIZE}}{{UNIT}};', |
| 782 |
], |
| 783 |
], |
| 784 |
'show_image_on_mobile' => [ |
| 785 |
'label' => esc_html__( 'Show Image On Mobile?', 'shopbuilder' ), |
| 786 |
'type' => 'switch', |
| 787 |
'description' => esc_html__( 'Switch on to show Image on mobile Devices.', 'shopbuilder' ), |
| 788 |
'default' => '', |
| 789 |
'separator' => rtsb()->has_pro() ? 'default' : 'after', |
| 790 |
'condition' => [ |
| 791 |
'table_horizontal_scroll_on_mobile' => '', |
| 792 |
], |
| 793 |
], |
| 794 |
'ajax_on_qty_change' => [ |
| 795 |
'label' => esc_html__( 'Auto Update Cart?', 'shopbuilder' ), |
| 796 |
'type' => 'switch', |
| 797 |
'description' => esc_html__( 'Switch on to auto update cart with Ajax when quantity changes.', 'shopbuilder' ), |
| 798 |
'classes' => $widget->pro_class(), |
| 799 |
], |
| 800 |
'cart_empty_message' => [ |
| 801 |
'type' => 'text', |
| 802 |
'label' => esc_html__( 'Cart Empty Text', 'shopbuilder' ), |
| 803 |
'description' => esc_html__( 'Leave Empty For default.', 'shopbuilder' ), |
| 804 |
'label_block' => true, |
| 805 |
'separator' => rtsb()->has_pro() ? 'default' : 'before-short', |
| 806 |
], |
| 807 |
'cart_table' => [ |
| 808 |
'type' => 'repeater', |
| 809 |
'mode' => 'repeater', |
| 810 |
'label' => esc_html__( 'Cart Table', 'shopbuilder' ), |
| 811 |
'fields' => [ |
| 812 |
'cart_table_items' => [ |
| 813 |
'label' => esc_html__( 'Table Item', 'shopbuilder' ), |
| 814 |
'type' => 'select', |
| 815 |
'separator' => 'default', |
| 816 |
'default' => 'remove', |
| 817 |
'options' => [ |
| 818 |
'remove' => esc_html__( 'Remove', 'shopbuilder' ), |
| 819 |
'thumbnail' => esc_html__( 'Thumbnail', 'shopbuilder' ), |
| 820 |
'name' => esc_html__( 'Product Title', 'shopbuilder' ), |
| 821 |
'price' => esc_html__( 'Price', 'shopbuilder' ), |
| 822 |
'quantity' => esc_html__( 'Quantity', 'shopbuilder' ), |
| 823 |
'subtotal' => esc_html__( 'Total', 'shopbuilder' ), |
| 824 |
'custom_field' => esc_html__( 'Custom Field', 'shopbuilder' ), |
| 825 |
], |
| 826 |
], |
| 827 |
'cart_table_heading_title' => [ |
| 828 |
'label' => esc_html__( 'Heading', 'shopbuilder' ), |
| 829 |
'type' => 'text', |
| 830 |
'separator' => 'default', |
| 831 |
], |
| 832 |
// Thumbnail. |
| 833 |
'cart_table_thumbnail_size' => [ |
| 834 |
'type' => 'select', |
| 835 |
'label' => esc_html__( 'Thumbnail Size', 'shopbuilder' ), |
| 836 |
'default' => 'woocommerce_thumbnail', |
| 837 |
'options' => Fns::get_image_sizes(), |
| 838 |
'condition' => [ |
| 839 |
'cart_table_items' => [ 'thumbnail', 'products' ], |
| 840 |
], |
| 841 |
], |
| 842 |
// Remove Icon. |
| 843 |
'cart_table_remove_icon' => [ |
| 844 |
'label' => esc_html__( 'Icon', 'shopbuilder' ), |
| 845 |
'type' => 'icons', |
| 846 |
'fa4compatibility' => 'breadcrumbsicon', |
| 847 |
'default' => [ |
| 848 |
'value' => 'fas fa-times-circle', |
| 849 |
'library' => 'fa-solid', |
| 850 |
], |
| 851 |
'condition' => [ |
| 852 |
'cart_table_items' => 'remove', |
| 853 |
], |
| 854 |
], |
| 855 |
'cart_table_custom_field' => [ |
| 856 |
'label' => esc_html__( 'Meta Field Key', 'shopbuilder' ), |
| 857 |
'type' => 'text', |
| 858 |
'condition' => [ |
| 859 |
'cart_table_items' => 'custom_field', |
| 860 |
], |
| 861 |
], |
| 862 |
'cart_table_custom_field_fallback' => [ |
| 863 |
'label' => esc_html__( 'Fallback', 'shopbuilder' ), |
| 864 |
'type' => 'text', |
| 865 |
'default' => '', |
| 866 |
'description' => esc_html__( 'Show this if field value is empty', 'shopbuilder' ), |
| 867 |
'condition' => [ |
| 868 |
'cart_table_items' => 'custom_field', |
| 869 |
], |
| 870 |
], |
| 871 |
|
| 872 |
// Product Title. |
| 873 |
'show_sku' => [ |
| 874 |
'label' => esc_html__( 'Show SKU?', 'shopbuilder' ), |
| 875 |
'type' => 'switch', |
| 876 |
'description' => esc_html__( 'Switch on to show Show SKU.', 'shopbuilder' ), |
| 877 |
'separator' => rtsb()->has_pro() ? 'default' : 'after', |
| 878 |
'classes' => $widget->pro_class(), |
| 879 |
'default' => 'yes', |
| 880 |
'condition' => [ |
| 881 |
'cart_table_items' => [ 'name', 'products' ], |
| 882 |
], |
| 883 |
], |
| 884 |
'show_variation_data' => [ |
| 885 |
'label' => esc_html__( 'Show Custom Data?', 'shopbuilder' ), |
| 886 |
'type' => 'switch', |
| 887 |
'description' => esc_html__( 'Enable to display any custom data, such as variation details and extra options.', 'shopbuilder' ), |
| 888 |
'separator' => rtsb()->has_pro() ? 'default' : 'after', |
| 889 |
'classes' => $widget->pro_class(), |
| 890 |
'default' => 'yes', |
| 891 |
'condition' => [ |
| 892 |
'cart_table_items' => [ 'name', 'products' ], |
| 893 |
], |
| 894 |
], |
| 895 |
// Sub Total. |
| 896 |
'show_remove_button' => [ |
| 897 |
'label' => esc_html__( 'Show Remove Button?', 'shopbuilder' ), |
| 898 |
'type' => 'switch', |
| 899 |
'description' => esc_html__( 'Switch on to show remove button below subtotal.', 'shopbuilder' ), |
| 900 |
'default' => '', |
| 901 |
'classes' => $widget->pro_class(), |
| 902 |
'separator' => rtsb()->has_pro() ? 'before-short' : 'default', |
| 903 |
'condition' => [ |
| 904 |
'cart_table_items' => 'subtotal', |
| 905 |
], |
| 906 |
], |
| 907 |
'remove_button_text' => [ |
| 908 |
'label' => esc_html__( 'Remove Button Text', 'shopbuilder' ), |
| 909 |
'type' => 'text', |
| 910 |
'default' => __( 'Remove', 'shopbuilder' ), |
| 911 |
'classes' => $widget->pro_class(), |
| 912 |
'separator' => rtsb()->has_pro() ? 'before-short' : 'default', |
| 913 |
'label_block' => true, |
| 914 |
'condition' => [ |
| 915 |
'show_remove_button' => 'yes', |
| 916 |
], |
| 917 |
], |
| 918 |
'show_wishlist_button' => [ |
| 919 |
'label' => esc_html__( 'Show Wishlist Button?', 'shopbuilder' ), |
| 920 |
'type' => 'switch', |
| 921 |
'description' => esc_html__( 'Switch on to show wishlist button below subtotal.', 'shopbuilder' ), |
| 922 |
'default' => '', |
| 923 |
'classes' => $widget->pro_class(), |
| 924 |
'separator' => rtsb()->has_pro() ? 'before-short' : 'default', |
| 925 |
'condition' => [ |
| 926 |
'cart_table_items' => 'subtotal', |
| 927 |
], |
| 928 |
], |
| 929 |
'wishlist_button_text' => [ |
| 930 |
'label' => esc_html__( 'Wishlist Button Text', 'shopbuilder' ), |
| 931 |
'type' => 'text', |
| 932 |
'default' => __( 'Save for Later', 'shopbuilder' ), |
| 933 |
'classes' => $widget->pro_class(), |
| 934 |
'separator' => rtsb()->has_pro() ? 'before-short' : 'default', |
| 935 |
'label_block' => true, |
| 936 |
'condition' => [ |
| 937 |
'show_wishlist_button' => 'yes', |
| 938 |
], |
| 939 |
], |
| 940 |
'cart_table_cell_width' => [ |
| 941 |
'mode' => 'responsive', |
| 942 |
'label' => esc_html__( 'Column Width', 'shopbuilder' ), |
| 943 |
'type' => 'slider', |
| 944 |
'size_units' => [ 'px', '%' ], |
| 945 |
'range' => [ |
| 946 |
'px' => [ |
| 947 |
'min' => 0, |
| 948 |
'max' => 1000, |
| 949 |
'step' => 5, |
| 950 |
], |
| 951 |
'%' => [ |
| 952 |
'min' => 0, |
| 953 |
'max' => 100, |
| 954 |
], |
| 955 |
], |
| 956 |
'selectors' => [ |
| 957 |
self::$selectors['cart_table_cell_width']['th'] . '{{CURRENT_ITEM}}' => 'width: {{SIZE}}{{UNIT}};', |
| 958 |
self::$selectors['cart_table_cell_width']['td'] . '{{CURRENT_ITEM}}' => 'width: {{SIZE}}{{UNIT}};', |
| 959 |
], |
| 960 |
], |
| 961 |
], |
| 962 |
'default' => [ |
| 963 |
[ |
| 964 |
'cart_table_items' => 'remove', |
| 965 |
'cart_table_heading_title' => esc_html__( 'Remove', 'shopbuilder' ), |
| 966 |
], |
| 967 |
[ |
| 968 |
'cart_table_items' => 'thumbnail', |
| 969 |
'cart_table_heading_title' => esc_html__( 'Thumbnail', 'shopbuilder' ), |
| 970 |
], |
| 971 |
[ |
| 972 |
'cart_table_items' => 'name', |
| 973 |
'cart_table_heading_title' => esc_html__( 'Product Title', 'shopbuilder' ), |
| 974 |
], |
| 975 |
[ |
| 976 |
'cart_table_items' => 'price', |
| 977 |
'cart_table_heading_title' => esc_html__( 'Price', 'shopbuilder' ), |
| 978 |
], |
| 979 |
[ |
| 980 |
'cart_table_items' => 'quantity', |
| 981 |
'cart_table_heading_title' => esc_html__( 'Quantity', 'shopbuilder' ), |
| 982 |
], |
| 983 |
[ |
| 984 |
'cart_table_items' => 'subtotal', |
| 985 |
'cart_table_heading_title' => esc_html__( 'Total', 'shopbuilder' ), |
| 986 |
], |
| 987 |
], |
| 988 |
'title_field' => '{{{ cart_table_heading_title }}}', |
| 989 |
], |
| 990 |
|
| 991 |
'general_section_end' => [ |
| 992 |
'mode' => 'section_end', |
| 993 |
], |
| 994 |
]; |
| 995 |
|
| 996 |
return $fields; |
| 997 |
} |
| 998 |
|
| 999 |
/** |
| 1000 |
* Widget Field |
| 1001 |
* |
| 1002 |
* @return array |
| 1003 |
*/ |
| 1004 |
public static function action_control() { |
| 1005 |
$fields = [ |
| 1006 |
'action_control_section' => [ |
| 1007 |
'mode' => 'section_start', |
| 1008 |
'label' => esc_html__( 'Button Text ', 'shopbuilder' ), |
| 1009 |
], |
| 1010 |
'cart_table_update_button_heading' => [ |
| 1011 |
'type' => 'html', |
| 1012 |
'raw' => sprintf( |
| 1013 |
'<h3 class="rtsb-elementor-group-heading">%s</h3>', |
| 1014 |
esc_html__( 'Button', 'shopbuilder' ) |
| 1015 |
), |
| 1016 |
'content_classes' => 'elementor-panel-heading-title', |
| 1017 |
'separator' => 'default', |
| 1018 |
], |
| 1019 |
'return_to_shop_text' => [ |
| 1020 |
'type' => 'text', |
| 1021 |
'label' => esc_html__( 'Return to Shop Button Label', 'shopbuilder' ), |
| 1022 |
'description' => esc_html__( 'Return to shop button text. Leave Empty For default.', 'shopbuilder' ), |
| 1023 |
'separator' => 'default', |
| 1024 |
'label_block' => true, |
| 1025 |
], |
| 1026 |
'cart_table_update_button_text' => [ |
| 1027 |
'label' => esc_html__( 'Update Cart Button Label', 'shopbuilder' ), |
| 1028 |
'type' => 'text', |
| 1029 |
'default' => esc_html__( 'Update Cart', 'shopbuilder' ), |
| 1030 |
'placeholder' => esc_html__( 'Update Cart', 'shopbuilder' ), |
| 1031 |
'label_block' => true, |
| 1032 |
], |
| 1033 |
'cart_table_clear_cart_button_text' => [ |
| 1034 |
'label' => esc_html__( 'Clear Cart Button Label', 'shopbuilder' ), |
| 1035 |
'type' => 'text', |
| 1036 |
'default' => esc_html__( 'Clear All', 'shopbuilder' ), |
| 1037 |
'placeholder' => esc_html__( 'Clear All', 'shopbuilder' ), |
| 1038 |
'label_block' => true, |
| 1039 |
'condition' => [ |
| 1040 |
'show_clear_cart_button' => 'yes', |
| 1041 |
], |
| 1042 |
], |
| 1043 |
'cart_table_coupon_form_heading' => [ |
| 1044 |
'type' => 'html', |
| 1045 |
'raw' => sprintf( |
| 1046 |
'<h3 class="rtsb-elementor-group-heading">%s</h3>', |
| 1047 |
esc_html__( 'Coupon Form', 'shopbuilder' ) |
| 1048 |
), |
| 1049 |
'content_classes' => 'elementor-panel-heading-title', |
| 1050 |
'separator' => 'before', |
| 1051 |
'condition' => [ |
| 1052 |
'show_coupon_field' => 'yes', |
| 1053 |
], |
| 1054 |
], |
| 1055 |
'cart_table_coupon_button_text' => [ |
| 1056 |
'label' => esc_html__( 'Button Label', 'shopbuilder' ), |
| 1057 |
'type' => 'text', |
| 1058 |
'separator' => 'default', |
| 1059 |
'default' => esc_html__( 'Apply Coupon', 'shopbuilder' ), |
| 1060 |
'placeholder' => esc_html__( 'Apply Coupon', 'shopbuilder' ), |
| 1061 |
'label_block' => true, |
| 1062 |
'condition' => [ |
| 1063 |
'show_coupon_field' => 'yes', |
| 1064 |
], |
| 1065 |
], |
| 1066 |
'cart_table_coupon_placeholder_text' => [ |
| 1067 |
'label' => esc_html__( 'Placeholder Text', 'shopbuilder' ), |
| 1068 |
'type' => 'text', |
| 1069 |
'default' => esc_html__( 'Coupon Code', 'shopbuilder' ), |
| 1070 |
'placeholder' => esc_html__( 'Coupon Code', 'shopbuilder' ), |
| 1071 |
'label_block' => true, |
| 1072 |
'condition' => [ |
| 1073 |
'show_coupon_field' => 'yes', |
| 1074 |
], |
| 1075 |
], |
| 1076 |
|
| 1077 |
'action_control_section_end' => [ |
| 1078 |
'mode' => 'section_end', |
| 1079 |
], |
| 1080 |
]; |
| 1081 |
|
| 1082 |
return $fields; |
| 1083 |
} |
| 1084 |
|
| 1085 |
/** |
| 1086 |
* Widget Field |
| 1087 |
* |
| 1088 |
* @return array |
| 1089 |
*/ |
| 1090 |
public static function notice_style() { |
| 1091 |
$fields = [ |
| 1092 |
'notice_section' => [ |
| 1093 |
'mode' => 'section_start', |
| 1094 |
'tab' => 'style', |
| 1095 |
'label' => esc_html__( 'Cart Empty Notice ', 'shopbuilder' ), |
| 1096 |
], |
| 1097 |
'notice_typography' => [ |
| 1098 |
'mode' => 'group', |
| 1099 |
'type' => 'typography', |
| 1100 |
'label' => esc_html__( 'Typography', 'shopbuilder' ), |
| 1101 |
'selector' => self::$selectors['notice_typography'], |
| 1102 |
], |
| 1103 |
'notice_padding' => [ |
| 1104 |
'label' => esc_html__( 'Padding (px)', 'shopbuilder' ), |
| 1105 |
'type' => 'dimensions', |
| 1106 |
'mode' => 'responsive', |
| 1107 |
'size_units' => [ 'px' ], |
| 1108 |
'selectors' => [ |
| 1109 |
self::$selectors['notice_padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;', |
| 1110 |
], |
| 1111 |
'separator' => 'before', |
| 1112 |
], |
| 1113 |
|
| 1114 |
// Tab For normal view. |
| 1115 |
'notice_bg_color' => [ |
| 1116 |
'label' => esc_html__( 'Background Color', 'shopbuilder' ), |
| 1117 |
'type' => 'color', |
| 1118 |
'separator' => 'default', |
| 1119 |
'selectors' => [ |
| 1120 |
self::$selectors['notice_bg_color'] => 'background-color: {{VALUE}};', |
| 1121 |
], |
| 1122 |
], |
| 1123 |
'notice_text_color' => [ |
| 1124 |
'label' => esc_html__( 'Color', 'shopbuilder' ), |
| 1125 |
'type' => 'color', |
| 1126 |
|
| 1127 |
'selectors' => [ |
| 1128 |
self::$selectors['notice_text_color'] => 'color: {{VALUE}};', |
| 1129 |
], |
| 1130 |
], |
| 1131 |
'notice_border_color' => [ |
| 1132 |
'label' => esc_html__( 'Border Color', 'shopbuilder' ), |
| 1133 |
'type' => 'color', |
| 1134 |
|
| 1135 |
'selectors' => [ |
| 1136 |
self::$selectors['notice_border_color'] => 'border-color: {{VALUE}};', |
| 1137 |
], |
| 1138 |
], |
| 1139 |
'icon_heading' => [ |
| 1140 |
'type' => 'html', |
| 1141 |
'raw' => sprintf( |
| 1142 |
'<h3 class="rtsb-elementor-group-heading">%s</h3>', |
| 1143 |
esc_html__( 'Icon', 'shopbuilder' ) |
| 1144 |
), |
| 1145 |
'content_classes' => 'elementor-panel-heading-title', |
| 1146 |
'separator' => 'default', |
| 1147 |
], |
| 1148 |
'notice_icon_size' => [ |
| 1149 |
'label' => esc_html__( 'Notice Icon Size', 'shopbuilder' ), |
| 1150 |
'type' => 'slider', |
| 1151 |
'mode' => 'responsive', |
| 1152 |
'range' => [ |
| 1153 |
'px' => [ |
| 1154 |
'min' => 0, |
| 1155 |
'max' => 100, |
| 1156 |
], |
| 1157 |
], |
| 1158 |
'selectors' => [ |
| 1159 |
self::$selectors['notice_icon_size'] => 'width: {{SIZE}}{{UNIT}};', |
| 1160 |
], |
| 1161 |
], |
| 1162 |
'icon_color' => [ |
| 1163 |
'label' => esc_html__( 'Icon Color', 'shopbuilder' ), |
| 1164 |
'type' => 'color', |
| 1165 |
'separator' => 'before', |
| 1166 |
'selectors' => [ |
| 1167 |
self::$selectors['icon_color'] => 'color: {{VALUE}};fill: currentColor;', |
| 1168 |
], |
| 1169 |
], |
| 1170 |
'icon_bg_color' => [ |
| 1171 |
'label' => esc_html__( 'Icon Background Color', 'shopbuilder' ), |
| 1172 |
'type' => 'color', |
| 1173 |
'selectors' => [ |
| 1174 |
self::$selectors['icon_bg_color'] => 'background-color: {{VALUE}};fill: currentColor;', |
| 1175 |
], |
| 1176 |
], |
| 1177 |
'icon_margin' => [ |
| 1178 |
'label' => esc_html__( 'Icon Margin (px)', 'shopbuilder' ), |
| 1179 |
'type' => 'dimensions', |
| 1180 |
'mode' => 'responsive', |
| 1181 |
'size_units' => [ 'px' ], |
| 1182 |
'selectors' => [ |
| 1183 |
self::$selectors['icon_margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1184 |
], |
| 1185 |
], |
| 1186 |
'notice_section_end' => [ |
| 1187 |
'mode' => 'section_end', |
| 1188 |
], |
| 1189 |
]; |
| 1190 |
|
| 1191 |
return $fields; |
| 1192 |
} |
| 1193 |
|
| 1194 |
/** |
| 1195 |
* Widget Field |
| 1196 |
* |
| 1197 |
* @return array |
| 1198 |
*/ |
| 1199 |
public static function input_style() { |
| 1200 |
$fields = [ |
| 1201 |
'input_section_start' => [ |
| 1202 |
'mode' => 'section_start', |
| 1203 |
'label' => esc_html__( 'Coupon Input Field', 'shopbuilder' ), |
| 1204 |
'tab' => 'style', |
| 1205 |
], |
| 1206 |
|
| 1207 |
'coupon_typography' => [ |
| 1208 |
'mode' => 'group', |
| 1209 |
'type' => 'typography', |
| 1210 |
'label' => esc_html__( 'Typography', 'shopbuilder' ), |
| 1211 |
'selector' => self::$selectors['coupon_typography'], |
| 1212 |
], |
| 1213 |
|
| 1214 |
'coupon_input_width' => [ |
| 1215 |
'label' => esc_html__( 'Coupon Width', 'shopbuilder' ), |
| 1216 |
'type' => 'slider', |
| 1217 |
'range' => [ |
| 1218 |
'px' => [ |
| 1219 |
'min' => 80, |
| 1220 |
'max' => 500, |
| 1221 |
], |
| 1222 |
], |
| 1223 |
'default' => [ |
| 1224 |
'unit' => 'px', |
| 1225 |
'size' => '180', |
| 1226 |
], |
| 1227 |
'selectors' => [ |
| 1228 |
self::$selectors['coupon_input_width'] => 'width: {{SIZE}}{{UNIT}} !important;', |
| 1229 |
], |
| 1230 |
], |
| 1231 |
'coupon_input_height' => [ |
| 1232 |
'label' => esc_html__( 'Coupon Height', 'shopbuilder' ), |
| 1233 |
'type' => 'slider', |
| 1234 |
'range' => [ |
| 1235 |
'px' => [ |
| 1236 |
'min' => 10, |
| 1237 |
'max' => 100, |
| 1238 |
], |
| 1239 |
], |
| 1240 |
'selectors' => [ |
| 1241 |
self::$selectors['coupon_input_height'] => 'height: {{SIZE}}{{UNIT}} !important; max-height: {{SIZE}}{{UNIT}} !important;', |
| 1242 |
], |
| 1243 |
], |
| 1244 |
'coupon_input_border' => [ |
| 1245 |
'mode' => 'group', |
| 1246 |
'type' => 'border', |
| 1247 |
'selector' => self::$selectors['coupon_input_border'], |
| 1248 |
'size_units' => [ 'px' ], |
| 1249 |
], |
| 1250 |
'coupon_border_radius' => [ |
| 1251 |
'label' => esc_html__( 'Border Radius (px)', 'shopbuilder' ), |
| 1252 |
'type' => 'dimensions', |
| 1253 |
'mode' => 'responsive', |
| 1254 |
'size_units' => [ 'px' ], |
| 1255 |
'separator' => 'before', |
| 1256 |
'selectors' => [ |
| 1257 |
self::$selectors['coupon_border_radius'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1258 |
], |
| 1259 |
], |
| 1260 |
'input_text_color' => [ |
| 1261 |
'label' => esc_html__( 'Text Color', 'shopbuilder' ), |
| 1262 |
'type' => 'color', |
| 1263 |
|
| 1264 |
'selectors' => [ |
| 1265 |
self::$selectors['input_text_color'] => 'color: {{VALUE}};', |
| 1266 |
], |
| 1267 |
], |
| 1268 |
'input_bg_color' => [ |
| 1269 |
'label' => esc_html__( 'Background Color', 'shopbuilder' ), |
| 1270 |
'type' => 'color', |
| 1271 |
'alpha' => true, |
| 1272 |
'selectors' => [ |
| 1273 |
self::$selectors['input_bg_color'] => 'background-color: {{VALUE}};', |
| 1274 |
], |
| 1275 |
], |
| 1276 |
'coupon_padding' => [ |
| 1277 |
'label' => esc_html__( 'Padding (px)', 'shopbuilder' ), |
| 1278 |
'type' => 'dimensions', |
| 1279 |
'mode' => 'responsive', |
| 1280 |
'size_units' => [ 'px' ], |
| 1281 |
'selectors' => [ |
| 1282 |
self::$selectors['coupon_padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;', |
| 1283 |
], |
| 1284 |
'separator' => 'before', |
| 1285 |
], |
| 1286 |
'coupon_style_section_end' => [ |
| 1287 |
'mode' => 'section_end', |
| 1288 |
], |
| 1289 |
]; |
| 1290 |
|
| 1291 |
return $fields; |
| 1292 |
} |
| 1293 |
|
| 1294 |
/** |
| 1295 |
* Widget Field |
| 1296 |
* |
| 1297 |
* @return array |
| 1298 |
*/ |
| 1299 |
public static function return_shop_button_style() { |
| 1300 |
$alignment = ControlHelper::alignment(); |
| 1301 |
unset( $alignment['justify'] ); |
| 1302 |
$fields = [ |
| 1303 |
'return_shop_button_section_start' => [ |
| 1304 |
'mode' => 'section_start', |
| 1305 |
'label' => esc_html__( 'Return Shop Button', 'shopbuilder' ), |
| 1306 |
'tab' => 'style', |
| 1307 |
], |
| 1308 |
'return_shop_button_typography' => [ |
| 1309 |
'mode' => 'group', |
| 1310 |
'type' => 'typography', |
| 1311 |
'label' => esc_html__( 'Typography', 'shopbuilder' ), |
| 1312 |
'selector' => self::$selectors['return_shop_button_typography'], |
| 1313 |
], |
| 1314 |
'return_shop_button_height' => [ |
| 1315 |
'label' => esc_html__( 'Button Height', 'shopbuilder' ), |
| 1316 |
'type' => 'slider', |
| 1317 |
'range' => [ |
| 1318 |
'px' => [ |
| 1319 |
'min' => 10, |
| 1320 |
'max' => 100, |
| 1321 |
], |
| 1322 |
], |
| 1323 |
'selectors' => [ |
| 1324 |
self::$selectors['return_shop_button_height'] => 'height: {{SIZE}}{{UNIT}};', |
| 1325 |
], |
| 1326 |
], |
| 1327 |
'return_shop_button_tabs_start' => [ |
| 1328 |
'mode' => 'tabs_start', |
| 1329 |
], |
| 1330 |
// Tab For normal view. |
| 1331 |
'return_shop_button_normal' => [ |
| 1332 |
'mode' => 'tab_start', |
| 1333 |
'label' => esc_html__( 'Normal', 'shopbuilder' ), |
| 1334 |
], |
| 1335 |
'return_shop_button_text_color_normal' => [ |
| 1336 |
'label' => esc_html__( 'Color', 'shopbuilder' ), |
| 1337 |
'type' => 'color', |
| 1338 |
|
| 1339 |
'separator' => 'default', |
| 1340 |
'selectors' => [ |
| 1341 |
self::$selectors['return_shop_button_text_color_normal'] => 'color: {{VALUE}};', |
| 1342 |
], |
| 1343 |
], |
| 1344 |
'return_shop_button_bg_color_normal' => [ |
| 1345 |
'label' => esc_html__( 'Background Color', 'shopbuilder' ), |
| 1346 |
'type' => 'color', |
| 1347 |
'selectors' => [ |
| 1348 |
self::$selectors['return_shop_button_bg_color_normal'] => 'background-color: {{VALUE}};', |
| 1349 |
], |
| 1350 |
], |
| 1351 |
|
| 1352 |
'return_shop_button_border' => [ |
| 1353 |
'mode' => 'group', |
| 1354 |
'type' => 'border', |
| 1355 |
'selector' => self::$selectors['return_shop_button_border'], |
| 1356 |
'size_units' => [ 'px' ], |
| 1357 |
], |
| 1358 |
'return_shop_button_normal_end' => [ |
| 1359 |
'mode' => 'tab_end', |
| 1360 |
], |
| 1361 |
'return_shop_button_hover' => [ |
| 1362 |
'mode' => 'tab_start', |
| 1363 |
'label' => esc_html__( 'Hover', 'shopbuilder' ), |
| 1364 |
], |
| 1365 |
'return_shop_button_text_color_hover' => [ |
| 1366 |
'label' => esc_html__( 'Color', 'shopbuilder' ), |
| 1367 |
'type' => 'color', |
| 1368 |
|
| 1369 |
'separator' => 'default', |
| 1370 |
'selectors' => [ |
| 1371 |
self::$selectors['return_shop_button_text_color_hover'] => 'color: {{VALUE}};', |
| 1372 |
], |
| 1373 |
], |
| 1374 |
'return_shop_button_bg_color_hover' => [ |
| 1375 |
'label' => esc_html__( 'Background Color', 'shopbuilder' ), |
| 1376 |
'type' => 'color', |
| 1377 |
'selectors' => [ |
| 1378 |
self::$selectors['return_shop_button_bg_color_hover'] => 'background-color: {{VALUE}};', |
| 1379 |
], |
| 1380 |
], |
| 1381 |
'return_shop_button_border_hover_color' => [ |
| 1382 |
'label' => esc_html__( 'Border Color', 'shopbuilder' ), |
| 1383 |
'type' => 'color', |
| 1384 |
|
| 1385 |
'selectors' => [ |
| 1386 |
self::$selectors['return_shop_button_border_hover_color'] => 'border-color: {{VALUE}};', |
| 1387 |
], |
| 1388 |
], |
| 1389 |
'return_shop_button_hover_end' => [ |
| 1390 |
'mode' => 'tab_end', |
| 1391 |
], |
| 1392 |
'return_shop_button_tabs_end' => [ |
| 1393 |
'mode' => 'tabs_end', |
| 1394 |
], |
| 1395 |
'return_shop_button_border_radius' => [ |
| 1396 |
'label' => esc_html__( 'Border Radius (px)', 'shopbuilder' ), |
| 1397 |
'type' => 'dimensions', |
| 1398 |
'mode' => 'responsive', |
| 1399 |
'size_units' => [ 'px' ], |
| 1400 |
'separator' => 'before', |
| 1401 |
'selectors' => [ |
| 1402 |
self::$selectors['return_shop_button_border_radius'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1403 |
], |
| 1404 |
], |
| 1405 |
'return_shop_button_padding' => [ |
| 1406 |
'label' => esc_html__( 'Padding (px)', 'shopbuilder' ), |
| 1407 |
'type' => 'dimensions', |
| 1408 |
'mode' => 'responsive', |
| 1409 |
'size_units' => [ 'px' ], |
| 1410 |
'selectors' => [ |
| 1411 |
self::$selectors['return_shop_button_padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1412 |
], |
| 1413 |
'separator' => 'before', |
| 1414 |
], |
| 1415 |
'return_shop_button_margin' => [ |
| 1416 |
'label' => esc_html__( 'Margin (px)', 'shopbuilder' ), |
| 1417 |
'type' => 'dimensions', |
| 1418 |
'mode' => 'responsive', |
| 1419 |
'size_units' => [ 'px' ], |
| 1420 |
'selectors' => [ |
| 1421 |
self::$selectors['return_shop_button_margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1422 |
], |
| 1423 |
], |
| 1424 |
'return_shop_button_section_end' => [ |
| 1425 |
'mode' => 'section_end', |
| 1426 |
], |
| 1427 |
]; |
| 1428 |
|
| 1429 |
return $fields; |
| 1430 |
} |
| 1431 |
} |
| 1432 |
|