-
AuthorPosts
-
June 12, 2020 at 2:36 pm #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\nI 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.
- This topic was modified 4 years, 5 months ago by thijsvanhalewijn.
June 15, 2020 at 3:30 pm #1222674Hey thijsvanhalewijn,
What code do you have there in your child theme?
enfold-child/functions.php on line 5Best regards,
VictoriaJune 15, 2020 at 3:37 pm #1222681Hey 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’ );
?>- This reply was modified 4 years, 5 months ago by thijsvanhalewijn.
June 15, 2020 at 5:11 pm #1222752Hi 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,
VictoriaJune 15, 2020 at 5:31 pm #1222771Great, 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;
}
}June 15, 2020 at 6:14 pm #1222794Hi,
Did you need additional help with this topic or shall we close?
Best regards,
Jordan ShannonJune 15, 2020 at 9:01 pm #1222817No thanks, Jordan, I’m fine.
June 15, 2020 at 9:59 pm #1222826Hi,
If you need anything else please let us know here in the forums.
Best regards,
Jordan Shannon -
AuthorPosts
- The topic ‘Layout Woocommerce product going bad, while using PHP > 7.0’ is closed to new replies.