🔐 Sid Gifari File Manager Pro
v8.0.5 | 2026-06-14 11:20:46 | PHP 8.1.34
📂
/ (Root)
/
home
/
therahul
/
ramailobhela.com
/
wp-content
/
themes
/
nighty
/
elementor
/
widgets
📍 /home/therahul/ramailobhela.com/wp-content/themes/nighty/elementor/widgets
🔄 Refresh
✏️
Editing: menu-cart.php
Writable
<?php use Elementor\Widget_Base; use Elementor\Controls_Manager; use Elementor\Group_Control_Typography; use Elementor\Utils; if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly if ( !nighty_is_woo_active() ) { return ; } class nighty_Elementor_Menu_Cart extends Widget_Base { public function get_name() { return 'nighty_elementor_menu_cart'; } public function get_title() { return esc_html__( 'Menu Cart', 'nighty' ); } public function get_icon() { return 'eicon-cart'; } public function get_categories() { return [ 'hf' ]; } protected function register_controls() { $this->start_controls_section( 'section_content', [ 'label' => esc_html__( 'Content', 'nighty' ), ] ); $this->add_control( 'icon', [ 'label' => esc_html__( 'Icon', 'nighty' ), 'type' => \Elementor\Controls_Manager::ICONS, 'default' => [ 'value' => 'ovaicon ovaicon-shopping-cart-empty-side-view', 'library' => 'all', ], ] ); $this->add_control( 'text_empty', [ 'label' => esc_html__( 'Text Empty', 'nighty' ), 'type' => \Elementor\Controls_Manager::TEXT, 'default' => esc_html__( 'Your Cart is Empty', 'nighty' ), ] ); $this->end_controls_section(); $this->start_controls_section( 'section_icon', [ 'label' => esc_html__( 'Icon', 'nighty' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_responsive_control( 'icon_size', [ 'label' => esc_html__( 'Size', 'nighty' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, 'step' => 1, ] ], 'selectors' => [ '{{WRAPPER}} .ova-menu-cart .cart-total i' => 'font-size: {{SIZE}}{{UNIT}};', ], ] ); $this->add_control( 'color_icon', [ 'label' => esc_html__( 'Color', 'nighty' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-menu-cart .cart-total i' => 'color : {{VALUE}};', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'section_items', [ 'label' => esc_html__( 'Items', 'nighty' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_responsive_control( 'bg_items_size', [ 'label' => esc_html__( 'Background Size', 'nighty' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px' ], 'range' => [ 'px' => [ 'min' => 20, 'max' => 100, 'step' => 1, ] ], 'selectors' => [ '{{WRAPPER}} .ova-menu-cart .cart-total .items' => 'width: {{SIZE}}{{UNIT}};height: {{SIZE}}{{UNIT}};', ], ] ); $this->add_control( 'color_number', [ 'label' => esc_html__( 'Color', 'nighty' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-menu-cart .cart-total .items' => 'color : {{VALUE}};', ], ] ); $this->add_control( 'bgcolor_number', [ 'label' => esc_html__( 'Background Color', 'nighty' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-menu-cart .cart-total .items' => 'background-color : {{VALUE}};', ], ] ); $this->end_controls_section(); } protected function render() { $settings = $this->get_settings(); $text_empty = $settings['text_empty']; ?> <div class="ova-menu-cart"> <div class="cart-total"> <?php \Elementor\Icons_Manager::render_icon( $settings['icon'], [ 'aria-hidden' => 'true' ] ); ?> <span class="items"> <?php echo ( WC()->cart != null && WC()->cart->get_cart_contents_count( ) >= 1 ) ? WC()->cart->get_cart_contents_count( ) : 0; ?> </span> </div> <div class="minicart"> <?php if( WC()->cart != null && WC()->cart->get_cart_contents_count( ) >= 1 ){ woocommerce_mini_cart(); }else{ echo esc_html($text_empty); } ?> </div> </div> <?php } } $widgets_manager->register( new nighty_Elementor_Menu_Cart() );
💾 Save Changes
❌ Cancel