𝗖𝗨𝗥𝗥𝗘𝗡𝗧 𝗙𝗜𝗟𝗘 : /home/builxejc/public_html/wp-content/plugins/kinsley-plugin/elementor/widgets//cart.php
<?php
namespace Elementor;
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
/**
* Kinsley Header Cart Widget.
*
* @since 1.0
*/
class Kinsley_Cart_Widget extends Widget_Base {
public function get_name() {
return 'kinsley-cart';
}
public function get_title() {
return esc_html__( 'Header Cart', 'kinsley-plugin' );
}
public function get_icon() {
return 'eicon-parallax';
}
public function get_categories() {
return [ 'kinsley-category' ];
}
/**
* Register widget controls.
*
* @since 1.0
*/
protected function register_controls() {
$this->start_controls_section(
'content_tab',
[
'label' => esc_html__( 'Content', 'kinsley-plugin' ),
'tab' => Controls_Manager::TAB_CONTENT,
]
);
$this->add_responsive_control(
'align',
[
'label' => __( 'Alignment', 'kinsley-plugin' ),
'type' => Controls_Manager::CHOOSE,
'options' => [
'left' => [
'title' => __( 'Left', 'kinsley-plugin' ),
'icon' => 'eicon-text-align-left',
],
'center' => [
'title' => __( 'Center', 'kinsley-plugin' ),
'icon' => 'eicon-text-align-center',
],
'right' => [
'title' => __( 'Right', 'kinsley-plugin' ),
'icon' => 'eicon-text-align-right',
],
],
'selectors' => [
'{{WRAPPER}} .elementor-widget-container' => 'text-align: {{VALUE}};',
],
'default' => 'right',
]
);
$this->end_controls_section();
$this->start_controls_section(
'content_styling',
[
'label' => esc_html__( 'Header Popup Menu', 'kinsley-plugin' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_control(
'menu_btn_color',
[
'label' => esc_html__( 'Icon Color', 'kinsley-plugin' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .knsl-cart svg path' => 'fill: {{VALUE}};',
],
]
);
$this->add_control(
'menu_btn_a_color',
[
'label' => esc_html__( 'Icon Color (Opened)', 'kinsley-plugin' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'.header--active {{WRAPPER}} .knsl-cart svg path' => 'fill: {{VALUE}} !important;',
],
]
);
$this->end_controls_section();
}
/**
* Render widget output on the frontend.
*
* @since 1.0
*/
protected function render() {
$settings = $this->get_settings_for_display();
?>
<?php if ( class_exists( 'WooCommerce' ) ) : ?>
<?php if ( true == get_theme_mod( 'cart_shop', true ) ) : if ( is_object( WC()->cart ) ) : ?>
<!-- cart button -->
<div class="knsl-minicart knsl-minicart-custom">
<!-- minicart button -->
<div class="knsl-cart">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24px" height="26px" viewBox="0 0 24 26" version="1.1">
<path d="M12,0 C9.253906,0 7,2.253906 7,5 L7,6 L2.0625,6 L2,6.9375 L1,24.9375 L0.9375,26 L23.0625,26 L23,24.9375 L22,6.9375 L21.9375,6 L17,6 L17,5 C17,2.253906 14.746094,0 12,0 Z M12,2 C13.65625,2 15,3.34375 15,5 L15,6 L9,6 L9,5 C9,3.34375 10.34375,2 12,2 Z M3.9375,8 L7,8 L7,11 L9,11 L9,8 L15,8 L15,11 L17,11 L17,8 L20.0625,8 L20.9375,24 L3.0625,24 L3.9375,8 Z" />
</svg>
<div class="knsl-cart-number">
<span class="cart-count"><?php echo sprintf (_n( '%d', '%d', WC()->cart->get_cart_contents_count(), 'kinsley-plugin' ), WC()->cart->get_cart_contents_count() ); ?></span>
</div>
</div>
<!-- minicart button end -->
<!-- minicart -->
<div class="knsl-minicart-window">
<div class="cart-widget">
<?php if ( is_object( WC()->cart ) ) : woocommerce_mini_cart(); endif; ?>
</div>
</div>
<!-- minicart end -->
</div>
<!-- cart button end -->
<?php endif; endif; ?>
<?php endif; ?>
<?php
}
}
Plugin::instance()->widgets_manager->register( new Kinsley_Cart_Widget() );