Conflicts:
	readme.txt
This commit is contained in:
Coen Jacobs 2013-05-13 16:13:47 +02:00
commit 2f5f631dee
13 changed files with 63 additions and 105 deletions

View File

@ -466,28 +466,6 @@ function woocommerce_shop_order_search_custom_fields( $wp ) {
esc_attr( $_GET['s'] ) esc_attr( $_GET['s'] )
) )
), ),
$wpdb->get_col(
$wpdb->prepare( "
SELECT posts.ID
FROM {$wpdb->posts} as posts
LEFT JOIN {$wpdb->postmeta} as postmeta ON posts.ID = postmeta.post_id
LEFT JOIN {$wpdb->users} as users ON postmeta.meta_value = users.ID
WHERE
post_excerpt LIKE '%%%1\$s%%' OR
post_title LIKE '%%%1\$s%%' OR
(
meta_key = '_customer_user' AND
(
user_login LIKE '%%%1\$s%%' OR
user_nicename LIKE '%%%1\$s%%' OR
user_email LIKE '%%%1\$s%%' OR
display_name LIKE '%%%1\$s%%'
)
)
",
esc_attr( $_GET['s'] )
)
),
array( $search_order_id ) array( $search_order_id )
); );

View File

@ -619,7 +619,7 @@ class WC_Countries {
$full_country = ( isset( $this->countries[ $country ] ) ) ? $this->countries[ $country ] : $country; $full_country = ( isset( $this->countries[ $country ] ) ) ? $this->countries[ $country ] : $country;
// Country is not needed if the same as base // Country is not needed if the same as base
if ( $country == $this->get_base_country() ) if ( $country == $this->get_base_country() && ! apply_filters( 'woocommerce_formatted_address_force_country_display', false ) )
$format = str_replace( '{country}', '', $format ); $format = str_replace( '{country}', '', $format );
// Handle full state name // Handle full state name

View File

@ -306,7 +306,7 @@ class WC_Gateway_Paypal extends WC_Payment_Gateway {
} }
// If prices include tax or have order discounts, send the whole order as a single item // If prices include tax or have order discounts, send the whole order as a single item
if ( get_option( 'woocommerce_prices_include_tax' ) == 'yes' || $order->get_order_discount() > 0 ) { if ( get_option( 'woocommerce_prices_include_tax' ) == 'yes' || $order->get_order_discount() > 0 || ( sizeof( $order->get_items() ) + sizeof( $order->get_fees() ) ) >= 9 ) {
// Discount // Discount
$paypal_args['discount_amount_cart'] = $order->get_order_discount(); $paypal_args['discount_amount_cart'] = $order->get_order_discount();

View File

@ -109,13 +109,7 @@ class WC_Widget_Best_Sellers extends WP_Widget {
while ( $r->have_posts()) { while ( $r->have_posts()) {
$r->the_post(); $r->the_post();
global $product; woocommerce_get_template( 'content-widget-product.php' );
echo '<li>
<a href="' . get_permalink() . '">
' . ( has_post_thumbnail() ? get_the_post_thumbnail( $r->post->ID, 'shop_thumbnail' ) : woocommerce_placeholder_img( 'shop_thumbnail' ) ) . ' ' . get_the_title() . '
</a> ' . $product->get_price_html() . '
</li>';
} }
echo '</ul>'; echo '</ul>';

View File

@ -91,23 +91,24 @@ class WC_Widget_Featured_Products extends WP_Widget {
$r = new WP_Query($query_args); $r = new WP_Query($query_args);
if ($r->have_posts()) : ?> if ( $r->have_posts() ) {
<?php echo $before_widget; ?> echo $before_widget;
<?php if ( $title ) echo $before_title . $title . $after_title; ?>
<ul class="product_list_widget">
<?php while ($r->have_posts()) : $r->the_post(); global $product; ?>
<li><a href="<?php echo esc_url( get_permalink( $r->post->ID ) ); ?>" title="<?php echo esc_attr($r->post->post_title ? $r->post->post_title : $r->post->ID); ?>"> if ( $title )
<?php echo $product->get_image(); ?> echo $before_title . $title . $after_title;
<?php if ( $r->post->post_title ) echo get_the_title( $r->post->ID ); else echo $r->post->ID; ?>
</a> <?php echo $product->get_price_html(); ?></li>
<?php endwhile; ?> echo '<ul class="product_list_widget">';
</ul>
<?php echo $after_widget; ?>
<?php endif; while ( $r->have_posts() ) {
$r->the_post();
woocommerce_get_template( 'content-widget-product.php' );
}
echo '</ul>';
echo $after_widget;
}
$content = ob_get_clean(); $content = ob_get_clean();

View File

@ -105,13 +105,7 @@ class WC_Widget_Onsale extends WP_Widget {
while ( $r->have_posts() ) { while ( $r->have_posts() ) {
$r->the_post(); $r->the_post();
global $product; woocommerce_get_template( 'content-widget-product.php' );
echo '<li>
<a href="' . get_permalink() . '">
' . ( has_post_thumbnail() ? get_the_post_thumbnail( $r->post->ID, 'shop_thumbnail' ) : woocommerce_placeholder_img( 'shop_thumbnail' ) ) . ' ' . get_the_title() . '
</a> ' . $product->get_price_html() . '
</li>';
} }
echo '</ul>'; echo '</ul>';

View File

@ -42,6 +42,8 @@ class WC_Widget_Random_Products extends WP_Widget {
function widget( $args, $instance ) { function widget( $args, $instance ) {
global $woocommerce; global $woocommerce;
extract( $args) ;
// Use default title as fallback // Use default title as fallback
$title = ( '' === $instance['title'] ) ? __('Random Products', 'woocommerce' ) : $instance['title']; $title = ( '' === $instance['title'] ) ? __('Random Products', 'woocommerce' ) : $instance['title'];
$title = apply_filters('widget_title', $title, $instance, $this->id_base); $title = apply_filters('widget_title', $title, $instance, $this->id_base);
@ -65,34 +67,25 @@ class WC_Widget_Random_Products extends WP_Widget {
$query_args['meta_query'][] = $woocommerce->query->stock_status_meta_query(); $query_args['meta_query'][] = $woocommerce->query->stock_status_meta_query();
$query_args['meta_query'] = array_filter( $query_args['meta_query'] ); $query_args['meta_query'] = array_filter( $query_args['meta_query'] );
$query = new WP_Query( $query_args ); $r = new WP_Query( $query_args );
if ( $query->have_posts() ) { if ( $r->have_posts() ) {
echo $args['before_widget'];
if ( '' !== $title ) { echo $before_widget;
echo $args['before_title'], $title, $args['after_title'];
} ?>
<ul class="product_list_widget"> if ( $title )
<?php while ($query->have_posts()) : $query->the_post(); global $product; ?> echo $before_title . $title . $after_title;
<li>
<a href="<?php the_permalink() ?>">
<?php
if ( has_post_thumbnail() )
the_post_thumbnail( 'shop_thumbnail' );
else
echo woocommerce_placeholder_img( 'shop_thumbnail' );
?>
<?php the_title() ?>
</a>
<?php echo $product->get_price_html() ?>
</li>
<?php endwhile; ?>
</ul>
<?php echo '<ul class="product_list_widget">';
echo $args['after_widget'];
while ( $r->have_posts() ) {
$r->the_post();
woocommerce_get_template( 'content-widget-product.php' );
}
echo '</ul>';
echo $after_widget;
} }
} }

View File

@ -102,13 +102,7 @@ class WC_Widget_Recent_Products extends WP_Widget {
while ( $r->have_posts()) { while ( $r->have_posts()) {
$r->the_post(); $r->the_post();
global $product; woocommerce_get_template( 'content-widget-product.php' );
echo '<li>
<a href="' . get_permalink() . '">
' . ( has_post_thumbnail() ? get_the_post_thumbnail( $r->post->ID, 'shop_thumbnail' ) : woocommerce_placeholder_img( 'shop_thumbnail' ) ) . ' ' . get_the_title() . '
</a> ' . $product->get_price_html() . '
</li>';
} }
echo '</ul>'; echo '</ul>';

View File

@ -100,13 +100,7 @@ class WC_Widget_Recently_Viewed extends WP_Widget {
while ( $r->have_posts()) { while ( $r->have_posts()) {
$r->the_post(); $r->the_post();
global $product; woocommerce_get_template( 'content-widget-product.php' );
echo '<li>
<a href="' . get_permalink() . '">
' . ( has_post_thumbnail() ? get_the_post_thumbnail( $r->post->ID, 'shop_thumbnail' ) : woocommerce_placeholder_img( 'shop_thumbnail' ) ) . ' ' . get_the_title() . '
</a> ' . $product->get_price_html() . '
</li>';
} }
echo '</ul>'; echo '</ul>';

View File

@ -81,27 +81,26 @@ class WC_Widget_Top_Rated_Products extends WP_Widget {
$query_args['meta_query'] = $woocommerce->query->get_meta_query(); $query_args['meta_query'] = $woocommerce->query->get_meta_query();
$top_rated_posts = new WP_Query( $query_args ); $r = new WP_Query( $query_args );
if ($top_rated_posts->have_posts()) : if ( $r->have_posts() ) {
echo $before_widget; echo $before_widget;
if ( $title ) echo $before_title . $title . $after_title; if ( $title )
?> echo $before_title . $title . $after_title;
<ul class="product_list_widget">
<?php while ($top_rated_posts->have_posts()) : $top_rated_posts->the_post(); global $product; echo '<ul class="product_list_widget">';
?>
<li><a href="<?php echo esc_url( get_permalink( $top_rated_posts->post->ID ) ); ?>" title="<?php echo esc_attr($top_rated_posts->post->post_title ? $top_rated_posts->post->post_title : $top_rated_posts->post->ID); ?>"> while ( $r->have_posts() ) {
<?php echo $product->get_image(); ?> $r->the_post();
<?php if ( $top_rated_posts->post->post_title ) echo get_the_title( $top_rated_posts->post->ID ); else echo $top_rated_posts->post->ID; ?> woocommerce_get_template( 'content-widget-product.php', array( 'show_rating' => true ) );
</a> <?php echo $product->get_rating_html(); ?><?php echo $product->get_price_html(); ?></li> }
echo '</ul>';
<?php endwhile; ?>
</ul>
<?php
echo $after_widget; echo $after_widget;
endif; }
wp_reset_query(); wp_reset_query();
remove_filter( 'posts_clauses', array( $woocommerce->query, 'order_by_rating_post_clauses' ) ); remove_filter( 'posts_clauses', array( $woocommerce->query, 'order_by_rating_post_clauses' ) );

View File

@ -174,6 +174,7 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc
* Tweak - COD processing instead of on-hold * Tweak - COD processing instead of on-hold
* Tweak - Added filter to explicitly hide terms agreement checkbox * Tweak - Added filter to explicitly hide terms agreement checkbox
* Tweak - New System Status report layout, now plugin list is better visually and very better to read * Tweak - New System Status report layout, now plugin list is better visually and very better to read
* Tweak - content-widget-product.php template for product lists inside core widgets
* Fix - Cast term_id as int in product data write panel that will resolve issues with numerical attributes * Fix - Cast term_id as int in product data write panel that will resolve issues with numerical attributes
* Fix - Correct label for RUB symbol - added a dot after it * Fix - Correct label for RUB symbol - added a dot after it
* Fix - Javascript escapes to stop breaking scripts when used with translations * Fix - Javascript escapes to stop breaking scripts when used with translations
@ -184,6 +185,7 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc
* Fix - is_on_sale() method now returns true for products with a sale product of 0 * Fix - is_on_sale() method now returns true for products with a sale product of 0
* Fix - Changed MyException to Exception in Checkout class as MyException class does not exist in WooCommerce * Fix - Changed MyException to Exception in Checkout class as MyException class does not exist in WooCommerce
* Fix - For when get_the_terms() returns false inside woocommerce_get_product_terms() * Fix - For when get_the_terms() returns false inside woocommerce_get_product_terms()
* Fix - PayPal has a 9 item limit.
* Refactor - Taken out Piwik integration, use http://wordpress.org/extend/plugins/woocommerce-piwik-integration/ from now on * Refactor - Taken out Piwik integration, use http://wordpress.org/extend/plugins/woocommerce-piwik-integration/ from now on
* Refactor - Taken out ShareYourCart integration, use http://wordpress.org/extend/plugins/shareyourcart/ from now on * Refactor - Taken out ShareYourCart integration, use http://wordpress.org/extend/plugins/shareyourcart/ from now on
* Refactor - Moved woocommerce_get_formatted_product_name function into WC_Product class * Refactor - Moved woocommerce_get_formatted_product_name function into WC_Product class

View File

@ -0,0 +1,9 @@
<?php global $product; ?>
<li>
<a href="<?php echo esc_url( get_permalink( $product->id ) ); ?>" title="<?php echo esc_attr( $product->get_title() ); ?>">
<?php echo $product->get_image(); ?>
<?php echo $product->get_title() ?>
</a>
<?php if ( ! empty( $show_rating ) ) echo $product->get_rating_html(); ?>
<?php echo $product->get_price_html(); ?>
</li>