e' => 'yes', 'selectors' => [ '{{WRAPPER}}.elementor-wc-products ul.products li.product span.onsale' => 'display: block', ], ] ); $this->add_control( 'onsale_text_color', [ 'label' => esc_html__( 'Text Color', 'elementor-pro' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}}.elementor-wc-products ul.products li.product span.onsale' => 'color: {{VALUE}}', ], 'condition' => [ 'show_onsale_flash' => 'yes', ], ] ); $this->add_control( 'onsale_text_background_color', [ 'label' => esc_html__( 'Background Color', 'elementor-pro' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}}.elementor-wc-products ul.products li.product span.onsale' => 'background-color: {{VALUE}}', ], 'condition' => [ 'show_onsale_flash' => 'yes', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'onsale_typography', 'selector' => '{{WRAPPER}}.elementor-wc-products ul.products li.product span.onsale', 'condition' => [ 'show_onsale_flash' => 'yes', ], ] ); $this->add_control( 'onsale_border_radius', [ 'label' => esc_html__( 'Border Radius', 'elementor-pro' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ], 'selectors' => [ '{{WRAPPER}}.elementor-wc-products ul.products li.product span.onsale' => 'border-radius: {{SIZE}}{{UNIT}}', ], 'condition' => [ 'show_onsale_flash' => 'yes', ], ] ); $this->add_control( 'onsale_width', [ 'label' => esc_html__( 'Width', 'elementor-pro' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ], 'selectors' => [ '{{WRAPPER}}.elementor-wc-products ul.products li.product span.onsale' => 'min-width: {{SIZE}}{{UNIT}};', ], 'condition' => [ 'show_onsale_flash' => 'yes', ], ] ); $this->add_control( 'onsale_height', [ 'label' => esc_html__( 'Height', 'elementor-pro' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', 'em', 'rem', 'vh', 'custom' ], 'selectors' => [ '{{WRAPPER}}.elementor-wc-products ul.products li.product span.onsale' => 'min-height: {{SIZE}}{{UNIT}}; line-height: {{SIZE}}{{UNIT}};', ], 'condition' => [ 'show_onsale_flash' => 'yes', ], ] ); $this->add_control( 'onsale_horizontal_position', [ 'label' => esc_html__( 'Position', 'elementor-pro' ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'left' => [ 'title' => esc_html__( 'Left', 'elementor-pro' ), 'icon' => 'eicon-h-align-left', ], 'right' => [ 'title' => esc_html__( 'Right', 'elementor-pro' ), 'icon' => 'eicon-h-align-right', ], ], 'selectors' => [ '{{WRAPPER}}.elementor-wc-products ul.products li.product span.onsale' => '{{VALUE}}', ], 'selectors_dictionary' => [ 'left' => 'right: auto; left: 0', 'right' => 'left: auto; right: 0', ], 'condition' => [ 'show_onsale_flash' => 'yes', ], ] ); $this->add_control( 'onsale_distance', [ 'label' => esc_html__( 'Distance', 'elementor-pro' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', 'em', 'rem', 'custom' ], 'range' => [ 'px' => [ 'min' => -20, 'max' => 20, ], 'em' => [ 'min' => -2, 'max' => 2, ], 'rem' => [ 'min' => -2, 'max' => 2, ], ], 'selectors' => [ '{{WRAPPER}}.elementor-wc-products ul.products li.product span.onsale' => 'margin: {{SIZE}}{{UNIT}};', ], 'condition' => [ 'show_onsale_flash' => 'yes', ], ] ); $this->end_controls_section(); } /** * Add To Cart Wrapper * * Add a div wrapper around the Add to Cart & View Cart buttons on the product cards inside the product grid. * The wrapper is used to vertically align the Add to Cart Button and the View Cart link to the bottom of the card. * This wrapper is added when the 'Automatically align buttons' toggle is selected. * Using the 'woocommerce_loop_add_to_cart_link' hook. * * @since 3.7.0 * * @param string $string * @return string $string */ public function add_to_cart_wrapper( $string ) { return '
' . $string . '
'; } }