woo_widget_cssclass = 'widget_shopping_cart'; $this->woo_widget_description = __( 'Display the users Shopping Cart in the sidebar.', 'woothemes' ); $this->woo_widget_idbase = 'woocommerce_shopping_cart'; $this->woo_widget_name = __('WooCommerce Shopping Cart', 'woothemes' ); /* Widget settings. */ $widget_ops = array( 'classname' => $this->woo_widget_cssclass, 'description' => $this->woo_widget_description ); /* Create the widget. */ $this->WP_Widget('shopping_cart', $this->woo_widget_name, $widget_ops); } /** @see WP_Widget::widget */ function widget( $args, $instance ) { if (is_cart()) return; extract($args); if ( !empty($instance['title']) ) $title = $instance['title']; else $title = __('Cart', 'woothemes'); $title = apply_filters('widget_title', $title, $instance, $this->id_base); echo $before_widget; if ( $title ) echo $before_title . $title . $after_title; echo '
'; if (sizeof(woocommerce_cart::$cart_contents)>0) : echo ''; if (get_option('js_prices_include_tax')=='yes') : _e('Total', 'woothemes'); else : _e('Subtotal', 'woothemes'); endif; echo ': '.woocommerce_cart::get_cart_total(); echo '
'; do_action( 'woocommerce_widget_shopping_cart_before_buttons' ); echo ' '; endif; echo $after_widget; } /** @see WP_Widget::update */ function update( $new_instance, $old_instance ) { $instance['title'] = strip_tags(stripslashes($new_instance['title'])); return $instance; } /** @see WP_Widget::form */ function form( $instance ) { ?>