PluginUs.Net - Business Tools for WooCommerce and WordPress

[realize your idea - make your dreams come true]

Support Forum

You need to log-in to create request (topic) to the support

Can't order by date my products WOOF SHORTCODE

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 please
If 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.
12

I've my shortcode to show my products and i want to order them by date

This is my short code [woof_products per_page=12 columns=3 is_ajax =1 orderby='date' ] the order by date parameter isn't working

Hello

Please  drop  me  exact  link to the  issue

Hi Pablo, thanks for your answer, that's the link https://www.rtssrl.com/portal/prodotti/

Hello

Have you customized the code?

try  to add  in  functions.php

add_filter('woof_order_catalog', function($args){

$args = array(

'order' => 'DESC',
'orderby' => 'date',

'meta_key' =>""

);

return $args;

})

i just tried, nothing, doesn't work

So third-party code interferes with the request. try  to  disable  all  plugins  except  woof+woo  and  install  another  theme

I 've the same plugin on another web-site, in which i've the same plugins and the same site structure, it's like a clone, and woof shortcode here work. I saw a difference beetween the 2 website. The ordering select.

<select name="orderby" class="orderby" aria-label="Ordine negozio">
<option value="menu_order" selected="selected">Ordinamento predefinito</option>
<option value="popularity">Popolarità</option>
<option value="rating">Valutazione media</option>
<option value="date">Ordina in base al più recente</option>
<option value="price">Prezzo: dal più economico</option>
<option value="price-desc">Prezzo: dal più caro</option>
</select>

<select name="orderby" class="orderby" aria-label="Ordine negozio">
<option value="popularity">Popolarità</option>
<option value="rating">Valutazione media</option>
<option value="date">Ordina in base al più recente</option>
<option value="price">Prezzo: dal più economico</option>
<option value="price-desc">Prezzo: dal più caro</option>
</select>

The first is on the working website, the seconds on my broke page. There isn't this option " <option value="menu_order" selected="selected">Ordinamento predefinito</option>" the default order, i think here is the problem do you have any idea?

PS:  the ordering by parameters works in both

https://www.eltekitalia.it/portal/sistemi-di-sicurezza-umbria/ working website url

 

Hello

As I described in the previous message, you need to find the code that causes the code conflict.   So  please - https://c2n.me/4c1xvX3.png - then activate one by one and do the test

This works on all of our test sites.

Sorry for the delay, i put my website on localhost, i disabled all plugins and changed theme, no results! My woof shortcode order by date doesn't work.

Hello

This is very strange, I have three test sites and it works correctly on all sites

I know, as i said i've another website like a clone and works fine.

This is my"broken" website:

 

This the right way:

 

As you see in the first one there isn't the order deafult option

Hello

I think only one reason is possible - https://share.pluginus.net/image/i20210527134201.png

unfortunately I have no other ideas

Try  to  add  this  code  to  check args

add_filter('woof_order_catalog', function($args){

var_dump($args);

return $args;

});

It display  this params, and order by is actually wrong

array(3) { ["order"]=> string(3)"ASC" ["orderby"]=> string(10)"popularity" ["meta_key"]=> string(11)"total_sales" }

 

Hello

Does this show up on any sort?

Goodmorning,

do you mean if the shortcode has the same result in other page? yes

otherwise if you mean other type of sort as orderby = 'title', no, they doesn't work

It seems it doesn't accept orderby params

All other parameters are working (per_page, columns, is_ajax =1)

Hello

as I wrote before, this is not a problem with plugin parameters.

this code eliminates the possibility of a problem with shortcode parameters - https://share.pluginus.net/image/i20210601134834.png

I don't know what to do more. Only idea if there is another way to filter my product contained in a wp elementor block...

But my local website is totally clean i deactivate all plugin theme core plugin and elementor inclused, only woocommerce and woof still don't work. Don't know what try more

Hello

Try  to  use  standard  woocommerce  shortcodes [products]

Hello

[products orderby='date'] shortcode seems to work and woof filters too, though the select to sort the products is still not showing order default option, but i can hide it...

No idea how to completely fix the problem, but at the moment I can leave it like this. Thank you very much for your tips, if you have any other idea is welcome!

12