Home Forums WoodMart support forum PHP Warning that is null creates an empty shop

PHP Warning that is null creates an empty shop

Viewing 4 posts - 31 through 34 (of 34 total)
  • Author
    Posts
  • #718439

    Serg Sokhatskyi
    Keymaster
    Xtemos team

    Hello,

    There is a fix for this issue already. You need to use the following code and add it to your website using some plugin like this one https://wordpress.org/plugins/code-snippets/

    add_action( 'init', function () {
    	if ( ! current_theme_supports( 'woocommerce' ) && class_exists( 'WooCommerce' ) ) {
    		add_theme_support( 'woocommerce' );
    	}
    }, 1 );
    #718442

    supp0rt
    Participant

    @serg-xtemos

    Thank you for your response.

    I didn’t receive any follow-up on this, so I thought the issue might have been caused by something else.

    Just to confirm, has this fix already been tested with other users that had the same problem? Also, should I keep the debug log active for now in case the issue happens again?

    Was the issue only related to the WooCommerce theme support check during init, or could there be anything else involved?

    Best Regards

    #718450

    ideageek.net
    Participant

    Hi!

    I wish to confirm that this happens to 2 of our client’s websites. Randomly the shop page becomes empty. As a temporary fix, we update the Shop page by going to Pages > Shop without making any changes to the page. And it fixes the empty shop page issue.

    Wondering if this is a theme issue.

    add_action( 'init', function () {
    	if ( ! current_theme_supports( 'woocommerce' ) && class_exists( 'WooCommerce' ) ) {
    		add_theme_support( 'woocommerce' );
    	}
    }, 1 );

    We however didn’t add the code that is shared above and test yet.

    Both websites run on Hostinger, uses WP Bakery and have LiteSpeed Cache enabled. We wish to get to the root of the problem what is causing this.

    Thanks.

    • This reply was modified 1 month, 1 week ago by ideageek.net.
    #718459

    Serg Sokhatskyi
    Keymaster
    Xtemos team

    Hello,

    This issue is not limited to our theme. It’s a confirmed WooCommerce bug, and you can find more information here: https://github.com/woocommerce/woocommerce/issues/63954

    The fix I sent you should serve as a temporary solution until the official fix is released.

    Kind regards,

Viewing 4 posts - 31 through 34 (of 34 total)