start_controls_section( 'style_tab', [ 'label' => __( 'Style', 'sellkit' ), 'tab' => 'style', ] ); $this->add_responsive_control( 'align', [ 'label' => __( 'Alignment', 'sellkit' ), 'type' => 'choose', 'options' => [ 'flex-start' => [ 'title' => __( 'Left', 'sellkit' ), 'icon' => 'fa fa-align-left', ], 'center' => [ 'title' => __( 'Center', 'sellkit' ), 'icon' => 'fa fa-align-center', ], 'flex-end' => [ 'title' => __( 'Right', 'sellkit' ), 'icon' => 'fa fa-align-right', ], ], 'default' => 'start', 'selectors' => [ '{{WRAPPER}} .sellkit-product-quantity-widget' => 'justify-content: {{VALUE}}', ], ] ); $this->add_responsive_control( 'quantity_selector_width', [ 'label' => __( 'Width', 'sellkit' ), 'type' => 'slider', 'size_units' => [ 'px', '%' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 500, ], '%' => [ 'min' => 0, 'max' => 100, ], ], 'default' => [ 'unit' => '%', ], 'tablet_default' => [ 'unit' => '%', ], 'mobile_default' => [ 'unit' => '%', ], 'selectors' => [ '{{WRAPPER}} .sellkit-product-quantity-widget .quantity' => 'width: {{SIZE}}{{UNIT}};', ], ] ); $this->add_control( 'label_color', [ 'label' => __( 'Label Color', 'sellkit' ), 'type' => 'color', 'selectors' => [ '{{WRAPPER}} .sellkit-product-quantity-widget label' => 'color: {{SIZE}};', ], ] ); $this->add_control( 'input_text_color', [ 'label' => __( 'Input Text Color', 'sellkit' ), 'type' => 'color', 'selectors' => [ '{{WRAPPER}} .sellkit-product-quantity-widget input' => 'color: {{SIZE}};', ], ] ); $this->add_group_control( 'typography', [ 'name' => 'input_typography', 'scheme' => '3', 'selector' => '{{WRAPPER}} .sellkit-product-quantity-widget .quantity input, {{WRAPPER}} .sellkit-product-quantity-widget .quantity .screen-reader-text', ] ); $this->add_group_control( 'text-shadow', [ 'name' => 'text_shadow', 'fields_options' => [ 'text_shadow_type' => [ 'label' => __( 'Text Shadow', 'sellkit' ), ], ], 'selector' => '{{WRAPPER}} .sellkit-product-quantity-widget .quantity input, {{WRAPPER}} .sellkit-product-quantity-widget .quantity label', ] ); $this->end_controls_section(); } protected function render() { global $product; // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- WooCommerce template pattern. $product = $this->get_product_object(); if ( empty( $product ) ) { return; } ?>