Approximation in filter
The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday. If you have problems with registration ask help on contact us page pleaseIf you not got email within 24~36 business hours, firstly check your spam box, and if no any email from the support there - back to the forum and read answer here. DO NOT ANSWER ON EMAILS [noreply@pluginus.net] FROM THE FORUM!! Emails are just for your info, all answers should be published only here.
The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday.
Quote from Nimm on July 2, 2020, 10:13Hi Team,
I am creating a filter for cartons(Packaging boxes), I have used product meta options to store the values of Length, breadth and height. Now using range filter from using meta values it is working fine.
Is there a possibility that I can add approximation i.e. 10% additional value to the range slider min & max values.
Hi Team,
I am creating a filter for cartons(Packaging boxes), I have used product meta options to store the values of Length, breadth and height. Now using range filter from using meta values it is working fine.
Is there a possibility that I can add approximation i.e. 10% additional value to the range slider min & max values.
Quote from Pablo Borysenco on July 2, 2020, 12:15Hello
Unfortunately, the plugin does not have such a feature. You need customization of the code.
Read this - https://products-filter.com/hook/woof_get_meta_query/ - you can find a search query for the slider and change the minimum and maximum
Hello
Unfortunately, the plugin does not have such a feature. You need customization of the code.
Read this - https://products-filter.com/hook/woof_get_meta_query/ - you can find a search query for the slider and change the minimum and maximum
Quote from Nimm on July 2, 2020, 16:09Thanks, Pablo for quick response, Is it possible if we can use min & max input by the text input field.
Is there is any reference code available for a filter that would be similar like the link provided in private data or similar layout possible with step filter?
Cheers
Ankur Tyagi
Thanks, Pablo for quick response, Is it possible if we can use min & max input by the text input field.
Is there is any reference code available for a filter that would be similar like the link provided in private data or similar layout possible with step filter?
Cheers
Ankur Tyagi
Quote from Pablo Borysenco on July 3, 2020, 11:41Hello Ankur
to change the template you need customization of CSS code. Unfortunately we have no example.
Hello Ankur
to change the template you need customization of CSS code. Unfortunately we have no example.
Quote from Nimm on July 8, 2020, 11:59Hi Pablo,
I would like to create a text input option for my range slider filters, where I can create a custom template for the same.
Hi Pablo,
I would like to create a text input option for my range slider filters, where I can create a custom template for the same.
Quote from Pablo Borysenco on July 8, 2020, 12:21Hello
Read this please - https://products-filter.com/can-i-override-any-extension-view-file-for-my-site-needs/
Hello
Read this please - https://products-filter.com/can-i-override-any-extension-view-file-for-my-site-needs/
Quote from Nimm on July 28, 2020, 12:30Hi Pablo,
I have created the filter using HTML form input & javascript to create URL & using a filter of woof.
URL added in example private data.
I would like to use 3 meta input(L, B, H) or 1 meta input(Volume) i.e. Use only one input set at once.
Currently, in the shared URL, I am automatically calculating the volume but the user can use volume input instead L, B, H.
Is that feasible?
Hi Pablo,
I have created the filter using HTML form input & javascript to create URL & using a filter of woof.
URL added in example private data.
I would like to use 3 meta input(L, B, H) or 1 meta input(Volume) i.e. Use only one input set at once.
Currently, in the shared URL, I am automatically calculating the volume but the user can use volume input instead L, B, H.
Is that feasible?
Quote from Pablo Borysenco on July 29, 2020, 11:53Hello
I think yes! But this does not depend on my plugin, this is your customization. You should customize JS to also have an inverse relationship with (L, B, H) "automatically calculating" Or use a tag "readonly" for meta input(Volume)
Hello
I think yes! But this does not depend on my plugin, this is your customization. You should customize JS to also have an inverse relationship with (L, B, H) "automatically calculating" Or use a tag"readonly" for meta input(Volume)
Quote from Nimm on August 4, 2020, 15:32Thanks again, will update the same in JS file.
/**
* Adds WooCommerce catalog sorting options using postmeta, such as custom fields
**/
function nimm3_add_postmeta_ordering_args( $sort_args ) {
global $product;
$orderby_value = isset( $_GET['orderby'] ) ? wc_clean( $_GET['orderby'] ) : apply_filters( 'woocommerce_default_catalog_orderby', get_option( 'woocommerce_default_catalog_orderby' ) );
switch( $orderby_value ) {// Name your sortby key whatever you'd like; must correspond to the $sortby in the next function
case 'pa_laenge-in-mm':
$sort_args['orderby'] = 'meta_value_num meta_value';
// Sort by meta_value because we're using alphabetic sorting
$sort_args['order'] = 'desc';
$sort_args['meta_key'] = 'pa_laenge-in-mm';
// use the meta key you've set for your custom field, i.e., something like "location" or "_wholesale_price"
break;}
return $sort_args;
}
add_filter( 'woocommerce_get_catalog_ordering_args', 'nimm3_add_postmeta_ordering_args' );// Add these new sorting arguments to the sortby options on the frontend
function nimm3_add_new_postmeta_orderby( $sortby ) {// Adjust the text as desired
$sortby['pa_laenge-in-mm'] = __( 'Sortieren nach länge', 'woocommerce' );
//$sortby['breite_in_mm'] = __( 'Sortieren nach breite', 'woocommerce' );return $sortby;
}
add_filter( 'woocommerce_default_catalog_orderby_options', 'nimm3_add_new_postmeta_orderby' );
add_filter( 'woocommerce_catalog_orderby', 'nimm3_add_new_postmeta_orderby' );Cannot get it worked, is there anything in woof we have for custom sorting of products?
Like I would like to set "length" as my default desc sorting.
Thanks in advance.
Thanks again, will update the same in JS file.
/**
* Adds WooCommerce catalog sorting options using postmeta, such as custom fields
**/
function nimm3_add_postmeta_ordering_args( $sort_args ) {
global $product;
$orderby_value = isset( $_GET['orderby'] ) ? wc_clean( $_GET['orderby'] ) : apply_filters( 'woocommerce_default_catalog_orderby', get_option( 'woocommerce_default_catalog_orderby' ) );
switch( $orderby_value ) {
// Name your sortby key whatever you'd like; must correspond to the $sortby in the next function
case 'pa_laenge-in-mm':
$sort_args['orderby'] = 'meta_value_num meta_value';
// Sort by meta_value because we're using alphabetic sorting
$sort_args['order'] = 'desc';
$sort_args['meta_key'] = 'pa_laenge-in-mm';
// use the meta key you've set for your custom field, i.e., something like"location" or"_wholesale_price"
break;
}
return $sort_args;
}
add_filter( 'woocommerce_get_catalog_ordering_args', 'nimm3_add_postmeta_ordering_args' );
// Add these new sorting arguments to the sortby options on the frontend
function nimm3_add_new_postmeta_orderby( $sortby ) {
// Adjust the text as desired
$sortby['pa_laenge-in-mm'] = __( 'Sortieren nach länge', 'woocommerce' );
//$sortby['breite_in_mm'] = __( 'Sortieren nach breite', 'woocommerce' );
return $sortby;
}
add_filter( 'woocommerce_default_catalog_orderby_options', 'nimm3_add_new_postmeta_orderby' );
add_filter( 'woocommerce_catalog_orderby', 'nimm3_add_new_postmeta_orderby' );
Cannot get it worked, is there anything in woof we have for custom sorting of products?
Like I would like to set"length" as my default desc sorting.
Thanks in advance.
Quote from Pablo Borysenco on August 5, 2020, 11:39Hello
Add your custom sorting here - https://products-filter.com/hook/woof_order_catalog/
Hello
Add your custom sorting here - https://products-filter.com/hook/woof_order_catalog/
Quote from Nimm on August 14, 2020, 09:43Thanks for sharing, do i have to add the case or just meta_key.
If I add meta_key, it's not working.
I have set the default sorting based on meta_key but that is not working with WOOF.
Awaiting for your guidance.
Thanks for sharing, do i have to add the case or just meta_key.
If I add meta_key, it's not working.
I have set the default sorting based on meta_key but that is not working with WOOF.
Awaiting for your guidance.
Quote from Pablo Borysenco on August 14, 2020, 12:30Hello
Use this hook to add custom sorting
Example:
add_filter('woof_order_catalog', function($sort_args){
$sort_args['orderby'] = 'meta_value_num meta_value';
// Sort by meta_value because we're using alphabetic sorting
$sort_args['order'] = 'desc';
$sort_args['meta_key'] = 'pa_laenge-in-mm';return $sort_args;
});
Hello
Use this hook to add custom sorting
Example:
add_filter('woof_order_catalog', function($sort_args){
$sort_args['orderby'] = 'meta_value_num meta_value';
// Sort by meta_value because we're using alphabetic sorting
$sort_args['order'] = 'desc';
$sort_args['meta_key'] = 'pa_laenge-in-mm';
return $sort_args;
});
Quote from Nimm on September 17, 2020, 11:34Thanks Pablo, that was smooth. It works like charm. I would like to know is the standard multi-metadata keys would be valid for sorting. i.e.$q = new WP_Query( array( 'meta_query' => array( 'relation' => 'AND', 'length_clause' => array( 'key' => 'state', 'value' => 'pa_laenge-in-mm', ), 'bredth_clause' => array( 'key' => 'pa_breite-in-mm', 'compare' => 'EXISTS', ), ), 'orderby' => array( 'length_clause' => 'ASC', 'bredth_clause' => 'ASC', ), ) ); Shall I add it to plugin functions.php?Any existing reference available where sorting is done by multiple post meta fields.
Thanks
Thanks Pablo, that was smooth. It works like charm.
I would like to know is the standard multi-metadata keys would be valid for sorting. i.e.
$q = new WP_Query( array(
'meta_query' => array(
'relation' => 'AND',
'length_clause' => array(
'key' => 'state',
'value' => 'pa_laenge-in-mm',
),
'bredth_clause' => array(
'key' => 'pa_breite-in-mm',
'compare' => 'EXISTS',
),
),
'orderby' => array(
'length_clause' => 'ASC',
'bredth_clause' => 'ASC',
),
) );
Shall I add it to plugin functions.php?Any existing reference available where sorting is done by multiple post meta fields.
Thanks
Quote from Pablo Borysenco on September 17, 2020, 12:39Hello
unfortunately I did not understand your question
Everything is described here - https://wordpress.stackexchange.com/questions/246355/order-by-multiple-meta-key-and-meta-value
unfortunately this sorting cannot be used for this hook
Hello
unfortunately I did not understand your question
Everything is described here - https://wordpress.stackexchange.com/questions/246355/order-by-multiple-meta-key-and-meta-value
unfortunately this sorting cannot be used for this hook
Quote from Nimm on September 21, 2020, 15:39Hello Pablo,
I am exactly looking for: order-by-multiple-meta-key-and-meta-value
My meta keys are num, but sorting is not working. All links are the same as before,
So far couldn't make it work.
Thanks
Hello Pablo,
I am exactly looking for: order-by-multiple-meta-key-and-meta-value
My meta keys are num, but sorting is not working. All links are the same as before,
So far couldn't make it work.
Thanks
Quote from Pablo Borysenco on September 22, 2020, 11:36Hello
In this case, you need to redo the WP query
Use hooks - woof_products_query AND woocommerce_product_query
Hello
In this case, you need to redo the WP query
Use hooks - woof_products_query AND woocommerce_product_query