Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #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 date

    I 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 order

    case 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 order

    case 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 order

    I 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,
    Carlo

    #982540

    Hey 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,
    Dude

    #982978

    Thank 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

    #982996

    Hey 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!
    Yigit

    #983087

    Hey Yigit,

    Sure! I am adding it to all child themes I have.

    Thank you again,
    you can tag this thread as solved.

    Carlo

    #983326

    Hi,

    Let us know if you have any other questions!

    Best regards,
    Yigit

    #984210

    Hi,

    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

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.