Home Forums WoodMart support forum Website WooCommerce bug

Website WooCommerce bug

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #581900

    fusion01wp
    Participant

    Hi I have the craziest bug. If I do NOT add any tags to my WooCommerce products then the pages will break at that specific point within the code output and the rest of the page content will not load.

    You will see the home page not fully rendered. This is because there is no tag assigned to the one singular product: ‘Psalms 91’. If you go to products and enter a tag then the output on the home page will be fine without issues.

    I’ve removed all plugins but JS Composer (WP Bakery), WooCommerce, Woodmart-core and the issues persists. It took make a lot of troubleshooting to find that the culprit was the tags. I changed permalinks and resaved many times, that fixed nothing.

    Can you assist please?

    #581906

    fusion01wp
    Participant

    Attached a screenshot.

    Attachments:
    You must be logged in to view attached files.
    #581958

    Artem Temos
    Keymaster

    Hi,

    Based on the information provided and the troubleshooting steps you’ve already taken, it looks like an error comes from the child theme’s code. Since you have already removed all plugins except for JS Composer (WP Bakery), WooCommerce, and Woodmart-core, and the issue persists, this further suggests that the problem might be within the child theme. Temporarily switch to the WoodMart parent theme to see if the issue still occurs. If the problem is resolved, then the issue is indeed with the child theme.

    Kind Regards

    #582127

    fusion01wp
    Participant

    Genius. I had some code in my ‘functions.php’ that related to tags which I removed and all is now working 100% and the issue is resolved. You couldn’t tell me what this code attempted to do? Not your job I know, just curious! Thanks for the assistance.

    add_action( ‘woocommerce_after_shop_loop_item’, ‘woocommerce_product_loop_tags’, 5 );

    function woocommerce_product_loop_tags() {
    global $post, $product;

    $tag_count = sizeof( get_the_terms( $post->ID, ‘product_tag’ ) );

    echo $product->get_tags( ‘, ‘, ‘<span class=”tagged_as”>’ . _n( ‘Tag:’, ‘Tags:’, $tag_count, ‘woocommerce’ ) . ‘ ‘, ‘.</span>’ );
    }

    #582275

    Artem Temos
    Keymaster

    Hello,

    This code seems to display a list of tags on the product archive page, but it lacks some conditions and causes errors when there are no tags.

    Kind Regards

    #582480

    fusion01wp
    Participant

    Many thanks for all of your assistance 🙂

    #582563

    Artem Temos
    Keymaster

    You are always welcome. Feel free to contact us if you have any further questions.

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

The topic ‘Website WooCommerce bug’ is closed to new replies.