David

Forum Replies Created

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author

    Posts


  • in reply to: Error on product page

    #923

    David

    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,
    David


    in reply to: Error on product page

    #907

    David

    Participant

    Hi,

    Any update on this? I really need to get this resolved.

    Let me know if you need any more details to resolve this.

    David


    in reply to: Error on product page

    #899

    David

    Participant

    Well yes, I had already created tab types see attached screenshots. They are assigned to a product category, I’ve also tried the ‘Use for all products’ option as well to get something to display.

    Attachments:

    You must be logged in to view attached files.

Viewing 3 posts - 1 through 3 (of 3 total)