Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1222087

    Hi there,

    The products in my Woocommerce webshop have a big display issue when upgrading the server php version to higher than 7.0.
    The menu of Enfold is also squeezed completely.

    It seems due to a bug in Avia (READ THE LOGFILE UNDERNEATH):
    [Fri May 29 00:36:00.016651 2020] [lsapi:notice] [pid 1879473:tid 140005691205376] [client 207.46.13.223:12545] [host http://www.thijsvanhalewijn.nl] Backend log: PHP Warning: Missing argument 3 for avia_woocommerce_gallery_thumbnail_description(), called in /home/deb69798/domains/thijsvanhalewijn.nl/public_html/wp-includes/class-wp-hook.php on line 287 and defined in /home/deb69798/domains/thijsvanhalewijn.nl/public_html/wp-content/themes/enfold-child/functions.php on line 5\n
    [Fri May 29 00:36:00.016713 2020] [lsapi:notice] [pid 1879473:tid 140005691205376] [client 207.46.13.223:12545] [host http://www.thijsvanhalewijn.nl] Backend log: PHP Warning: Missing argument 4 for avia_woocommerce_gallery_thumbnail_description(), called in /home/deb69798/domains/thijsvanhalewijn.nl/public_html/wp-includes/class-wp-hook.php on line 287 and defined in /home/deb69798/domains/thijsvanhalewijn.nl/public_html/wp-content/themes/enfold-child/functions.php on line 5\n

    I would love too upgrade my PHP version but this holds me back. What can be done?

    PS: I use the latest versions of WP 5.4.2 both as Woocommerce and Enfold 4.7.5.

    #1222674

    Hey thijsvanhalewijn,

    What code do you have there in your child theme?
    enfold-child/functions.php on line 5

    Best regards,
    Victoria

    #1222681

    Hey Victoria, this is all the code from enfold-child/functions.php (starting with line 1)

    <?php
    /* Woocommerce 3.0.0 Compatibility Fix – Remove Enfold’s custom functions that conflict with the new image display in WooCommerce 3.0.0 */
    global $woocommerce;
    if( version_compare( $woocommerce->version, ‘3.0.0’, “>=” ) ) {
    function avia_woocommerce_gallery_thumbnail_description($img, $attachment_id, $post_id, $image_class ) {
    return $img;
    }
    function avia_woocommerce_post_thumbnail_description($img, $post_id){
    return $img;
    }
    }
    add_theme_support(‘avia_template_builder_custom_css’);
    /*
    * Add your own functions here. You can also copy some of the theme functions into this file.
    * WordPress will use those functions instead of the original functions then.
    */
    function sv_remove_product_page_skus( $enabled ) {
    if ( ! is_admin() && is_product() ) {
    return false;
    }

    return $enabled;
    }
    add_filter( ‘wc_product_sku_enabled’, ‘sv_remove_product_page_skus’ );
    ?>

    #1222752

    Hi thijsvanhalewijn,

    You can remove this code and see if the issue persists:

    
    /* Woocommerce 3.0.0 Compatibility Fix – Remove Enfold’s custom functions that conflict with the new image display in WooCommerce 3.0.0 */
    global $woocommerce;
    if( version_compare( $woocommerce->version, ‘3.0.0’, “>=” ) ) {
    function avia_woocommerce_gallery_thumbnail_description($img, $attachment_id, $post_id, $image_class ) {
    return $img;
    }
    

    Best regards,
    Victoria

    #1222771

    Great, it works! Note that the code you mentioned should be a bit longer, and include the POST_THUMBNAIL_DESCRIPTION as well ;-)

    Thanks anyway ;-)

    global $woocommerce;
    if( version_compare( $woocommerce->version, ‘3.0.0’, “>=” ) ) {
    function avia_woocommerce_gallery_thumbnail_description($img, $attachment_id, $post_id, $image_class ) {
    return $img;
    }
    function avia_woocommerce_post_thumbnail_description($img, $post_id){
    return $img;
    }
    }

    #1222794

    Hi,

    Did you need additional help with this topic or shall we close?

    Best regards,
    Jordan Shannon

    #1222817

    No thanks, Jordan, I’m fine.

    #1222826

    Hi,

    If you need anything else please let us know here in the forums.

    Best regards,
    Jordan Shannon

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Layout Woocommerce product going bad, while using PHP > 7.0’ is closed to new replies.