Your IP : 216.73.216.95


Current Path : /var/www/ooareogundevinitiative/wp-content/themes/pain/framework/widgets/
Upload File :
Current File : /var/www/ooareogundevinitiative/wp-content/themes/pain/framework/widgets/mini_cart.php

<?php

	class jwstheme_Widget_Mini_Cart extends WC_Widget {

		/**

			* Constructor

		*/

		function __construct() {

			$this->widget_cssclass    = 'woocommerce jw_widget_mini_cart';

			$this->widget_description = __( "Display the user's Cart in the sidebar.", 'pain' );

			$this->widget_id          = 'jw_widget_mini_cart';

			$this->widget_name        = __( 'Mini Cart', 'pain' );

			$this->settings           = array(

			'title'  => array(

			'type'  => 'text',

			'std'   => __( 'Cart', 'pain' ),

			'label' => __( 'Title', 'pain' )

			),

			'hide_if_empty' => array(

			'type'  => 'checkbox',

			'std'   => 0,

			'label' => __( 'Hide if cart is empty', 'pain' )

			)

			);

			parent::__construct();

		}

		/**

			* widget function.

			*

			* @see WP_Widget

			*

			* @param array $args

			* @param array $instance

		*/

		function widget( $args, $instance ) {

			/*if ( apply_filters( 'woocommerce_widget_cart_is_hidden', is_cart() || is_checkout() ) ) {

				return;

			}*/

			$hide_if_empty = empty( $instance['hide_if_empty'] ) ? 0 : 1;

			$this->widget_start( $args, $instance );

			if ( $hide_if_empty ) {

				echo '<div class="hide_cart_widget_if_empty">';

			}

			echo '<div class="jw-cart-header"><i class="fa fa-shopping-cart"></i><a class="jw-icon" href="javascript:void(0)"><i class="fa fa-caret-down"></i>

			</a><span class="my-cart"> My Cart </span/> <span class="cart_total" ></span><span class="item"> item </span></div>';

			// Insert cart widget placeholder - code in woocommerce.js will update this on page load

			echo '<div class="jw-cart-content"><h6>'.__('MY SHOPPING CART', 'pain').'</h6><div class="widget_shopping_cart_content"></div></div>';

			if ( $hide_if_empty ) {

				echo '</div>';

			}

			$this->widget_end( $args );

		}

	}

	add_filter('woocommerce_add_to_cart_fragments', 'woocommerce_icon_add_to_cart_fragment');

	if(!function_exists('woocommerce_icon_add_to_cart_fragment')){

		function woocommerce_icon_add_to_cart_fragment( $fragments ) {

			global $woocommerce;

			ob_start();

		?>

		<span class="cart_total"><?php echo wp_kses_post($woocommerce->cart->cart_contents_count); ?></span>

		<?php

			$fragments['span.cart_total'] = ob_get_clean();

			return $fragments;

		}

	}

	/**

		* Class jwstheme_Widget_Mini_Cart

	*/



  if(function_exists('insert_widgets')) {
       function register_jw_widget_mini_cart() {
		    	insert_widgets('jwstheme_Widget_Mini_Cart'); 
	   }
    add_action('widgets_init', 'register_jw_widget_mini_cart');
    }