Allow layered nav to work with non pa_ prepended taxonomies

As committed on master branch:
- f49bd2cd77
This commit is contained in:
Coen Jacobs 2013-05-08 13:30:27 +02:00
parent 6ae41d83b2
commit bcc3dc2c3f
3 changed files with 8 additions and 3 deletions

View File

@ -229,17 +229,20 @@ class WC_Widget_Layered_Nav extends WP_Widget {
foreach ( $_chosen_attributes as $name => $data ) {
if ( $name !== $taxonomy ) {
//exclude query arg for current term archive term
// Exclude query arg for current term archive term
while ( in_array( $current_term, $data['terms'] ) ) {
$key = array_search( $current_term, $data );
unset( $data['terms'][$key] );
}
// Remove pa_ and sanitize
$filter_name = sanitize_title( str_replace( 'pa_', '', $name ) );
if ( ! empty( $data['terms'] ) )
$link = add_query_arg( sanitize_title( str_replace( 'pa_', 'filter_', $name ) ), implode(',', $data['terms']), $link );
$link = add_query_arg( 'filter_' . $filter_name, implode( ',', $data['terms'] ), $link );
if ( $data['query_type'] == 'or' )
$link = add_query_arg( sanitize_title( str_replace( 'pa_', 'query_type_', $name ) ), 'or', $link );
$link = add_query_arg( 'query_type_' . $filter_name, 'or', $link );
}
}
}

View File

@ -172,6 +172,7 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc
* Fix - Javascript escapes to stop breaking scripts when used with translations
* Fix - PayPal button should use classes 'button' and 'alt', not 'button-alt'
* Fix - Have the remove_taxes() method set subtotal to subtotal_ex_tax
* Fix - Allow layered nav to work with non pa_ prepended taxonomies
= 2.0.9 - 02/05/2013 =
* Feature - Added is_product_taxonomy() conditonal.

View File

@ -75,6 +75,7 @@ if ( ! is_admin() || defined('DOING_AJAX') ) {
* @see woocommerce_template_loop_add_to_cart()
* @see woocommerce_template_loop_product_thumbnail()
* @see woocommerce_template_loop_price()
* @see woocommerce_template_loop_rating()
*/
add_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 );
add_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10 );