Forum Replies Created
Viewing 3 posts - 1 through 3 (of 3 total)
-
AuthorPosts
-
Participant
Hi Peter,
The issue I was having was in woocommerce-custom-tabs.php line 172. If one of the two arrays you are merging is empty it was throwing a fatal error. I managed to fix it with the following code (I’m sure it could be written a bit more concisely):
// line 172 woocommerce-custom-tabs.php // REMOVE -> $product_tabpage_postslist = array_unique ( array_merge ( $product_tabpage_postslist_1, $product_tabpage_postslist_2 ), SORT_REGULAR); // ADD $product_tabpage_postslist = array(); if ( count($product_tabpage_postslist_1) > 0 && count($product_tabpage_postslist_2) > 0 ) { //array_unique works with an array of objects using SORT_REGULAR: $product_tabpage_postslist = array_unique ( array_merge ( $product_tabpage_postslist_1, $product_tabpage_postslist_2 ), SORT_REGULAR); } else if ( count($product_tabpage_postslist_1) > 0 ) { $product_tabpage_postslist = $product_tabpage_postslist_1; } else if ( count($product_tabpage_postslist_2) > 0 ) { $product_tabpage_postslist = $product_tabpage_postslist_2; }Hope it helps
Cheers,
DavidParticipantHi,
Any update on this? I really need to get this resolved.
Let me know if you need any more details to resolve this.
David
-
AuthorPosts
Viewing 3 posts - 1 through 3 (of 3 total)