Recent reviews fix, start on recently viewed widget

This commit is contained in:
Mike Jolley 2011-08-29 13:48:50 +01:00
parent 78d254a4ae
commit d2596ddeea
3 changed files with 5 additions and 5 deletions

View File

@ -44,7 +44,7 @@ class WooCommerce_Widget_Cart extends WP_Widget {
echo $before_widget;
if ( $title ) echo $before_title . $title . $after_title;
echo '<ul class="cart_list">';
echo '<ul class="cart_list product_list_widget">';
if (sizeof(woocommerce_cart::$cart_contents)>0) : foreach (woocommerce_cart::$cart_contents as $cart_item_key => $cart_item) :
$_product = $cart_item['data'];
if ($_product->exists() && $cart_item['quantity']>0) :

View File

@ -39,7 +39,7 @@ class WooCommerce_Widget_Recent_Reviews extends WP_Widget {
function widget( $args, $instance ) {
global $comments, $comment;
/*$cache = wp_cache_get('widget_recent_reviews', 'widget');
$cache = wp_cache_get('widget_recent_reviews', 'widget');
if ( ! is_array( $cache ) )
$cache = array();
@ -47,7 +47,7 @@ class WooCommerce_Widget_Recent_Reviews extends WP_Widget {
if ( isset( $cache[$args['widget_id']] ) ) {
echo $cache[$args['widget_id']];
return;
}*/
}
ob_start();
extract($args);
@ -55,7 +55,7 @@ class WooCommerce_Widget_Recent_Reviews extends WP_Widget {
$title = apply_filters('widget_title', empty($instance['title']) ? __('Recent Reviews', 'woothemes') : $instance['title'], $instance, $this->id_base);
if ( ! $number = absint( $instance['number'] ) ) $number = 5;
$comments = get_comments( array( 'number' => $number, 'status' => 'approve', 'post_status' => 'publish' ) );
$comments = get_comments( array( 'number' => $number, 'status' => 'approve', 'post_status' => 'publish', 'post_type' => 'product' ) );
if ( $comments ) :
echo $before_widget;
@ -83,7 +83,7 @@ class WooCommerce_Widget_Recent_Reviews extends WP_Widget {
echo $rating_html;
echo sprintf(_x('by %1$s', 'woothemes'), get_comment_author_link()) . '</li>';
echo sprintf(_x('by %1$s', 'woothemes'), get_comment_author()) . '</li>';
endforeach;

View File