/** * Constructor */ public function __construct() { $this->widget_cssclass = 'woocommerce widget_shopping_cart'; $this->widget_description = esc_html__("Display the user's Cart in the sidebar.", 'greek'); $this->widget_id = 'woocommerce_widget_cart'; $this->widget_name = esc_html__('WooCommerce Cart', 'greek'); $this->settings = array('title' => array('type' => 'text', 'std' => esc_html__('Cart', 'greek'), 'label' => esc_html__('Title', 'greek')), 'hide_if_empty' => array('type' => 'checkbox', 'std' => 0, 'label' => esc_html__('Hide if cart is empty', 'greek'))); parent::__construct(); }
function form($instance) { parent::form($instance); $show_cart_icon = empty($instance['show_cart_icon']) ? 0 : 1; ?> <p><input type="checkbox" class="checkbox" id="<?php echo esc_attr($this->get_field_id('show_cart_icon')); ?> " name="<?php echo esc_attr($this->get_field_name('show_cart_icon')); ?> "<?php checked($show_cart_icon); ?> /> <label for="<?php echo $this->get_field_id('show_cart_icon'); ?> "><?php _e('Display cart icon', 'woocommerce'); ?> </label></p> <?php }
<a href="<?php echo get_permalink(wc_get_page_id('cart')); ?> " title="View my shopping cart" rel="nofollow" class="cart-contentsxxx"> <span class="ajax_cart_no_product"><?php echo WC()->cart->cart_contents_count; ?> </span> </a> <?php if (!is_cart() && !is_checkout() && class_exists("WC_Widget_Cart")) { ?> <div class="cart_block"> <div class="block_content"> <!-- block list of products --> <div class="cart_block_list"> <?php $instance = array('title' => '', 'number' => 999); $args = array('before_widget' => '<div class="widget_shopping_cart woocommerce group">', 'after_widget' => '</div>', 'before_title' => '<h4 class="widget_title">', 'title' => '', 'after_title' => '</h4>'); $prima_minicart = new WC_Widget_Cart(); $prima_minicart->number = $instance['number']; $prima_minicart->widget($args, $instance); ?> </div> </div> </div> <?php } ?> </div>
?> <div class="g1-cartbox"> <a class="g1-cartbox__switch" href="#"> <div class="g1-cartbox__arrow"></div> <strong><?php _ex(' ', 'searchbox switch label', 'g1_theme'); ?> </strong> </a> <div class="g1-cartbox__box"> <div class="g1-inner woocommerce"> <?php $g1_instance = array('title' => '', 'number' => 1); $g1_args = array('title' => '', 'before_widget' => '', 'after_widget' => '', 'before_title' => '<div class="g1-cartbox__title">', 'after_title' => '</div>'); $g1_widget = new WC_Widget_Cart(); $g1_widget->number = $g1_instance['number']; $g1_widget->widget($g1_args, $g1_instance); ?> <p class="g1-cartbox__empty"><?php _e('No products in the cart.', 'woocommerce'); ?> </p> </div> </div> </div> <?php } ?>
<div class="sb-slidebar sb-right sb-style-push"> <?php if (class_exists('woocommerce')) { $instance = array('title' => 'My Cart', 'number' => 999); $args = array('before_widget' => '<div class="widget widget_shopping_cart woocommerce group">', 'after_widget' => '</div>', 'before_title' => '<h4 class="widget_title">', 'after_title' => '</h4>'); $tp_minicart = new WC_Widget_Cart(); $tp_minicart->number = $instance['number']; $tp_minicart->widget($args, $instance); } ?> </div>