Tagged: enfold, shortcode, woocommerce
-
AuthorPosts
-
July 5, 2018 at 11:09 am #981517
Dear support,
I have some conflicts using the woocommerce shortcodes on a website with enfold.
I am using both new- and legacy version of the products shortcode, namely[recent_products per_page="12" columns="4" orderby="date" order="DESC"]
and
[products limit="12" columns="4" orderby="date" order="DESC"]
I am testing them both in code block and in text block.
The result should be the same, shouldn’t it?
But the result depends on the order of those shortcodes in the page: in most cases the results are ordered by ID and not by dateI did 3 cases:
case 1:
products shortcode in text block –> wrong order
recent_products shortcode in text block –> wrong order
products shortcode in code block –> OK
recent_products shortcode in code block –> wrong ordercase 2:
products shortcode in code block –> OK
recent_products shortcode in code block –> wrong order
products shortcode in text block –> wrong order
recent_products shortcode in text block –> wrong ordercase 3:
recent_products shortcode in text block –> OK
products shortcode in text block –> wrong order
recent_products shortcode in code block –> wrong order
products shortcode in code block –> wrong orderI disabled all plugins but woocommerce and none changed.
I switched from my child theme to enfold but the results are still wrong.
I switched to twentyseventeen theme and the results are all OK.So I believe there is a missing wp_reset_query somewhere in the theme. :)
I am using last available versions of WP (4.9.6), woocommerce (3.4.3) and enfold (3.4.1)
Could you please help me?
The website is on production so my customer is pressing me :-(best regards,
CarloJuly 7, 2018 at 8:07 pm #982540Hey WEBCREATIVI,
Probably the avia_woocommerce_overwrite_catalog_ordering() function (enfold/config-woocommerce/config.php on line 1407+) overwrites the shortcode parameters. But you can deactivate it – just add this code to your child theme:
add_action( 'init', 'remove_avia_woocommerce_overwrite_catalog_ordering', 10); function remove_avia_woocommerce_overwrite_catalog_ordering() { remove_action( 'woocommerce_get_catalog_ordering_args', 'avia_woocommerce_overwrite_catalog_ordering', 20); }
Best regards,
DudeJuly 9, 2018 at 9:52 am #982978Thank you, Dude!
Now it works perfectly!
Shouldn’t this considered as a bug? Will this behavior fixed or changed in a future release of the enfold theme?thank you again!
Carlo
July 9, 2018 at 10:48 am #982996Hey Carlo,
Glad Dude could help!
I will forward the thread to our devs. If they consider it as a bug, a fix will be included in upcoming version. In the meantime, please use the code Dude posted :)Cheers!
YigitJuly 9, 2018 at 1:23 pm #983087Hey Yigit,
Sure! I am adding it to all child themes I have.
Thank you again,
you can tag this thread as solved.Carlo
July 9, 2018 at 7:06 pm #983326July 11, 2018 at 1:17 pm #984210Hi,
Thank you for reporting this. It is actually a bug and Dude’s solution will break the standard WC shop page where Enfold adds extra select boxes for filter and ordering.
Please update config-woocommerce\config.php with
https://github.com/KriesiMedia/enfold-library/blob/master/temp_fixes/Enfold_4_4_1/config-woocommerce/config.php
Make sure you use Enfold 4.4.1 and make a copy of the original file for a fallback.
Best regards,
Günter -
AuthorPosts
- You must be logged in to reply to this topic.