Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #18955

    Hello,

    Can you check here https://webdomitia.fr/boutique the product on subscription 9.99/month when you click the product to go to product page : https://webdomitia.fr/boutique/boutique/pack-e-commerce/

    You get this error message : Warning: Invalid argument supplied for foreach() in /home/webdomfr/public_html/wp-content/themes/replete/config-woocommerce/config.php on line 367

    Warning: reset() expects parameter 1 to be array, boolean given in /home/webdomfr/public_html/wp-content/themes/replete/config-woocommerce/config.php on line 377

    Catchable fatal error: Object of class WP_Error could not be converted to string in /home/webdomfr/public_html/wp-content/themes/replete/config-woocommerce/config.php on line 384

    With the orange design the error message don’t show very clearly…

    It’s fine with normal products.

    Thank you for your help !

    #101511

    Well, I went in the config.php to the line 367 : foreach($temp_cats as $key => $cat)

    And I realised I didn’t choose a category for my producut… I did and the bug was fixed.

    May be something to add in the code to avoid bug if no category is chosen…

    #101512

    Thanks I’ll report it to Kriesi. However tbh (because of SEO & ui reasons) you need to set at least one product category for each product anyway. Otherwise you won’t get a proper breadcrumb and the user can’t sort/filter the items with the shop widgets. Probably you can fix the error by replacing:

    foreach($temp_cats as $key => $cat)
    {
    if($cat->parent != 0 && !in_array($cat->term_taxonomy_id, $parent_cat))
    {
    $product_category[] = $cat;
    $parent_cat[] = $cat->parent;
    }
    }

    with:

    if(empty($temp_cats)) $temp_cats = array();
    foreach($temp_cats as $key => $cat)
    {
    if($cat->parent != 0 && !in_array($cat->term_taxonomy_id, $parent_cat))
    {
    $product_category[] = $cat;
    $parent_cat[] = $cat->parent;
    }
    }

    #101513

    Well, I will just think to set a category !

    Making the variable an array even if it’s empty before the foreach is simple and should be fixing the bug.

    I’ll try that in case I forget one more time.

    Thank you for your answer !

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

The topic ‘Replete and woocommerce subscriptions extension’ is closed to new replies.