I noticed a bug with my store. If I sort the products from lowest to highest price, everything is displayed correctly.
However, if I sort from highest to lowerst, which is the default option, the Zen sauna is misplaced. It’s displaying the prices as 2.460€, 1.901€, 2.256€, 2.104€. I don’t know why this is happening.
I tried to go to Settings -> Status -> Tools -> Product lookup tables and regenerate them, but that did nothing. I also tried to paste the code bellow to functions.php, but that didn’t fix the issue either.
/**
* Customize ordering by price
*/
add_filter('woocommerce_get_catalog_ordering_args', function ($args) {
$orderby_value = isset($_GET['orderby']) ? wc_clean($_GET['orderby']) : apply_filters('woocommerce_default_catalog_orderby', get_option('woocommerce_default_catalog_orderby'));
if ('price' == $orderby_value) {
$args['orderby'] = 'meta_value_num';
$args['order'] = 'ASC';
$args['meta_key'] = '_price';
}
if ('price-desc' == $orderby_value) {
$args['orderby'] = 'meta_value_num';
$args['order'] = 'DESC';
$args['meta_key'] = '_price';
}
return $args;
});
Kind regards
]]>is it possible to do that? and how ?
]]>Thanks.
]]>Template for this widget:
<br />
Please tell me how can I insert this query in the PHP (to sidebar.php)
]]>https://www.ads-software.com/plugins/woocommerce/
]]>https://www.ads-software.com/plugins/dutch-auction-masters/
]]>I have looked through this support forum but was unable to find what im looking for so apologies if ive missed the answer.
I am developing a query_posts arguments list to return a random custom post type with a rating of 4 or above.
My current code looks like:
$query_args['post_type'] = 'recipes';
$query_args['post_status'] = 'publish';
$query_args['r_sortby'] = 'highest_rated';
$query_args['r_orderby'] = 'rand';
$query_args['posts_per_page'] = '1';
query_posts($query_args);
This is returning the highest rated recipe. How can I amend to only return a random 4/5 star recipe?
Thanks very much.
https://www.ads-software.com/extend/plugins/wp-postratings/
]]><?php query_posts($query_string.'&r_sortby=get_highest_rated_range=7&r_orderby=desc&posts_per_page=2') ?>
-should retrieve 2 highest rated post in 7 past days. (now just latest 2 post)
<?php query_posts($query_string.'&r_sortby=highest_rated&range=7&r_orderby=desc&posts_per_page=2&w='.date('W')) ?>
-should retrieve 2 highest rated post in 7 past days and put the most highest rated at top of the two (now just blank/void)
I reinstalled latest wp-postratings
thanks
https://www.ads-software.com/extend/plugins/wp-postratings/
]]>