Merge branch 'master' of https://github.com/woothemes/woocommerce
Conflicts: readme.txt
This commit is contained in:
commit
2f5f631dee
|
@ -466,28 +466,6 @@ function woocommerce_shop_order_search_custom_fields( $wp ) {
|
|||
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 )
|
||||
);
|
||||
|
||||
|
|
|
@ -619,7 +619,7 @@ class WC_Countries {
|
|||
$full_country = ( isset( $this->countries[ $country ] ) ) ? $this->countries[ $country ] : $country;
|
||||
|
||||
// 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 );
|
||||
|
||||
// Handle full state name
|
||||
|
|
|
@ -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 ( 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
|
||||
$paypal_args['discount_amount_cart'] = $order->get_order_discount();
|
||||
|
|
|
@ -109,13 +109,7 @@ class WC_Widget_Best_Sellers extends WP_Widget {
|
|||
|
||||
while ( $r->have_posts()) {
|
||||
$r->the_post();
|
||||
global $product;
|
||||
|
||||
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>';
|
||||
woocommerce_get_template( 'content-widget-product.php' );
|
||||
}
|
||||
|
||||
echo '</ul>';
|
||||
|
|
|
@ -91,23 +91,24 @@ class WC_Widget_Featured_Products extends WP_Widget {
|
|||
|
||||
$r = new WP_Query($query_args);
|
||||
|
||||
if ($r->have_posts()) : ?>
|
||||
if ( $r->have_posts() ) {
|
||||
|
||||
<?php 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; ?>
|
||||
echo $before_widget;
|
||||
|
||||
<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); ?>">
|
||||
<?php echo $product->get_image(); ?>
|
||||
<?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>
|
||||
if ( $title )
|
||||
echo $before_title . $title . $after_title;
|
||||
|
||||
<?php endwhile; ?>
|
||||
</ul>
|
||||
<?php echo $after_widget; ?>
|
||||
echo '<ul class="product_list_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();
|
||||
|
||||
|
|
|
@ -105,13 +105,7 @@ class WC_Widget_Onsale extends WP_Widget {
|
|||
|
||||
while ( $r->have_posts() ) {
|
||||
$r->the_post();
|
||||
global $product;
|
||||
|
||||
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>';
|
||||
woocommerce_get_template( 'content-widget-product.php' );
|
||||
}
|
||||
|
||||
echo '</ul>';
|
||||
|
|
|
@ -42,6 +42,8 @@ class WC_Widget_Random_Products extends WP_Widget {
|
|||
function widget( $args, $instance ) {
|
||||
global $woocommerce;
|
||||
|
||||
extract( $args) ;
|
||||
|
||||
// Use default title as fallback
|
||||
$title = ( '' === $instance['title'] ) ? __('Random Products', 'woocommerce' ) : $instance['title'];
|
||||
$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'] = array_filter( $query_args['meta_query'] );
|
||||
|
||||
$query = new WP_Query( $query_args );
|
||||
$r = new WP_Query( $query_args );
|
||||
|
||||
if ( $query->have_posts() ) {
|
||||
echo $args['before_widget'];
|
||||
if ( $r->have_posts() ) {
|
||||
|
||||
if ( '' !== $title ) {
|
||||
echo $args['before_title'], $title, $args['after_title'];
|
||||
} ?>
|
||||
echo $before_widget;
|
||||
|
||||
<ul class="product_list_widget">
|
||||
<?php while ($query->have_posts()) : $query->the_post(); global $product; ?>
|
||||
<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>
|
||||
if ( $title )
|
||||
echo $before_title . $title . $after_title;
|
||||
|
||||
<?php
|
||||
echo $args['after_widget'];
|
||||
echo '<ul class="product_list_widget">';
|
||||
|
||||
while ( $r->have_posts() ) {
|
||||
$r->the_post();
|
||||
woocommerce_get_template( 'content-widget-product.php' );
|
||||
}
|
||||
|
||||
echo '</ul>';
|
||||
|
||||
echo $after_widget;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -102,13 +102,7 @@ class WC_Widget_Recent_Products extends WP_Widget {
|
|||
|
||||
while ( $r->have_posts()) {
|
||||
$r->the_post();
|
||||
global $product;
|
||||
|
||||
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>';
|
||||
woocommerce_get_template( 'content-widget-product.php' );
|
||||
}
|
||||
|
||||
echo '</ul>';
|
||||
|
|
|
@ -78,7 +78,7 @@ class WC_Widget_Recent_Reviews extends WP_Widget {
|
|||
if ( $title ) echo $before_title . $title . $after_title;
|
||||
echo '<ul class="product_list_widget">';
|
||||
|
||||
foreach ( (array) $comments as $comment) {
|
||||
foreach ( (array) $comments as $comment ) {
|
||||
|
||||
$_product = get_product( $comment->comment_post_ID );
|
||||
|
||||
|
|
|
@ -100,13 +100,7 @@ class WC_Widget_Recently_Viewed extends WP_Widget {
|
|||
|
||||
while ( $r->have_posts()) {
|
||||
$r->the_post();
|
||||
global $product;
|
||||
|
||||
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>';
|
||||
woocommerce_get_template( 'content-widget-product.php' );
|
||||
}
|
||||
|
||||
echo '</ul>';
|
||||
|
|
|
@ -81,27 +81,26 @@ class WC_Widget_Top_Rated_Products extends WP_Widget {
|
|||
|
||||
$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;
|
||||
|
||||
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;
|
||||
?>
|
||||
<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); ?>">
|
||||
<?php echo $product->get_image(); ?>
|
||||
<?php if ( $top_rated_posts->post->post_title ) echo get_the_title( $top_rated_posts->post->ID ); else echo $top_rated_posts->post->ID; ?>
|
||||
</a> <?php echo $product->get_rating_html(); ?><?php echo $product->get_price_html(); ?></li>
|
||||
if ( $title )
|
||||
echo $before_title . $title . $after_title;
|
||||
|
||||
echo '<ul class="product_list_widget">';
|
||||
|
||||
while ( $r->have_posts() ) {
|
||||
$r->the_post();
|
||||
woocommerce_get_template( 'content-widget-product.php', array( 'show_rating' => true ) );
|
||||
}
|
||||
|
||||
echo '</ul>';
|
||||
|
||||
<?php endwhile; ?>
|
||||
</ul>
|
||||
<?php
|
||||
echo $after_widget;
|
||||
endif;
|
||||
}
|
||||
|
||||
wp_reset_query();
|
||||
remove_filter( 'posts_clauses', array( $woocommerce->query, 'order_by_rating_post_clauses' ) );
|
||||
|
|
|
@ -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 - 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 - 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 - Correct label for RUB symbol - added a dot after it
|
||||
* 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 - 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 - 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 ShareYourCart integration, use http://wordpress.org/extend/plugins/shareyourcart/ from now on
|
||||
* Refactor - Moved woocommerce_get_formatted_product_name function into WC_Product class
|
||||
|
|
|
@ -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>
|
Loading…
Reference in New Issue