Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #865216

    Hi Enfold team,

    I’ve updated a client’s website that uses the Masonry and Blog Posts Elements on many pages. After updating from 4.1.1 to 4.1.2 the website didn’t work on those pages anymore. While debugging PHP told me that two functions didn’t exist and created a fatal error: avia_wc_set_out_of_stock_query_params and avia_wc_get_product_query_order_args
    Those functions are WooCommerce specific functions and the only fix was to use “function_exists” and create those (empty) functions:

    if (!function_exists('avia_wc_set_out_of_stock_query_params'))
    {
    	function avia_wc_set_out_of_stock_query_params() {
    		return "";
    	}
    }
    if (!function_exists('avia_wc_get_product_query_order_args'))
    {
    	function avia_wc_get_product_query_order_args($args) {
    		return $args;
    	}
    }

    Afterwards the website worked but the ordering of posts defined in the shortcodes was ignored!
    PLEASE fix that as soon as possible to make my workarounds obsolete and fix the ordering problem!

    #866488

    Hey 48design,

    Please be patience till we do release the latest version which is this days and tell us if the issue will be general fixed

    Best regards,
    Basilis

    #873662

    Hey Basilis,

    I’ve updated to the latest version (4.2) and from the changelog it seems to be fixed (improved: removed an old filter from woocommerce) but if I remove my workaround the same problem arises.

    Best regards

    #874871

    Hi,

    Can you please share us backend access details please?

    Best regards,
    Basilis

    #875098

    Hi Basilis,

    here we go. I’ve added a user for you (see private content).

    Best regards

    #875932

    Hi,

    Please check the config-woocommerce > config.php file. The function should be included inside. If you can’t find it, please download the latest version of the theme then override the file manually.

    Best regards,
    Ismael

    #876103

    Thank you Ismael,

    but this website doesn’t use WooCommerce and Enfold was directly installed (and afterwards updated) from the installation package we’ve purchased, so this should not be necessary I think. The config file is from 2017-11-07, so it seems it got updated to 4.2.
    I took a look inside and there are those two functions.

    Nevertheless, if I remove those two dummy-functions from my child theme’s functions.php I get those errors:
    [13-Nov-2017 11:22:11 UTC] PHP Fatal error: Call to undefined function avia_wc_set_out_of_stock_query_params() in […]/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/postslider.php on line 755
    [13-Nov-2017 11:23:02 UTC] PHP Notice: Undefined index: orderby in […]/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/postslider.php on line 760

    Those errors block some content of the website to be loaded. You can test that on the frontpage.

    #876495

    Hi,

    but this website doesn’t use WooCommerce and Enfold was directly installed

    There is a product post type in the dashboard. Where’s that coming from?

    Best regards,
    Ismael

    #876529

    Hi,

    this post type is from the child theme. Does Enfold simply check for a post type “product” to verify that WooCommerce is installed?
    By the way: I granted you access to the website, so you should see that there is no WooCommerce installed.

    Best regards
    Fabian

    • This reply was modified 7 years, 1 month ago by 48DESIGN.
    #877340

    Hi,

    this post type is from the child theme. Does Enfold simply check for a post type “product” to verify that WooCommerce is installed?

    No, it doesn’t but the functions above do. The logic check if the taxonomy is an actual object and if it belongs to the “product” custom post type. Please check the config-templatebuilder > avia-shortcodes > av-helper-masonry.php file. You should see this code on line 681.

    if( is_object( $tax ) && isset( $tax->object_type ) && in_array( 'product', (array) $tax->object_type ) ) 
    

    Best regards,
    Ismael

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