| 1 |
<?php |
| 2 |
|
| 3 |
namespace UltimateStoreKit\Modules\PageCart\Widgets; |
| 4 |
|
| 5 |
use UltimateStoreKit\Base\Module_Base; |
| 6 |
use Elementor\Controls_Manager; |
| 7 |
use Elementor\Group_Control_Border; |
| 8 |
use Elementor\Group_Control_Typography; |
| 9 |
use Elementor\Group_Control_Background; |
| 10 |
|
| 11 |
if ( ! defined( 'ABSPATH' ) ) |
| 12 |
exit; // Exit if accessed directly |
| 13 |
|
| 14 |
class Page_Cart extends Module_Base { |
| 15 |
|
| 16 |
public const WIDGET_NAME = 'usk-page-cart'; |
| 17 |
|
| 18 |
public function get_name() { |
| 19 |
return self::WIDGET_NAME; |
| 20 |
} |
| 21 |
|
| 22 |
/** |
| 23 |
* Default widget settings for editor and cart-page fallback render. |
| 24 |
*/ |
| 25 |
public static function get_default_settings() { |
| 26 |
return [ |
| 27 |
'show_image' => 'yes', |
| 28 |
'show_title' => 'yes', |
| 29 |
'show_price' => 'yes', |
| 30 |
'show_quantity' => 'yes', |
| 31 |
'show_subtotal' => 'yes', |
| 32 |
]; |
| 33 |
} |
| 34 |
|
| 35 |
public static function get_frontend_style_handles() { |
| 36 |
return [ 'usk-font', 'usk-page-cart' ]; |
| 37 |
} |
| 38 |
|
| 39 |
public function get_title() { |
| 40 |
return BDTUSK . esc_html__( 'Cart Page', 'ultimate-store-kit' ); |
| 41 |
} |
| 42 |
|
| 43 |
public function get_icon() { |
| 44 |
return 'usk-widget-icon usk-icon-page-cart usk-new'; |
| 45 |
} |
| 46 |
|
| 47 |
public function get_categories() { |
| 48 |
return [ 'ultimate-store-kit' ]; |
| 49 |
} |
| 50 |
|
| 51 |
// public function show_in_panel() { |
| 52 |
// return get_post_type() !== 'page'; |
| 53 |
// } |
| 54 |
|
| 55 |
public function get_style_depends() { |
| 56 |
if ( $this->usk_is_edit_mode() ) { |
| 57 |
return [ 'usk-all-styles' ]; |
| 58 |
} |
| 59 |
|
| 60 |
return self::get_frontend_style_handles(); |
| 61 |
} |
| 62 |
public function get_keywords() { |
| 63 |
return [ 'page', 'cart' ]; |
| 64 |
} |
| 65 |
|
| 66 |
public function has_widget_inner_wrapper(): bool { |
| 67 |
return ! \Elementor\Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' ); |
| 68 |
} |
| 69 |
|
| 70 |
protected function is_dynamic_content(): bool { |
| 71 |
return true; |
| 72 |
} |
| 73 |
|
| 74 |
protected function count_visible_columns( array $settings ) { |
| 75 |
$count = 1; |
| 76 |
|
| 77 |
foreach ( array_keys( self::get_default_settings() ) as $setting_key ) { |
| 78 |
if ( ! empty( $settings[ $setting_key ] ) && 'yes' === $settings[ $setting_key ] ) { |
| 79 |
++$count; |
| 80 |
} |
| 81 |
} |
| 82 |
|
| 83 |
return $count; |
| 84 |
} |
| 85 |
|
| 86 |
protected function is_column_visible( array $settings, $key ) { |
| 87 |
return ! empty( $settings[ $key ] ) && 'yes' === $settings[ $key ]; |
| 88 |
} |
| 89 |
|
| 90 |
protected function register_controls() { |
| 91 |
|
| 92 |
$this->start_controls_section( |
| 93 |
'section_cart_layout', |
| 94 |
[ |
| 95 |
'label' => __( 'Cart Layout', 'ultimate-store-kit' ), |
| 96 |
'tab' => Controls_Manager::TAB_CONTENT, |
| 97 |
] |
| 98 |
); |
| 99 |
|
| 100 |
$this->add_control( |
| 101 |
'show_image', |
| 102 |
[ |
| 103 |
'label' => __( 'Show Image', 'ultimate-store-kit' ), |
| 104 |
'type' => Controls_Manager::SWITCHER, |
| 105 |
'default' => 'yes', |
| 106 |
] |
| 107 |
); |
| 108 |
|
| 109 |
$this->add_control( |
| 110 |
'show_title', |
| 111 |
[ |
| 112 |
'label' => __( 'Show Title', 'ultimate-store-kit' ), |
| 113 |
'type' => Controls_Manager::SWITCHER, |
| 114 |
'default' => 'yes', |
| 115 |
] |
| 116 |
); |
| 117 |
|
| 118 |
$this->add_control( |
| 119 |
'show_price', |
| 120 |
[ |
| 121 |
'label' => __( 'Show Price', 'ultimate-store-kit' ), |
| 122 |
'type' => Controls_Manager::SWITCHER, |
| 123 |
'default' => 'yes', |
| 124 |
] |
| 125 |
); |
| 126 |
|
| 127 |
$this->add_control( |
| 128 |
'show_quantity', |
| 129 |
[ |
| 130 |
'label' => __( 'Show Quantity', 'ultimate-store-kit' ), |
| 131 |
'type' => Controls_Manager::SWITCHER, |
| 132 |
'default' => 'yes', |
| 133 |
] |
| 134 |
); |
| 135 |
|
| 136 |
$this->add_control( |
| 137 |
'show_subtotal', |
| 138 |
[ |
| 139 |
'label' => __( 'Show Subtotal', 'ultimate-store-kit' ), |
| 140 |
'type' => Controls_Manager::SWITCHER, |
| 141 |
'default' => 'yes', |
| 142 |
] |
| 143 |
); |
| 144 |
|
| 145 |
$this->end_controls_section(); |
| 146 |
|
| 147 |
$this->start_controls_section( |
| 148 |
'cart_heading_style_section', |
| 149 |
[ |
| 150 |
'label' => __( 'Cart Heading', 'ultimate-store-kit' ), |
| 151 |
'tab' => Controls_Manager::TAB_STYLE, |
| 152 |
] |
| 153 |
); |
| 154 |
|
| 155 |
$this->add_responsive_control( |
| 156 |
'cart_heading_align', |
| 157 |
[ |
| 158 |
'label' => __( 'Alignment', 'ultimate-store-kit' ), |
| 159 |
'type' => Controls_Manager::CHOOSE, |
| 160 |
'options' => [ |
| 161 |
'left' => [ |
| 162 |
'title' => __( 'Left', 'ultimate-store-kit' ), |
| 163 |
'icon' => 'eicon-text-align-left', |
| 164 |
], |
| 165 |
'center' => [ |
| 166 |
'title' => __( 'Center', 'ultimate-store-kit' ), |
| 167 |
'icon' => 'eicon-text-align-center', |
| 168 |
], |
| 169 |
'right' => [ |
| 170 |
'title' => __( 'Right', 'ultimate-store-kit' ), |
| 171 |
'icon' => 'eicon-text-align-right', |
| 172 |
], |
| 173 |
], |
| 174 |
'toggle' => true, |
| 175 |
'selectors' => [ |
| 176 |
'{{WRAPPER}} .usk-page-cart .woocommerce thead th' => 'text-align: {{VALUE}};', |
| 177 |
], |
| 178 |
] |
| 179 |
); |
| 180 |
|
| 181 |
$this->add_control( |
| 182 |
'cart_heading_color', |
| 183 |
[ |
| 184 |
'label' => __( 'Color', 'ultimate-store-kit' ), |
| 185 |
'type' => Controls_Manager::COLOR, |
| 186 |
'selectors' => [ |
| 187 |
'{{WRAPPER}} .usk-page-cart .woocommerce thead th' => 'color: {{VALUE}};', |
| 188 |
], |
| 189 |
] |
| 190 |
); |
| 191 |
|
| 192 |
$this->add_group_control( |
| 193 |
Group_Control_Background::get_type(), |
| 194 |
[ |
| 195 |
'name' => 'cart_heading_background', |
| 196 |
'label' => esc_html__( 'Background', 'ultimate-store-kit' ), |
| 197 |
'types' => [ 'classic', 'gradient' ], |
| 198 |
'selector' => '{{WRAPPER}} .usk-page-cart .woocommerce-cart-form .shop_table th', |
| 199 |
'exclude' => [ |
| 200 |
'image' |
| 201 |
] |
| 202 |
] |
| 203 |
); |
| 204 |
|
| 205 |
$this->add_group_control( |
| 206 |
Group_Control_Border::get_type(), |
| 207 |
[ |
| 208 |
'name' => 'cart_heading_border', |
| 209 |
'label' => esc_html__( 'Border', 'ultimate-store-kit' ), |
| 210 |
'selector' => '{{WRAPPER}} .usk-page-cart .woocommerce-cart-form .shop_table th', |
| 211 |
'separator' => 'before', |
| 212 |
] |
| 213 |
); |
| 214 |
|
| 215 |
$this->add_responsive_control( |
| 216 |
'cart_heading_padding', |
| 217 |
[ |
| 218 |
'label' => esc_html__( 'Padding', 'ultimate-store-kit' ), |
| 219 |
'type' => Controls_Manager::DIMENSIONS, |
| 220 |
'size_units' => [ 'px', '%', 'em' ], |
| 221 |
'selectors' => [ |
| 222 |
'{{WRAPPER}} .usk-page-cart .woocommerce-cart-form .shop_table th' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 223 |
], |
| 224 |
] |
| 225 |
); |
| 226 |
|
| 227 |
$this->add_group_control( |
| 228 |
Group_Control_Typography::get_type(), |
| 229 |
[ |
| 230 |
'name' => 'cart_heading_typo', |
| 231 |
'selector' => '{{WRAPPER}} .usk-page-cart .woocommerce thead th', |
| 232 |
] |
| 233 |
); |
| 234 |
|
| 235 |
$this->end_controls_section(); |
| 236 |
|
| 237 |
$this->start_controls_section( |
| 238 |
'product_item_style_section', |
| 239 |
[ |
| 240 |
'label' => __( 'Cart Item', 'ultimate-store-kit' ), |
| 241 |
'tab' => Controls_Manager::TAB_STYLE, |
| 242 |
] |
| 243 |
); |
| 244 |
|
| 245 |
$this->add_group_control( |
| 246 |
Group_Control_Border::get_type(), |
| 247 |
[ |
| 248 |
'name' => 'product_item_border', |
| 249 |
'selector' => '{{WRAPPER}} .usk-page-cart .woocommerce-cart-form .shop_table td', |
| 250 |
] |
| 251 |
); |
| 252 |
$this->add_responsive_control( |
| 253 |
'product_item_padding', |
| 254 |
[ |
| 255 |
'label' => esc_html__( 'Cell Padding', 'ultimate-store-kit' ), |
| 256 |
'type' => Controls_Manager::DIMENSIONS, |
| 257 |
'size_units' => [ 'px', '%', 'em' ], |
| 258 |
'selectors' => [ |
| 259 |
'{{WRAPPER}} .usk-page-cart .woocommerce-cart-form .shop_table td' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 260 |
], |
| 261 |
] |
| 262 |
); |
| 263 |
$this->add_control( |
| 264 |
'product_item_even_bg_color', |
| 265 |
[ |
| 266 |
'label' => esc_html__( 'Even Row Background Color', 'ultimate-store-kit' ), |
| 267 |
'type' => Controls_Manager::COLOR, |
| 268 |
'selectors' => [ |
| 269 |
'{{WRAPPER}} .usk-page-cart .woocommerce-cart-form .shop_table_responsive tr:nth-child(2n) td' => 'background-color: {{VALUE}};', |
| 270 |
], |
| 271 |
] |
| 272 |
); |
| 273 |
$this->add_control( |
| 274 |
'product_item_odd_bg_color', |
| 275 |
[ |
| 276 |
'label' => esc_html__( 'Odd Row Background Color', 'ultimate-store-kit' ), |
| 277 |
'type' => Controls_Manager::COLOR, |
| 278 |
'selectors' => [ |
| 279 |
'{{WRAPPER}} .usk-page-cart .woocommerce-cart-form .shop_table tr:nth-child(odd)' => 'background-color: {{VALUE}};', |
| 280 |
], |
| 281 |
] |
| 282 |
); |
| 283 |
|
| 284 |
$this->add_responsive_control( |
| 285 |
'product_item_align', |
| 286 |
[ |
| 287 |
'label' => __( 'Alignment', 'ultimate-store-kit' ), |
| 288 |
'type' => Controls_Manager::CHOOSE, |
| 289 |
'options' => [ |
| 290 |
'left' => [ |
| 291 |
'title' => __( 'Left', 'ultimate-store-kit' ), |
| 292 |
'icon' => 'eicon-text-align-left', |
| 293 |
], |
| 294 |
'center' => [ |
| 295 |
'title' => __( 'Center', 'ultimate-store-kit' ), |
| 296 |
'icon' => 'eicon-text-align-center', |
| 297 |
], |
| 298 |
'right' => [ |
| 299 |
'title' => __( 'Right', 'ultimate-store-kit' ), |
| 300 |
'icon' => 'eicon-text-align-right', |
| 301 |
], |
| 302 |
], |
| 303 |
'toggle' => true, |
| 304 |
'selectors' => [ |
| 305 |
'{{WRAPPER}} .usk-page-cart .woocommerce-cart-form .shop_table td' => 'text-align: {{VALUE}};', |
| 306 |
// '{{WRAPPER}} .usk-page-cart .woocommerce-cart-form .shop_table .quantity' => 'justify-content: {{VALUE}};', |
| 307 |
], |
| 308 |
] |
| 309 |
); |
| 310 |
|
| 311 |
$this->add_control( |
| 312 |
'product_image_heading', |
| 313 |
[ |
| 314 |
'label' => esc_html__( 'Product Image', 'ultimate-store-kit' ) . BDTUSK_NC, |
| 315 |
'type' => Controls_Manager::HEADING, |
| 316 |
'condition' => [ |
| 317 |
'show_image' => 'yes', |
| 318 |
], |
| 319 |
'separator' => 'before' |
| 320 |
] |
| 321 |
); |
| 322 |
|
| 323 |
$this->add_responsive_control( |
| 324 |
'product_image_size', |
| 325 |
[ |
| 326 |
'label' => __( 'Image Size', 'ultimate-store-kit' ), |
| 327 |
'type' => Controls_Manager::SLIDER, |
| 328 |
'size_units' => [ 'px', '%' ], |
| 329 |
'range' => [ |
| 330 |
'px' => [ |
| 331 |
'min' => 50, |
| 332 |
'max' => 200, |
| 333 |
], |
| 334 |
'%' => [ |
| 335 |
'min' => 10, |
| 336 |
'max' => 100, |
| 337 |
], |
| 338 |
], |
| 339 |
'selectors' => [ |
| 340 |
'{{WRAPPER}} .usk-page-cart .woocommerce-cart-form .shop_table .usk-product-image a img' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};', |
| 341 |
], |
| 342 |
'condition' => [ |
| 343 |
'show_image' => 'yes', |
| 344 |
] |
| 345 |
] |
| 346 |
); |
| 347 |
|
| 348 |
$this->add_group_control( |
| 349 |
Group_Control_Border::get_type(), |
| 350 |
[ |
| 351 |
'name' => 'product_image_border', |
| 352 |
'label' => esc_html__( 'Border', 'ultimate-store-kit' ), |
| 353 |
'selector' => '{{WRAPPER}} .usk-page-cart .woocommerce-cart-form .shop_table .usk-product-image a img', |
| 354 |
'condition' => [ |
| 355 |
'show_image' => 'yes', |
| 356 |
] |
| 357 |
] |
| 358 |
); |
| 359 |
|
| 360 |
$this->add_responsive_control( |
| 361 |
'product_image_border_radius', |
| 362 |
[ |
| 363 |
'label' => __( 'Border Radius', 'ultimate-store-kit' ), |
| 364 |
'type' => Controls_Manager::DIMENSIONS, |
| 365 |
'size_units' => [ 'px', '%' ], |
| 366 |
'selectors' => [ |
| 367 |
'{{WRAPPER}} .usk-page-cart .woocommerce-cart-form .shop_table .usk-product-image a img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 368 |
], |
| 369 |
'condition' => [ |
| 370 |
'show_image' => 'yes', |
| 371 |
] |
| 372 |
] |
| 373 |
); |
| 374 |
|
| 375 |
$this->add_control( |
| 376 |
'product_title_heading', |
| 377 |
[ |
| 378 |
'label' => esc_html__( 'Product Title', 'ultimate-store-kit' ), |
| 379 |
'type' => Controls_Manager::HEADING, |
| 380 |
'condition' => [ |
| 381 |
'show_title' => 'yes', |
| 382 |
], |
| 383 |
'separator' => 'before' |
| 384 |
] |
| 385 |
); |
| 386 |
|
| 387 |
$this->add_control( |
| 388 |
'product_title_color', |
| 389 |
[ |
| 390 |
'label' => __( 'Color', 'ultimate-store-kit' ), |
| 391 |
'type' => Controls_Manager::COLOR, |
| 392 |
'selectors' => [ |
| 393 |
'{{WRAPPER}} .usk-page-cart .woocommerce tbody .usk-product-title a' => 'color: {{VALUE}};', |
| 394 |
], |
| 395 |
'condition' => [ |
| 396 |
'show_title' => 'yes', |
| 397 |
] |
| 398 |
] |
| 399 |
); |
| 400 |
|
| 401 |
$this->add_control( |
| 402 |
'product_title_hover_color', |
| 403 |
[ |
| 404 |
'label' => __( 'Hover Color', 'ultimate-store-kit' ), |
| 405 |
'type' => Controls_Manager::COLOR, |
| 406 |
'selectors' => [ |
| 407 |
'{{WRAPPER}} .usk-page-cart .woocommerce tbody .usk-product-title a:hover' => 'color: {{VALUE}};', |
| 408 |
], |
| 409 |
'condition' => [ |
| 410 |
'show_title' => 'yes', |
| 411 |
] |
| 412 |
] |
| 413 |
); |
| 414 |
|
| 415 |
$this->add_group_control( |
| 416 |
Group_Control_Typography::get_type(), |
| 417 |
[ |
| 418 |
'name' => 'product_title_typo', |
| 419 |
'selector' => '{{WRAPPER}} .usk-page-cart .woocommerce tbody .usk-product-title a', |
| 420 |
'condition' => [ |
| 421 |
'show_title' => 'yes', |
| 422 |
] |
| 423 |
] |
| 424 |
); |
| 425 |
|
| 426 |
$this->add_control( |
| 427 |
'product_price_heading', |
| 428 |
[ |
| 429 |
'label' => esc_html__( 'Product Price', 'ultimate-store-kit' ), |
| 430 |
'type' => Controls_Manager::HEADING, |
| 431 |
'condition' => [ |
| 432 |
'show_price' => 'yes', |
| 433 |
], |
| 434 |
'separator' => 'before' |
| 435 |
] |
| 436 |
); |
| 437 |
|
| 438 |
$this->add_control( |
| 439 |
'product_price_color', |
| 440 |
[ |
| 441 |
'label' => __( 'Color', 'ultimate-store-kit' ), |
| 442 |
'type' => Controls_Manager::COLOR, |
| 443 |
'selectors' => [ |
| 444 |
'{{WRAPPER}} .usk-page-cart .woocommerce tbody .usk-product-price' => 'color: {{VALUE}};', |
| 445 |
], |
| 446 |
'condition' => [ |
| 447 |
'show_price' => 'yes', |
| 448 |
] |
| 449 |
] |
| 450 |
); |
| 451 |
|
| 452 |
$this->add_group_control( |
| 453 |
Group_Control_Typography::get_type(), |
| 454 |
[ |
| 455 |
'name' => 'product_price_typo', |
| 456 |
'selector' => '{{WRAPPER}} .usk-page-cart .woocommerce tbody .usk-product-price', |
| 457 |
'condition' => [ |
| 458 |
'show_price' => 'yes', |
| 459 |
] |
| 460 |
] |
| 461 |
); |
| 462 |
|
| 463 |
$this->add_control( |
| 464 |
'product_quantity_heading', |
| 465 |
[ |
| 466 |
'label' => esc_html__( 'Product Quantity', 'ultimate-store-kit' ), |
| 467 |
'type' => Controls_Manager::HEADING, |
| 468 |
'condition' => [ |
| 469 |
'show_quantity' => 'yes', |
| 470 |
], |
| 471 |
'separator' => 'before' |
| 472 |
] |
| 473 |
); |
| 474 |
|
| 475 |
$this->add_responsive_control( |
| 476 |
'product_quantity_width', |
| 477 |
[ |
| 478 |
'label' => __( 'Width', 'ultimate-store-kit' ), |
| 479 |
'type' => Controls_Manager::SLIDER, |
| 480 |
'range' => [ |
| 481 |
'px' => [ |
| 482 |
'min' => 50, |
| 483 |
'max' => 200, |
| 484 |
], |
| 485 |
], |
| 486 |
'selectors' => [ |
| 487 |
'{{WRAPPER}} .usk-page-cart .usk-product-quantity .input-text.qty' => 'width: {{SIZE}}{{UNIT}};', |
| 488 |
], |
| 489 |
'condition' => [ |
| 490 |
'show_quantity' => 'yes', |
| 491 |
] |
| 492 |
] |
| 493 |
); |
| 494 |
|
| 495 |
$this->add_control( |
| 496 |
'product_quantity_color', |
| 497 |
[ |
| 498 |
'label' => __( 'Color', 'ultimate-store-kit' ), |
| 499 |
'type' => Controls_Manager::COLOR, |
| 500 |
'selectors' => [ |
| 501 |
'{{WRAPPER}} .usk-page-cart .usk-product-quantity .input-text.qty' => 'color: {{VALUE}};', |
| 502 |
], |
| 503 |
'condition' => [ |
| 504 |
'show_quantity' => 'yes', |
| 505 |
] |
| 506 |
] |
| 507 |
); |
| 508 |
|
| 509 |
$this->add_responsive_control( |
| 510 |
'product_quantity_align', |
| 511 |
[ |
| 512 |
'label' => __( 'Alignment', 'ultimate-store-kit' ), |
| 513 |
'type' => Controls_Manager::CHOOSE, |
| 514 |
'options' => [ |
| 515 |
'left' => [ |
| 516 |
'title' => __( 'Left', 'ultimate-store-kit' ), |
| 517 |
'icon' => 'eicon-text-align-left', |
| 518 |
], |
| 519 |
'center' => [ |
| 520 |
'title' => __( 'Center', 'ultimate-store-kit' ), |
| 521 |
'icon' => 'eicon-text-align-center', |
| 522 |
], |
| 523 |
'right' => [ |
| 524 |
'title' => __( 'Right', 'ultimate-store-kit' ), |
| 525 |
'icon' => 'eicon-text-align-right', |
| 526 |
], |
| 527 |
], |
| 528 |
'toggle' => true, |
| 529 |
'selectors' => [ |
| 530 |
'{{WRAPPER}} .usk-page-cart .usk-product-quantity .input-text.qty' => 'text-align: {{VALUE}};', |
| 531 |
], |
| 532 |
'condition' => [ |
| 533 |
'show_quantity' => 'yes', |
| 534 |
] |
| 535 |
] |
| 536 |
); |
| 537 |
|
| 538 |
$this->add_group_control( |
| 539 |
Group_Control_Typography::get_type(), |
| 540 |
[ |
| 541 |
'name' => 'product_quantity_typo', |
| 542 |
'selector' => '{{WRAPPER}} .usk-page-cart .usk-product-quantity .input-text.qty', |
| 543 |
'condition' => [ |
| 544 |
'show_quantity' => 'yes', |
| 545 |
] |
| 546 |
] |
| 547 |
); |
| 548 |
|
| 549 |
$this->add_responsive_control( |
| 550 |
'product_quantity_padding', |
| 551 |
[ |
| 552 |
'label' => __( 'Padding', 'ultimate-store-kit' ), |
| 553 |
'type' => Controls_Manager::DIMENSIONS, |
| 554 |
'size_units' => [ 'px', 'em', '%' ], |
| 555 |
'selectors' => [ |
| 556 |
'{{WRAPPER}} .usk-page-cart .usk-product-quantity .input-text.qty' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 557 |
], |
| 558 |
'condition' => [ |
| 559 |
'show_quantity' => 'yes', |
| 560 |
] |
| 561 |
] |
| 562 |
); |
| 563 |
|
| 564 |
$this->add_group_control( |
| 565 |
Group_Control_Border::get_type(), |
| 566 |
[ |
| 567 |
'name' => 'product_quantity_border', |
| 568 |
'selector' => '{{WRAPPER}} .usk-page-cart .usk-product-quantity .input-text.qty', |
| 569 |
'condition' => [ |
| 570 |
'show_quantity' => 'yes', |
| 571 |
] |
| 572 |
] |
| 573 |
); |
| 574 |
|
| 575 |
$this->add_responsive_control( |
| 576 |
'product_quantity_border_radius', |
| 577 |
[ |
| 578 |
'label' => __( 'Border Radius', 'ultimate-store-kit' ), |
| 579 |
'type' => Controls_Manager::DIMENSIONS, |
| 580 |
'size_units' => [ 'px', '%' ], |
| 581 |
'selectors' => [ |
| 582 |
'{{WRAPPER}} .usk-page-cart .usk-product-quantity .input-text.qty' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; overflow: hidden;', |
| 583 |
], |
| 584 |
'condition' => [ |
| 585 |
'show_quantity' => 'yes', |
| 586 |
] |
| 587 |
] |
| 588 |
); |
| 589 |
|
| 590 |
$this->add_control( |
| 591 |
'product_subtotal_heading', |
| 592 |
[ |
| 593 |
'label' => esc_html__( 'Product Sub Total', 'ultimate-store-kit' ), |
| 594 |
'type' => Controls_Manager::HEADING, |
| 595 |
'condition' => [ |
| 596 |
'show_subtotal' => 'yes', |
| 597 |
], |
| 598 |
'separator' => 'before' |
| 599 |
] |
| 600 |
); |
| 601 |
|
| 602 |
$this->add_control( |
| 603 |
'product_subtotal_color', |
| 604 |
[ |
| 605 |
'label' => __( 'Color', 'ultimate-store-kit' ), |
| 606 |
'type' => Controls_Manager::COLOR, |
| 607 |
'selectors' => [ |
| 608 |
'{{WRAPPER}} .usk-page-cart .woocommerce tbody .usk-product-subtotal' => 'color: {{VALUE}};', |
| 609 |
], |
| 610 |
'condition' => [ |
| 611 |
'show_subtotal' => 'yes', |
| 612 |
] |
| 613 |
] |
| 614 |
); |
| 615 |
|
| 616 |
$this->add_group_control( |
| 617 |
Group_Control_Typography::get_type(), |
| 618 |
[ |
| 619 |
'name' => 'product_subtotal_typo', |
| 620 |
'selector' => '{{WRAPPER}} .usk-page-cart .woocommerce tbody .usk-product-subtotal', |
| 621 |
'condition' => [ |
| 622 |
'show_subtotal' => 'yes', |
| 623 |
] |
| 624 |
] |
| 625 |
); |
| 626 |
|
| 627 |
$this->end_controls_section(); |
| 628 |
|
| 629 |
$this->start_controls_section( |
| 630 |
'cart_actions_style_section', |
| 631 |
[ |
| 632 |
'label' => __( 'Close Button', 'ultimate-store-kit' ) . BDTUSK_NC, |
| 633 |
'tab' => Controls_Manager::TAB_STYLE, |
| 634 |
] |
| 635 |
); |
| 636 |
|
| 637 |
$this->start_controls_tabs( 'remove_button_tabs' ); |
| 638 |
$this->start_controls_tab( |
| 639 |
'remove_button_normal', |
| 640 |
[ |
| 641 |
'label' => __( 'Normal', 'ultimate-store-kit' ), |
| 642 |
] |
| 643 |
); |
| 644 |
|
| 645 |
$this->add_control( |
| 646 |
'remove_button_color', |
| 647 |
[ |
| 648 |
'label' => __( 'Color', 'ultimate-store-kit' ), |
| 649 |
'type' => Controls_Manager::COLOR, |
| 650 |
'selectors' => [ |
| 651 |
'{{WRAPPER}} .usk-page-cart .woocommerce-cart-form .shop_table .usk-product-remove .remove' => 'color: {{VALUE}} !important;', |
| 652 |
], |
| 653 |
] |
| 654 |
); |
| 655 |
|
| 656 |
$this->add_group_control( |
| 657 |
Group_Control_Background::get_type(), |
| 658 |
[ |
| 659 |
'name' => 'remove_button_bg', |
| 660 |
'selector' => '{{WRAPPER}} .usk-page-cart .woocommerce-cart-form .shop_table .usk-product-remove .remove' |
| 661 |
] |
| 662 |
); |
| 663 |
|
| 664 |
$this->add_group_control( |
| 665 |
Group_Control_Border::get_type(), |
| 666 |
[ |
| 667 |
'name' => 'remove_button_border', |
| 668 |
'selector' => '{{WRAPPER}} .usk-page-cart .woocommerce-cart-form .shop_table .usk-product-remove .remove', |
| 669 |
'separator' => 'before', |
| 670 |
] |
| 671 |
); |
| 672 |
|
| 673 |
$this->add_responsive_control( |
| 674 |
'remove_button_border_radius', |
| 675 |
[ |
| 676 |
'label' => __( 'Border Radius', 'ultimate-store-kit' ), |
| 677 |
'type' => Controls_Manager::DIMENSIONS, |
| 678 |
'size_units' => [ 'px', '%' ], |
| 679 |
'selectors' => [ |
| 680 |
'{{WRAPPER}} .usk-page-cart .woocommerce-cart-form .shop_table .usk-product-remove .remove' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; overflow: hidden;', |
| 681 |
], |
| 682 |
] |
| 683 |
); |
| 684 |
|
| 685 |
$this->add_responsive_control( |
| 686 |
'remove_button_size', |
| 687 |
[ |
| 688 |
'label' => __( 'Padding', 'ultimate-store-kit' ), |
| 689 |
'type' => Controls_Manager::SLIDER, |
| 690 |
'size_units' => [ 'px', 'em' ], |
| 691 |
'range' => [ |
| 692 |
'px' => [ |
| 693 |
'min' => 10, |
| 694 |
'max' => 50, |
| 695 |
], |
| 696 |
'em' => [ |
| 697 |
'min' => 0.1, |
| 698 |
'max' => 2, |
| 699 |
'step' => 0.1, |
| 700 |
], |
| 701 |
], |
| 702 |
'selectors' => [ |
| 703 |
'{{WRAPPER}} .usk-page-cart .woocommerce-cart-form .shop_table .usk-product-remove .remove' => 'height: {{SIZE}}{{UNIT}}; line-height: {{SIZE}}{{UNIT}}; width: {{SIZE}}{{UNIT}};', |
| 704 |
], |
| 705 |
] |
| 706 |
); |
| 707 |
|
| 708 |
$this->add_responsive_control( |
| 709 |
'remove_button_icon_size', |
| 710 |
[ |
| 711 |
'label' => __( 'Icon Size', 'ultimate-store-kit' ), |
| 712 |
'type' => Controls_Manager::SLIDER, |
| 713 |
'size_units' => [ 'px', 'em' ], |
| 714 |
'range' => [ |
| 715 |
'px' => [ |
| 716 |
'min' => 10, |
| 717 |
'max' => 50, |
| 718 |
], |
| 719 |
'em' => [ |
| 720 |
'min' => 0.1, |
| 721 |
'max' => 2, |
| 722 |
'step' => 0.1, |
| 723 |
], |
| 724 |
], |
| 725 |
'selectors' => [ |
| 726 |
'{{WRAPPER}} .usk-page-cart .woocommerce-cart-form .shop_table .usk-product-remove .remove' => 'font-size: {{SIZE}}{{UNIT}};', |
| 727 |
], |
| 728 |
] |
| 729 |
); |
| 730 |
|
| 731 |
$this->end_controls_tab(); |
| 732 |
$this->start_controls_tab( |
| 733 |
'remove_button_hover', |
| 734 |
[ |
| 735 |
'label' => __( 'Hover', 'ultimate-store-kit' ), |
| 736 |
] |
| 737 |
); |
| 738 |
|
| 739 |
$this->add_control( |
| 740 |
'remove_button_color_hover', |
| 741 |
[ |
| 742 |
'label' => __( 'Color', 'ultimate-store-kit' ), |
| 743 |
'type' => Controls_Manager::COLOR, |
| 744 |
'selectors' => [ |
| 745 |
'{{WRAPPER}} .usk-page-cart .woocommerce-cart-form .shop_table .usk-product-remove .remove:hover' => 'color: {{VALUE}} !important;', |
| 746 |
], |
| 747 |
] |
| 748 |
); |
| 749 |
|
| 750 |
$this->add_group_control( |
| 751 |
Group_Control_Background::get_type(), |
| 752 |
[ |
| 753 |
'name' => 'remove_button_bg_hover', |
| 754 |
'selector' => '{{WRAPPER}} .usk-page-cart .woocommerce-cart-form .shop_table .usk-product-remove .remove:hover' |
| 755 |
] |
| 756 |
); |
| 757 |
|
| 758 |
$this->add_control( |
| 759 |
'remove_button_border_color_hover', |
| 760 |
[ |
| 761 |
'label' => __( 'Border Color', 'ultimate-store-kit' ), |
| 762 |
'type' => Controls_Manager::COLOR, |
| 763 |
'selectors' => [ |
| 764 |
'{{WRAPPER}} .usk-page-cart .woocommerce-cart-form .shop_table .usk-product-remove .remove:hover' => 'border-color: {{VALUE}};', |
| 765 |
], |
| 766 |
'condition' => [ |
| 767 |
'remove_button_border_border!' => '', |
| 768 |
] |
| 769 |
] |
| 770 |
); |
| 771 |
|
| 772 |
$this->end_controls_tab(); |
| 773 |
$this->end_controls_tabs(); |
| 774 |
$this->end_controls_section(); |
| 775 |
|
| 776 |
$this->start_controls_section( |
| 777 |
'product_coupon_style_section', |
| 778 |
[ |
| 779 |
'label' => __( 'Coupon Style', 'ultimate-store-kit' ), |
| 780 |
'tab' => Controls_Manager::TAB_STYLE, |
| 781 |
] |
| 782 |
); |
| 783 |
|
| 784 |
$this->add_control( |
| 785 |
'coupon_label_heading', |
| 786 |
[ |
| 787 |
'label' => esc_html__( 'Coupon Label', 'ultimate-store-kit' ), |
| 788 |
'type' => Controls_Manager::HEADING, |
| 789 |
] |
| 790 |
); |
| 791 |
|
| 792 |
$this->add_control( |
| 793 |
'coupon_label_color', |
| 794 |
[ |
| 795 |
'label' => __( 'Color', 'ultimate-store-kit' ), |
| 796 |
'type' => Controls_Manager::COLOR, |
| 797 |
'selectors' => [ |
| 798 |
'{{WRAPPER}} .usk-page-cart .coupon label' => 'color: {{VALUE}};', |
| 799 |
], |
| 800 |
] |
| 801 |
); |
| 802 |
|
| 803 |
$this->add_group_control( |
| 804 |
Group_Control_Typography::get_type(), |
| 805 |
[ |
| 806 |
'name' => 'coupon_label_typo', |
| 807 |
'selector' => '{{WRAPPER}} .usk-page-cart .coupon label', |
| 808 |
] |
| 809 |
); |
| 810 |
|
| 811 |
$this->add_control( |
| 812 |
'coupon_field_heading', |
| 813 |
[ |
| 814 |
'label' => esc_html__( 'Coupon Field', 'ultimate-store-kit' ), |
| 815 |
'type' => Controls_Manager::HEADING, |
| 816 |
'separator' => 'before' |
| 817 |
] |
| 818 |
); |
| 819 |
|
| 820 |
$this->add_control( |
| 821 |
'coupon_field_color', |
| 822 |
[ |
| 823 |
'label' => __( 'Color', 'ultimate-store-kit' ), |
| 824 |
'type' => Controls_Manager::COLOR, |
| 825 |
'selectors' => [ |
| 826 |
'{{WRAPPER}} .usk-page-cart .coupon #coupon_code::placeholder' => 'color: {{VALUE}};', |
| 827 |
], |
| 828 |
] |
| 829 |
); |
| 830 |
|
| 831 |
$this->add_group_control( |
| 832 |
Group_Control_Typography::get_type(), |
| 833 |
[ |
| 834 |
'name' => 'coupon_field_typo', |
| 835 |
'selector' => '{{WRAPPER}} .usk-page-cart .coupon #coupon_code', |
| 836 |
] |
| 837 |
); |
| 838 |
|
| 839 |
$this->add_responsive_control( |
| 840 |
'coupon_field_padding', |
| 841 |
[ |
| 842 |
'label' => __( 'Padding', 'ultimate-store-kit' ), |
| 843 |
'type' => Controls_Manager::DIMENSIONS, |
| 844 |
'size_units' => [ 'px', 'em', '%' ], |
| 845 |
'selectors' => [ |
| 846 |
'{{WRAPPER}} .usk-page-cart .coupon #coupon_code' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 847 |
], |
| 848 |
] |
| 849 |
); |
| 850 |
|
| 851 |
$this->add_group_control( |
| 852 |
Group_Control_Border::get_type(), |
| 853 |
[ |
| 854 |
'name' => 'coupon_field_border', |
| 855 |
'selector' => '{{WRAPPER}} .usk-page-cart .coupon #coupon_code', |
| 856 |
] |
| 857 |
); |
| 858 |
|
| 859 |
$this->add_responsive_control( |
| 860 |
'coupon_field_border_radius', |
| 861 |
[ |
| 862 |
'label' => __( 'Border Radius', 'ultimate-store-kit' ), |
| 863 |
'type' => Controls_Manager::DIMENSIONS, |
| 864 |
'size_units' => [ 'px', '%' ], |
| 865 |
'selectors' => [ |
| 866 |
'{{WRAPPER}} .usk-page-cart .coupon #coupon_code' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; overflow: hidden;', |
| 867 |
], |
| 868 |
] |
| 869 |
); |
| 870 |
|
| 871 |
$this->add_responsive_control( |
| 872 |
'coupon_field_width', |
| 873 |
[ |
| 874 |
'label' => __( 'Width', 'ultimate-store-kit' ), |
| 875 |
'type' => Controls_Manager::SLIDER, |
| 876 |
'size_units' => [ 'px', '%' ], |
| 877 |
'range' => [ |
| 878 |
'px' => [ |
| 879 |
'min' => 50, |
| 880 |
'max' => 500, |
| 881 |
], |
| 882 |
'%' => [ |
| 883 |
'min' => 10, |
| 884 |
'max' => 100, |
| 885 |
], |
| 886 |
], |
| 887 |
'selectors' => [ |
| 888 |
'{{WRAPPER}} .usk-page-cart .coupon #coupon_code' => 'width: {{SIZE}}{{UNIT}};', |
| 889 |
], |
| 890 |
] |
| 891 |
); |
| 892 |
|
| 893 |
$this->add_control( |
| 894 |
'coupon_button_heading', |
| 895 |
[ |
| 896 |
'label' => esc_html__( 'Coupon Button', 'ultimate-store-kit' ), |
| 897 |
'type' => Controls_Manager::HEADING, |
| 898 |
'separator' => 'before', |
| 899 |
] |
| 900 |
); |
| 901 |
|
| 902 |
$this->start_controls_tabs( 'coupon_button_tabs' ); |
| 903 |
$this->start_controls_tab( |
| 904 |
'coupon_button_normal', |
| 905 |
[ |
| 906 |
'label' => __( 'Normal', 'ultimate-store-kit' ), |
| 907 |
] |
| 908 |
); |
| 909 |
|
| 910 |
$this->add_control( |
| 911 |
'coupon_button_color', |
| 912 |
[ |
| 913 |
'label' => __( 'Color', 'ultimate-store-kit' ), |
| 914 |
'type' => Controls_Manager::COLOR, |
| 915 |
'selectors' => [ |
| 916 |
'{{WRAPPER}} .usk-page-cart .coupon .button' => 'color: {{VALUE}};', |
| 917 |
], |
| 918 |
] |
| 919 |
); |
| 920 |
|
| 921 |
$this->add_group_control( |
| 922 |
Group_Control_Background::get_type(), |
| 923 |
[ |
| 924 |
'name' => 'coupon_button_bg', |
| 925 |
'selector' => '{{WRAPPER}} .usk-page-cart .coupon .button' |
| 926 |
] |
| 927 |
); |
| 928 |
$this->add_group_control( |
| 929 |
Group_Control_Border::get_type(), |
| 930 |
[ |
| 931 |
'name' => 'coupon_button_border', |
| 932 |
'selector' => '{{WRAPPER}} .usk-page-cart .coupon .button', |
| 933 |
] |
| 934 |
); |
| 935 |
|
| 936 |
$this->add_responsive_control( |
| 937 |
'coupon_button_border_radius', |
| 938 |
[ |
| 939 |
'label' => __( 'Border Radius', 'ultimate-store-kit' ), |
| 940 |
'type' => Controls_Manager::DIMENSIONS, |
| 941 |
'size_units' => [ 'px', '%' ], |
| 942 |
'selectors' => [ |
| 943 |
'{{WRAPPER}} .usk-page-cart .coupon .button' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; overflow: hidden;', |
| 944 |
], |
| 945 |
] |
| 946 |
); |
| 947 |
|
| 948 |
$this->add_responsive_control( |
| 949 |
'coupon_button_padding', |
| 950 |
[ |
| 951 |
'label' => __( 'Padding', 'ultimate-store-kit' ), |
| 952 |
'type' => Controls_Manager::DIMENSIONS, |
| 953 |
'size_units' => [ 'px', 'em', '%' ], |
| 954 |
'selectors' => [ |
| 955 |
'{{WRAPPER}} .usk-page-cart .coupon .button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 956 |
], |
| 957 |
] |
| 958 |
); |
| 959 |
|
| 960 |
$this->add_responsive_control( |
| 961 |
'coupon_button_width', |
| 962 |
[ |
| 963 |
'label' => __( 'Width', 'ultimate-store-kit' ), |
| 964 |
'type' => Controls_Manager::SLIDER, |
| 965 |
'size_units' => [ 'px', '%' ], |
| 966 |
'range' => [ |
| 967 |
'px' => [ |
| 968 |
'min' => 50, |
| 969 |
'max' => 500, |
| 970 |
], |
| 971 |
'%' => [ |
| 972 |
'min' => 10, |
| 973 |
'max' => 100, |
| 974 |
], |
| 975 |
], |
| 976 |
'selectors' => [ |
| 977 |
'{{WRAPPER}} .usk-page-cart .coupon .button' => 'width: {{SIZE}}{{UNIT}} !important;', |
| 978 |
], |
| 979 |
] |
| 980 |
); |
| 981 |
$this->add_group_control( |
| 982 |
Group_Control_Typography::get_type(), |
| 983 |
[ |
| 984 |
'name' => 'coupon_button_typo', |
| 985 |
'selector' => '{{WRAPPER}} .usk-page-cart .coupon .button', |
| 986 |
] |
| 987 |
); |
| 988 |
|
| 989 |
$this->end_controls_tab(); |
| 990 |
$this->start_controls_tab( |
| 991 |
'coupon_button_hover', |
| 992 |
[ |
| 993 |
'label' => __( 'Hover', 'ultimate-store-kit' ), |
| 994 |
] |
| 995 |
); |
| 996 |
|
| 997 |
$this->add_control( |
| 998 |
'coupon_button_color_hover', |
| 999 |
[ |
| 1000 |
'label' => __( 'Color', 'ultimate-store-kit' ), |
| 1001 |
'type' => Controls_Manager::COLOR, |
| 1002 |
'selectors' => [ |
| 1003 |
'{{WRAPPER}} .usk-page-cart .coupon .button:hover' => 'color: {{VALUE}};', |
| 1004 |
], |
| 1005 |
] |
| 1006 |
); |
| 1007 |
|
| 1008 |
$this->add_group_control( |
| 1009 |
Group_Control_Background::get_type(), |
| 1010 |
[ |
| 1011 |
'name' => 'coupon_button_bg_hover', |
| 1012 |
'selector' => '{{WRAPPER}} .usk-page-cart .coupon .button:hover' |
| 1013 |
] |
| 1014 |
); |
| 1015 |
|
| 1016 |
$this->add_control( |
| 1017 |
'coupon_button_border_color_hover', |
| 1018 |
[ |
| 1019 |
'label' => __( 'Border Color', 'ultimate-store-kit' ), |
| 1020 |
'type' => Controls_Manager::COLOR, |
| 1021 |
'selectors' => [ |
| 1022 |
'{{WRAPPER}} .usk-page-cart .coupon .button:hover' => 'border-color: {{VALUE}};', |
| 1023 |
], |
| 1024 |
'condition' => [ |
| 1025 |
'coupon_button_border_border!' => '', |
| 1026 |
] |
| 1027 |
] |
| 1028 |
); |
| 1029 |
|
| 1030 |
$this->end_controls_tab(); |
| 1031 |
$this->end_controls_tabs(); |
| 1032 |
$this->end_controls_section(); |
| 1033 |
|
| 1034 |
$this->start_controls_section( |
| 1035 |
'update_cart_style_section', |
| 1036 |
[ |
| 1037 |
'label' => __( 'Cart Update Button', 'ultimate-store-kit' ), |
| 1038 |
'tab' => Controls_Manager::TAB_STYLE, |
| 1039 |
] |
| 1040 |
); |
| 1041 |
|
| 1042 |
$this->start_controls_tabs( 'update_cart_tabs' ); |
| 1043 |
$this->start_controls_tab( |
| 1044 |
'update_cart_normal', |
| 1045 |
[ |
| 1046 |
'label' => __( 'Normal', 'ultimate-store-kit' ), |
| 1047 |
] |
| 1048 |
); |
| 1049 |
|
| 1050 |
$this->add_control( |
| 1051 |
'update_cart_color', |
| 1052 |
[ |
| 1053 |
'label' => __( 'Color', 'ultimate-store-kit' ), |
| 1054 |
'type' => Controls_Manager::COLOR, |
| 1055 |
'selectors' => [ |
| 1056 |
'{{WRAPPER}} .usk-page-cart .actions>.button' => 'color: {{VALUE}};', |
| 1057 |
], |
| 1058 |
] |
| 1059 |
); |
| 1060 |
|
| 1061 |
$this->add_group_control( |
| 1062 |
Group_Control_Background::get_type(), |
| 1063 |
[ |
| 1064 |
'name' => 'update_cart_bg', |
| 1065 |
'selector' => '{{WRAPPER}} .usk-page-cart .actions>.button' |
| 1066 |
] |
| 1067 |
); |
| 1068 |
|
| 1069 |
$this->add_group_control( |
| 1070 |
Group_Control_Border::get_type(), |
| 1071 |
[ |
| 1072 |
'name' => 'update_cart_border', |
| 1073 |
'selector' => '{{WRAPPER}} .usk-page-cart .actions>.button', |
| 1074 |
'separator' => 'before', |
| 1075 |
] |
| 1076 |
); |
| 1077 |
|
| 1078 |
$this->add_responsive_control( |
| 1079 |
'update_cart_border_radius', |
| 1080 |
[ |
| 1081 |
'label' => __( 'Border Radius', 'ultimate-store-kit' ), |
| 1082 |
'type' => Controls_Manager::DIMENSIONS, |
| 1083 |
'size_units' => [ 'px', '%' ], |
| 1084 |
'selectors' => [ |
| 1085 |
'{{WRAPPER}} .usk-page-cart .actions>.button' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; overflow: hidden;', |
| 1086 |
], |
| 1087 |
] |
| 1088 |
); |
| 1089 |
|
| 1090 |
$this->add_responsive_control( |
| 1091 |
'update_cart_padding', |
| 1092 |
[ |
| 1093 |
'label' => __( 'Padding', 'ultimate-store-kit' ), |
| 1094 |
'type' => Controls_Manager::DIMENSIONS, |
| 1095 |
'size_units' => [ 'px', 'em', '%' ], |
| 1096 |
'selectors' => [ |
| 1097 |
'{{WRAPPER}} .usk-page-cart .actions>.button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1098 |
], |
| 1099 |
] |
| 1100 |
); |
| 1101 |
|
| 1102 |
$this->add_responsive_control( |
| 1103 |
'update_cart_margin', |
| 1104 |
[ |
| 1105 |
'label' => __( 'Margin', 'ultimate-store-kit' ), |
| 1106 |
'type' => Controls_Manager::DIMENSIONS, |
| 1107 |
'size_units' => [ 'px', 'em', '%' ], |
| 1108 |
'selectors' => [ |
| 1109 |
'{{WRAPPER}} .usk-page-cart .actions>.button' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1110 |
], |
| 1111 |
] |
| 1112 |
); |
| 1113 |
|
| 1114 |
$this->add_responsive_control( |
| 1115 |
'update_cart_width', |
| 1116 |
[ |
| 1117 |
'label' => __( 'Width', 'ultimate-store-kit' ), |
| 1118 |
'type' => Controls_Manager::SLIDER, |
| 1119 |
'size_units' => [ 'px', '%' ], |
| 1120 |
'range' => [ |
| 1121 |
'px' => [ |
| 1122 |
'min' => 50, |
| 1123 |
'max' => 500, |
| 1124 |
], |
| 1125 |
'%' => [ |
| 1126 |
'min' => 10, |
| 1127 |
'max' => 100, |
| 1128 |
], |
| 1129 |
], |
| 1130 |
'selectors' => [ |
| 1131 |
'{{WRAPPER}} .usk-page-cart .actions>.button' => 'width: {{SIZE}}{{UNIT}} !important;', |
| 1132 |
], |
| 1133 |
] |
| 1134 |
); |
| 1135 |
|
| 1136 |
$this->add_group_control( |
| 1137 |
Group_Control_Typography::get_type(), |
| 1138 |
[ |
| 1139 |
'name' => 'update_cart_typo', |
| 1140 |
'selector' => '{{WRAPPER}} .usk-page-cart .actions>.button', |
| 1141 |
] |
| 1142 |
); |
| 1143 |
|
| 1144 |
$this->end_controls_tab(); |
| 1145 |
$this->start_controls_tab( |
| 1146 |
'update_cart_hover', |
| 1147 |
[ |
| 1148 |
'label' => __( 'Hover', 'ultimate-store-kit' ), |
| 1149 |
] |
| 1150 |
); |
| 1151 |
|
| 1152 |
$this->add_control( |
| 1153 |
'update_cart_color_hover', |
| 1154 |
[ |
| 1155 |
'label' => __( 'Color', 'ultimate-store-kit' ), |
| 1156 |
'type' => Controls_Manager::COLOR, |
| 1157 |
'selectors' => [ |
| 1158 |
'{{WRAPPER}} .usk-page-cart .actions>.button:hover' => 'color: {{VALUE}};', |
| 1159 |
], |
| 1160 |
] |
| 1161 |
); |
| 1162 |
|
| 1163 |
$this->add_group_control( |
| 1164 |
Group_Control_Background::get_type(), |
| 1165 |
[ |
| 1166 |
'name' => 'update_cart_bg_hover', |
| 1167 |
'selector' => '{{WRAPPER}} .usk-page-cart .actions>.button:hover' |
| 1168 |
] |
| 1169 |
); |
| 1170 |
|
| 1171 |
$this->add_control( |
| 1172 |
'update_cart_border_color_hover', |
| 1173 |
[ |
| 1174 |
'label' => __( 'Border Color', 'ultimate-store-kit' ), |
| 1175 |
'type' => Controls_Manager::COLOR, |
| 1176 |
'selectors' => [ |
| 1177 |
'{{WRAPPER}} .usk-page-cart .actions>.button:hover' => 'border-color: {{VALUE}};', |
| 1178 |
], |
| 1179 |
'condition' => [ |
| 1180 |
'update_cart_border_border!' => '', |
| 1181 |
] |
| 1182 |
] |
| 1183 |
); |
| 1184 |
|
| 1185 |
$this->end_controls_tab(); |
| 1186 |
$this->end_controls_tabs(); |
| 1187 |
$this->end_controls_section(); |
| 1188 |
|
| 1189 |
$this->start_controls_section( |
| 1190 |
'cart_collaterals_style_section', |
| 1191 |
[ |
| 1192 |
'label' => __( 'Cart Collaterals', 'ultimate-store-kit' ), |
| 1193 |
'tab' => Controls_Manager::TAB_STYLE, |
| 1194 |
] |
| 1195 |
); |
| 1196 |
|
| 1197 |
$this->add_control( |
| 1198 |
'cart_total_heading', |
| 1199 |
[ |
| 1200 |
'label' => esc_html__( 'Heading', 'ultimate-store-kit' ), |
| 1201 |
'type' => Controls_Manager::HEADING, |
| 1202 |
] |
| 1203 |
); |
| 1204 |
|
| 1205 |
$this->add_control( |
| 1206 |
'cart_total_color', |
| 1207 |
[ |
| 1208 |
'label' => __( 'Color', 'ultimate-store-kit' ), |
| 1209 |
'type' => Controls_Manager::COLOR, |
| 1210 |
'selectors' => [ |
| 1211 |
'{{WRAPPER}} .usk-page-cart .cart-collaterals .cart_totals h2' => 'color: {{VALUE}};', |
| 1212 |
], |
| 1213 |
] |
| 1214 |
); |
| 1215 |
|
| 1216 |
$this->add_group_control( |
| 1217 |
Group_Control_Typography::get_type(), |
| 1218 |
[ |
| 1219 |
'name' => 'cart_total_typo', |
| 1220 |
'selector' => '{{WRAPPER}} .usk-page-cart .cart-collaterals .cart_totals h2', |
| 1221 |
] |
| 1222 |
); |
| 1223 |
|
| 1224 |
$this->add_control( |
| 1225 |
'cart_total_bottom_spacing', |
| 1226 |
[ |
| 1227 |
'label' => esc_html__( 'Bottom Spacing', 'ultimate-store-kit' ), |
| 1228 |
'type' => Controls_Manager::SLIDER, |
| 1229 |
'size_units' => [ 'px', '' ], |
| 1230 |
'range' => [ |
| 1231 |
'px' => [ |
| 1232 |
'min' => 0, |
| 1233 |
'max' => 100, |
| 1234 |
], |
| 1235 |
], |
| 1236 |
'selectors' => [ |
| 1237 |
'{{WRAPPER}} .usk-page-cart .cart-collaterals .cart_totals h2' => 'margin-bottom: {{SIZE}}{{UNIT}};', |
| 1238 |
], |
| 1239 |
] |
| 1240 |
); |
| 1241 |
|
| 1242 |
$this->add_control( |
| 1243 |
'cart_total_table_heading', |
| 1244 |
[ |
| 1245 |
'label' => esc_html__( 'Table Body', 'ultimate-store-kit' ), |
| 1246 |
'type' => Controls_Manager::HEADING, |
| 1247 |
'separator' => 'before', |
| 1248 |
] |
| 1249 |
); |
| 1250 |
$this->add_group_control( |
| 1251 |
Group_Control_Background::get_type(), |
| 1252 |
[ |
| 1253 |
'name' => 'cart_total_table_bg', |
| 1254 |
'selector' => '{{WRAPPER}} .usk-page-cart .cart-collaterals .cart_totals .shop_table th, {{WRAPPER}} .usk-page-cart .cart-collaterals .cart_totals .shop_table td', |
| 1255 |
] |
| 1256 |
); |
| 1257 |
|
| 1258 |
$this->add_group_control( |
| 1259 |
Group_Control_Border::get_type(), |
| 1260 |
[ |
| 1261 |
'name' => 'cart_total_table_border', |
| 1262 |
'selector' => '{{WRAPPER}} .usk-page-cart .cart-collaterals .cart_totals .shop_table th, {{WRAPPER}} .usk-page-cart .cart-collaterals .cart_totals .shop_table td', |
| 1263 |
] |
| 1264 |
); |
| 1265 |
|
| 1266 |
$this->add_responsive_control( |
| 1267 |
'cart_total_table_padding', |
| 1268 |
[ |
| 1269 |
'label' => __( 'Padding', 'ultimate-store-kit' ), |
| 1270 |
'type' => Controls_Manager::DIMENSIONS, |
| 1271 |
'size_units' => [ 'px', 'em', '%' ], |
| 1272 |
'selectors' => [ |
| 1273 |
'{{WRAPPER}} .usk-page-cart .cart-collaterals .cart_totals .shop_table th, {{WRAPPER}} .usk-page-cart .cart-collaterals .cart_totals .shop_table td' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1274 |
], |
| 1275 |
] |
| 1276 |
); |
| 1277 |
$this->add_responsive_control( |
| 1278 |
'cart_total_table_margin', |
| 1279 |
[ |
| 1280 |
'label' => __( 'Margin', 'ultimate-store-kit' ), |
| 1281 |
'type' => Controls_Manager::DIMENSIONS, |
| 1282 |
'size_units' => [ 'px', 'em', '%' ], |
| 1283 |
'selectors' => [ |
| 1284 |
'{{WRAPPER}} .usk-page-cart .cart-collaterals .cart_totals table' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1285 |
], |
| 1286 |
] |
| 1287 |
); |
| 1288 |
|
| 1289 |
$this->start_controls_tabs( 'cart_total_tabs' ); |
| 1290 |
$this->start_controls_tab( |
| 1291 |
'cart_subtotal_tab', |
| 1292 |
[ |
| 1293 |
'label' => __( 'Subtotal', 'ultimate-store-kit' ), |
| 1294 |
] |
| 1295 |
); |
| 1296 |
|
| 1297 |
$this->add_control( |
| 1298 |
'cart_sub_total_heading', |
| 1299 |
[ |
| 1300 |
'label' => esc_html__( 'Title', 'ultimate-store-kit' ), |
| 1301 |
'type' => Controls_Manager::HEADING, |
| 1302 |
] |
| 1303 |
); |
| 1304 |
|
| 1305 |
$this->add_control( |
| 1306 |
'cart_sub_total_color', |
| 1307 |
[ |
| 1308 |
'label' => __( 'Color', 'ultimate-store-kit' ), |
| 1309 |
'type' => Controls_Manager::COLOR, |
| 1310 |
'selectors' => [ |
| 1311 |
'{{WRAPPER}} .usk-page-cart .cart-collaterals .cart-subtotal th' => 'color: {{VALUE}};', |
| 1312 |
], |
| 1313 |
] |
| 1314 |
); |
| 1315 |
|
| 1316 |
$this->add_group_control( |
| 1317 |
Group_Control_Typography::get_type(), |
| 1318 |
[ |
| 1319 |
'name' => 'cart_sub_total_typo', |
| 1320 |
'selector' => '{{WRAPPER}} .usk-page-cart .cart-collaterals .cart-subtotal th', |
| 1321 |
] |
| 1322 |
); |
| 1323 |
|
| 1324 |
$this->add_control( |
| 1325 |
'cart_sub_total_amount_heading', |
| 1326 |
[ |
| 1327 |
'label' => esc_html__( 'Amount', 'ultimate-store-kit' ), |
| 1328 |
'type' => Controls_Manager::HEADING, |
| 1329 |
'separator' => 'before', |
| 1330 |
] |
| 1331 |
); |
| 1332 |
|
| 1333 |
$this->add_control( |
| 1334 |
'cart_sub_total_amount_color', |
| 1335 |
[ |
| 1336 |
'label' => __( 'Color', 'ultimate-store-kit' ), |
| 1337 |
'type' => Controls_Manager::COLOR, |
| 1338 |
'selectors' => [ |
| 1339 |
'{{WRAPPER}} .usk-page-cart .cart-collaterals .cart-subtotal .woocommerce-Price-amount.amount' => 'color: {{VALUE}};', |
| 1340 |
], |
| 1341 |
] |
| 1342 |
); |
| 1343 |
|
| 1344 |
$this->add_group_control( |
| 1345 |
Group_Control_Typography::get_type(), |
| 1346 |
[ |
| 1347 |
'name' => 'cart_sub_total_amount_typo', |
| 1348 |
'selector' => '{{WRAPPER}} .usk-page-cart .cart-collaterals .cart-subtotal .woocommerce-Price-amount.amount', |
| 1349 |
] |
| 1350 |
); |
| 1351 |
|
| 1352 |
$this->end_controls_tab(); |
| 1353 |
$this->start_controls_tab( |
| 1354 |
'cart_total_tab', |
| 1355 |
[ |
| 1356 |
'label' => __( 'Total', 'ultimate-store-kit' ), |
| 1357 |
] |
| 1358 |
); |
| 1359 |
|
| 1360 |
$this->add_control( |
| 1361 |
'cart_final_total_heading', |
| 1362 |
[ |
| 1363 |
'label' => esc_html__( 'Title', 'ultimate-store-kit' ), |
| 1364 |
'type' => Controls_Manager::HEADING, |
| 1365 |
] |
| 1366 |
); |
| 1367 |
|
| 1368 |
$this->add_control( |
| 1369 |
'cart_final_total_color', |
| 1370 |
[ |
| 1371 |
'label' => __( 'Color', 'ultimate-store-kit' ), |
| 1372 |
'type' => Controls_Manager::COLOR, |
| 1373 |
'selectors' => [ |
| 1374 |
'{{WRAPPER}} .usk-page-cart .cart-collaterals .order-total th' => 'color: {{VALUE}};', |
| 1375 |
], |
| 1376 |
] |
| 1377 |
); |
| 1378 |
|
| 1379 |
$this->add_group_control( |
| 1380 |
Group_Control_Typography::get_type(), |
| 1381 |
[ |
| 1382 |
'name' => 'cart_final_total_typo', |
| 1383 |
'selector' => '{{WRAPPER}} .usk-page-cart .cart-collaterals .order-total th', |
| 1384 |
] |
| 1385 |
); |
| 1386 |
|
| 1387 |
$this->add_control( |
| 1388 |
'cart_final_total_amount_heading', |
| 1389 |
[ |
| 1390 |
'label' => esc_html__( 'Amount', 'ultimate-store-kit' ), |
| 1391 |
'type' => Controls_Manager::HEADING, |
| 1392 |
'separator' => 'before', |
| 1393 |
] |
| 1394 |
); |
| 1395 |
|
| 1396 |
$this->add_control( |
| 1397 |
'cart_final_total_amount_color', |
| 1398 |
[ |
| 1399 |
'label' => __( 'Color', 'ultimate-store-kit' ), |
| 1400 |
'type' => Controls_Manager::COLOR, |
| 1401 |
'selectors' => [ |
| 1402 |
'{{WRAPPER}} .usk-page-cart .cart-collaterals .order-total .woocommerce-Price-amount.amount' => 'color: {{VALUE}};', |
| 1403 |
], |
| 1404 |
] |
| 1405 |
); |
| 1406 |
|
| 1407 |
$this->add_group_control( |
| 1408 |
Group_Control_Typography::get_type(), |
| 1409 |
[ |
| 1410 |
'name' => 'cart_final_total_amount_typo', |
| 1411 |
'selector' => '{{WRAPPER}} .usk-page-cart .cart-collaterals .order-total .woocommerce-Price-amount.amount', |
| 1412 |
] |
| 1413 |
); |
| 1414 |
|
| 1415 |
$this->end_controls_tab(); |
| 1416 |
$this->end_controls_tabs(); |
| 1417 |
$this->end_controls_section(); |
| 1418 |
|
| 1419 |
$this->start_controls_section( |
| 1420 |
'checkout_button_style_section', |
| 1421 |
[ |
| 1422 |
'label' => __( 'Checkout Button', 'ultimate-store-kit' ), |
| 1423 |
'tab' => Controls_Manager::TAB_STYLE, |
| 1424 |
] |
| 1425 |
); |
| 1426 |
|
| 1427 |
$this->start_controls_tabs( 'checkout_button_tabs' ); |
| 1428 |
$this->start_controls_tab( |
| 1429 |
'checkout_button_normal', |
| 1430 |
[ |
| 1431 |
'label' => __( 'Normal', 'ultimate-store-kit' ), |
| 1432 |
] |
| 1433 |
); |
| 1434 |
|
| 1435 |
$this->add_control( |
| 1436 |
'checkout_button_color', |
| 1437 |
[ |
| 1438 |
'label' => __( 'Color', 'ultimate-store-kit' ), |
| 1439 |
'type' => Controls_Manager::COLOR, |
| 1440 |
'selectors' => [ |
| 1441 |
'{{WRAPPER}} .usk-page-cart .woocommerce .wc-proceed-to-checkout a' => 'color: {{VALUE}};', |
| 1442 |
], |
| 1443 |
] |
| 1444 |
); |
| 1445 |
|
| 1446 |
$this->add_group_control( |
| 1447 |
Group_Control_Background::get_type(), |
| 1448 |
[ |
| 1449 |
'name' => 'checkout_button_bg', |
| 1450 |
'selector' => '{{WRAPPER}} .usk-page-cart .woocommerce .wc-proceed-to-checkout a' |
| 1451 |
] |
| 1452 |
); |
| 1453 |
|
| 1454 |
$this->add_group_control( |
| 1455 |
Group_Control_Border::get_type(), |
| 1456 |
[ |
| 1457 |
'name' => 'checkout_button_border', |
| 1458 |
'selector' => '{{WRAPPER}} .usk-page-cart .woocommerce .wc-proceed-to-checkout a', |
| 1459 |
'separator' => 'before', |
| 1460 |
] |
| 1461 |
); |
| 1462 |
|
| 1463 |
$this->add_responsive_control( |
| 1464 |
'checkout_button_border_radius', |
| 1465 |
[ |
| 1466 |
'label' => __( 'Border Radius', 'ultimate-store-kit' ), |
| 1467 |
'type' => Controls_Manager::DIMENSIONS, |
| 1468 |
'size_units' => [ 'px', '%' ], |
| 1469 |
'selectors' => [ |
| 1470 |
'{{WRAPPER}} .usk-page-cart .woocommerce .wc-proceed-to-checkout a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; overflow: hidden;', |
| 1471 |
], |
| 1472 |
] |
| 1473 |
); |
| 1474 |
|
| 1475 |
$this->add_responsive_control( |
| 1476 |
'checkout_button_padding', |
| 1477 |
[ |
| 1478 |
'label' => __( 'Padding', 'ultimate-store-kit' ), |
| 1479 |
'type' => Controls_Manager::DIMENSIONS, |
| 1480 |
'size_units' => [ 'px', 'em', '%' ], |
| 1481 |
'selectors' => [ |
| 1482 |
'{{WRAPPER}} .usk-page-cart .woocommerce .wc-proceed-to-checkout a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1483 |
], |
| 1484 |
] |
| 1485 |
); |
| 1486 |
|
| 1487 |
$this->add_responsive_control( |
| 1488 |
'checkout_button_margin', |
| 1489 |
[ |
| 1490 |
'label' => __( 'Margin', 'ultimate-store-kit' ), |
| 1491 |
'type' => Controls_Manager::DIMENSIONS, |
| 1492 |
'size_units' => [ 'px', 'em', '%' ], |
| 1493 |
'selectors' => [ |
| 1494 |
'{{WRAPPER}} .usk-page-cart .woocommerce .wc-proceed-to-checkout a' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1495 |
], |
| 1496 |
] |
| 1497 |
); |
| 1498 |
|
| 1499 |
$this->add_group_control( |
| 1500 |
Group_Control_Typography::get_type(), |
| 1501 |
[ |
| 1502 |
'name' => 'checkout_button_typo', |
| 1503 |
'selector' => '{{WRAPPER}} .usk-page-cart .woocommerce .wc-proceed-to-checkout a', |
| 1504 |
] |
| 1505 |
); |
| 1506 |
|
| 1507 |
$this->end_controls_tab(); |
| 1508 |
|
| 1509 |
$this->start_controls_tab( |
| 1510 |
'checkout_button_hover', |
| 1511 |
[ |
| 1512 |
'label' => __( 'Hover', 'ultimate-store-kit' ), |
| 1513 |
] |
| 1514 |
); |
| 1515 |
|
| 1516 |
$this->add_control( |
| 1517 |
'checkout_button_color_hover', |
| 1518 |
[ |
| 1519 |
'label' => __( 'Color', 'ultimate-store-kit' ), |
| 1520 |
'type' => Controls_Manager::COLOR, |
| 1521 |
'selectors' => [ |
| 1522 |
'{{WRAPPER}} .usk-page-cart .woocommerce .wc-proceed-to-checkout a:hover' => 'color: {{VALUE}};', |
| 1523 |
], |
| 1524 |
] |
| 1525 |
); |
| 1526 |
|
| 1527 |
$this->add_group_control( |
| 1528 |
Group_Control_Background::get_type(), |
| 1529 |
[ |
| 1530 |
'name' => 'checkout_button_bg_hover', |
| 1531 |
'selector' => '{{WRAPPER}} .usk-page-cart .woocommerce .wc-proceed-to-checkout a:hover' |
| 1532 |
] |
| 1533 |
); |
| 1534 |
|
| 1535 |
$this->add_control( |
| 1536 |
'checkout_button_border_color_hover', |
| 1537 |
[ |
| 1538 |
'label' => __( 'Border Color', 'ultimate-store-kit' ), |
| 1539 |
'type' => Controls_Manager::COLOR, |
| 1540 |
'selectors' => [ |
| 1541 |
'{{WRAPPER}} .usk-page-cart .woocommerce .wc-proceed-to-checkout a:hover' => 'border-color: {{VALUE}};', |
| 1542 |
], |
| 1543 |
'condition' => [ |
| 1544 |
'checkout_button_border_border!' => '', |
| 1545 |
] |
| 1546 |
] |
| 1547 |
); |
| 1548 |
|
| 1549 |
$this->end_controls_tab(); |
| 1550 |
$this->end_controls_tabs(); |
| 1551 |
$this->end_controls_section(); |
| 1552 |
} |
| 1553 |
|
| 1554 |
|
| 1555 |
protected function render() { |
| 1556 |
$settings = $this->get_settings_for_display(); |
| 1557 |
|
| 1558 |
if ( is_null( WC()->cart ) ) { |
| 1559 |
wc_load_cart(); |
| 1560 |
} |
| 1561 |
|
| 1562 |
$cart = WC()->cart; |
| 1563 |
|
| 1564 |
if ( ! $cart ) { |
| 1565 |
return; |
| 1566 |
} |
| 1567 |
|
| 1568 |
$items = $cart->get_cart(); |
| 1569 |
$column_count = $this->count_visible_columns( $settings ); |
| 1570 |
$show_image = $this->is_column_visible( $settings, 'show_image' ); |
| 1571 |
$show_title = $this->is_column_visible( $settings, 'show_title' ); |
| 1572 |
$show_price = $this->is_column_visible( $settings, 'show_price' ); |
| 1573 |
$show_quantity = $this->is_column_visible( $settings, 'show_quantity' ); |
| 1574 |
$show_subtotal = $this->is_column_visible( $settings, 'show_subtotal' ); |
| 1575 |
|
| 1576 |
?> |
| 1577 |
|
| 1578 |
<div class="usk-page-cart"> |
| 1579 |
<div class="woocommerce"> |
| 1580 |
<div class="woocommerce-notices-wrapper"> |
| 1581 |
<?php woocommerce_output_all_notices(); ?> |
| 1582 |
</div> |
| 1583 |
<?php if ( $cart->is_empty() ) : ?> |
| 1584 |
<?php wc_get_template( 'cart/cart-empty.php' ); ?> |
| 1585 |
<?php else : ?> |
| 1586 |
<form class="woocommerce-cart-form" action="<?php echo esc_url( wc_get_cart_url() ); ?>" method="post"> |
| 1587 |
<table class="shop_table shop_table_responsive cart woocommerce-cart-form__contents"> |
| 1588 |
<thead> |
| 1589 |
<tr> |
| 1590 |
<th><?php esc_html_e( 'Close', 'ultimate-store-kit' ); ?></th> |
| 1591 |
|
| 1592 |
<?php if ( $show_image ) : ?> |
| 1593 |
<th><?php esc_html_e( 'Image', 'ultimate-store-kit' ); ?></th> |
| 1594 |
<?php endif; ?> |
| 1595 |
|
| 1596 |
<?php if ( $show_title ) : ?> |
| 1597 |
<th><?php esc_html_e( 'Product Title', 'ultimate-store-kit' ); ?></th> |
| 1598 |
<?php endif; ?> |
| 1599 |
|
| 1600 |
<?php if ( $show_price ) : ?> |
| 1601 |
<th><?php esc_html_e( 'Price', 'ultimate-store-kit' ); ?></th> |
| 1602 |
<?php endif; ?> |
| 1603 |
|
| 1604 |
<?php if ( $show_quantity ) : ?> |
| 1605 |
<th><?php esc_html_e( 'Quantity', 'ultimate-store-kit' ); ?></th> |
| 1606 |
<?php endif; ?> |
| 1607 |
|
| 1608 |
<?php if ( $show_subtotal ) : ?> |
| 1609 |
<th><?php esc_html_e( 'Subtotal', 'ultimate-store-kit' ); ?></th> |
| 1610 |
<?php endif; ?> |
| 1611 |
</tr> |
| 1612 |
</thead> |
| 1613 |
<tbody> |
| 1614 |
<?php |
| 1615 |
foreach ( $items as $item => $values ) { |
| 1616 |
$_product = apply_filters( 'woocommerce_cart_item_product', $values['data'], $values, $item ); |
| 1617 |
|
| 1618 |
if ( ! $_product || ! $_product->exists() || $values['quantity'] <= 0 ) { |
| 1619 |
continue; |
| 1620 |
} |
| 1621 |
|
| 1622 |
$product_sku = $_product->get_sku(); |
| 1623 |
$product_permalink = apply_filters( 'woocommerce_cart_item_permalink', $_product->is_visible() ? $_product->get_permalink( $values ) : '', $values, $item ); |
| 1624 |
?> |
| 1625 |
|
| 1626 |
<tr> |
| 1627 |
<td class="usk-product-remove" |
| 1628 |
data-title="<?php esc_html_e( 'Remove', 'ultimate-store-kit' ); ?>"> |
| 1629 |
<a href="<?php echo esc_url( wc_get_cart_remove_url( $item ) ); ?>" class="remove" |
| 1630 |
aria-label="<?php esc_attr_e( 'Remove this item', 'ultimate-store-kit' ); ?>" |
| 1631 |
data-product_id="<?php echo esc_attr( $values['product_id'] ); ?>" |
| 1632 |
data-product_sku="<?php echo esc_attr( $product_sku ); ?>"> |
| 1633 |
<i class="usk-icon-close"></i> |
| 1634 |
</a> |
| 1635 |
</td> |
| 1636 |
<?php if ( $show_image ) : ?> |
| 1637 |
<td class="usk-product-image" |
| 1638 |
data-title="<?php esc_html_e( 'Image', 'ultimate-store-kit' ); ?>"> |
| 1639 |
<?php |
| 1640 |
$thumbnail = apply_filters( 'woocommerce_cart_item_thumbnail', $_product->get_image(), $values, $item ); |
| 1641 |
|
| 1642 |
if ( ! $product_permalink ) { |
| 1643 |
echo wp_kses_post( $thumbnail ); // PHPCS: XSS ok. |
| 1644 |
} else { |
| 1645 |
printf( '<a href="%s">%s</a>', esc_url( $product_permalink ), wp_kses_post( $thumbnail ) ); // PHPCS: XSS ok. |
| 1646 |
} |
| 1647 |
?> |
| 1648 |
</td> |
| 1649 |
<?php endif; ?> |
| 1650 |
|
| 1651 |
<?php if ( $show_title ) : ?> |
| 1652 |
<td class="usk-product-title" |
| 1653 |
data-title="<?php esc_html_e( 'Product Title', 'ultimate-store-kit' ); ?>"> |
| 1654 |
<?php |
| 1655 |
if ( ! $product_permalink ) { |
| 1656 |
echo wp_kses_post( apply_filters( 'woocommerce_cart_item_name', $_product->get_name(), $values, $item ) . ' ' ); |
| 1657 |
} else { |
| 1658 |
echo wp_kses_post( apply_filters( 'woocommerce_cart_item_name', sprintf( '<a href="%s">%s</a>', esc_url( $product_permalink ), $_product->get_name() ), $values, $item ) ); |
| 1659 |
} |
| 1660 |
|
| 1661 |
do_action( 'woocommerce_after_cart_item_name', $values, $item ); |
| 1662 |
|
| 1663 |
// Meta data. |
| 1664 |
echo wp_kses_post( wc_get_formatted_cart_item_data( $values ) ); // PHPCS: XSS ok. |
| 1665 |
|
| 1666 |
// Backorder notification. |
| 1667 |
if ( $_product->backorders_require_notification() && $_product->is_on_backorder( $values['quantity'] ) ) { |
| 1668 |
echo wp_kses_post( apply_filters( 'woocommerce_cart_item_backorder_notification', '<p class="backorder_notification">' . esc_html__( 'Available on backorder', 'ultimate-store-kit' ) . '</p>', $_product ) ); |
| 1669 |
} |
| 1670 |
?> |
| 1671 |
</td> |
| 1672 |
<?php endif; ?> |
| 1673 |
|
| 1674 |
<?php if ( $show_price ) : ?> |
| 1675 |
<td class="usk-product-price" data-title="<?php esc_attr_e( 'Price', 'ultimate-store-kit' ); ?>"> |
| 1676 |
<?php |
| 1677 |
echo wp_kses_post( apply_filters( 'woocommerce_cart_item_price', WC()->cart->get_product_price( $_product ), $values, $item ) ); // PHPCS: XSS ok. |
| 1678 |
?> |
| 1679 |
</td> |
| 1680 |
<?php endif; ?> |
| 1681 |
|
| 1682 |
<?php if ( $show_quantity ) : ?> |
| 1683 |
<td class="usk-product-quantity" |
| 1684 |
data-title="<?php esc_html_e( 'Quantity', 'ultimate-store-kit' ); ?>"> |
| 1685 |
<?php |
| 1686 |
|
| 1687 |
if ( $_product->is_sold_individually() ) { |
| 1688 |
$product_quantity = sprintf( '1 <input type="hidden" name="cart[%s][qty]" value="1" />', $item ); |
| 1689 |
} else { |
| 1690 |
$product_quantity = woocommerce_quantity_input( |
| 1691 |
array( |
| 1692 |
'input_name' => "cart[{$item}][qty]", |
| 1693 |
'input_value' => $values['quantity'], |
| 1694 |
'max_value' => $_product->get_max_purchase_quantity(), |
| 1695 |
'min_value' => '0', |
| 1696 |
'product_name' => $_product->get_name(), |
| 1697 |
), |
| 1698 |
$_product, |
| 1699 |
false |
| 1700 |
); |
| 1701 |
} |
| 1702 |
|
| 1703 |
echo apply_filters( 'woocommerce_cart_item_quantity', $product_quantity, $item, $values ); // PHPCS: XSS ok. |
| 1704 |
|
| 1705 |
?> |
| 1706 |
</td> |
| 1707 |
<?php endif; ?> |
| 1708 |
|
| 1709 |
<?php if ( $show_subtotal ) : ?> |
| 1710 |
<td class="usk-product-subtotal" |
| 1711 |
data-title="<?php esc_html_e( 'Subtotal', 'ultimate-store-kit' ); ?>"> |
| 1712 |
<?php |
| 1713 |
echo wp_kses_post( apply_filters( 'woocommerce_cart_item_subtotal', WC()->cart->get_product_subtotal( $_product, $values['quantity'] ), $values, $item ) ); // PHPCS: XSS ok. |
| 1714 |
?> |
| 1715 |
</td> |
| 1716 |
<?php endif; ?> |
| 1717 |
|
| 1718 |
</tr> |
| 1719 |
|
| 1720 |
<?php |
| 1721 |
} |
| 1722 |
|
| 1723 |
?> |
| 1724 |
<tr> |
| 1725 |
<td colspan="<?php echo esc_attr( (string) $column_count ); ?>" class="actions"> |
| 1726 |
<?php if ( wc_coupons_enabled() ) { ?> |
| 1727 |
<div class="coupon"> |
| 1728 |
<label for="coupon_code"><?php esc_html_e( 'Coupon:', 'ultimate-store-kit' ); ?></label> |
| 1729 |
<input type="text" name="coupon_code" class="input-text" id="coupon_code" value="" |
| 1730 |
placeholder="<?php esc_attr_e( 'Coupon code', 'ultimate-store-kit' ); ?>" /> |
| 1731 |
<button type="submit" class="button" name="apply_coupon" |
| 1732 |
value="<?php esc_attr_e( 'Apply coupon', 'ultimate-store-kit' ); ?>"><?php esc_attr_e( 'Apply coupon', 'ultimate-store-kit' ); ?></button> |
| 1733 |
<?php do_action( 'woocommerce_cart_coupon' ); ?> |
| 1734 |
</div> |
| 1735 |
<?php } ?> |
| 1736 |
|
| 1737 |
<button type="submit" class="button" name="update_cart" |
| 1738 |
value="<?php esc_attr_e( 'Update cart', 'ultimate-store-kit' ); ?>"><?php esc_html_e( 'Update cart', 'ultimate-store-kit' ); ?> |
| 1739 |
|
| 1740 |
</button> |
| 1741 |
|
| 1742 |
<?php do_action( 'woocommerce_cart_actions' ); ?> |
| 1743 |
|
| 1744 |
<?php wp_nonce_field( 'woocommerce-cart', 'woocommerce-cart-nonce' ); ?> |
| 1745 |
</td> |
| 1746 |
</tr> |
| 1747 |
</tbody> |
| 1748 |
</table> |
| 1749 |
|
| 1750 |
</form> |
| 1751 |
|
| 1752 |
<div class="cart-collaterals"> |
| 1753 |
<?php |
| 1754 |
/** |
| 1755 |
* Cart collaterals hook. |
| 1756 |
* |
| 1757 |
* @hooked woocommerce_cross_sell_display |
| 1758 |
* @hooked woocommerce_cart_totals - 10 |
| 1759 |
*/ |
| 1760 |
do_action( 'woocommerce_cart_collaterals' ); |
| 1761 |
?> |
| 1762 |
</div> |
| 1763 |
<?php endif; ?> |
| 1764 |
|
| 1765 |
</div> |
| 1766 |
</div> |
| 1767 |
|
| 1768 |
<?php } |
| 1769 |
} |
| 1770 |
|