My products aren’t showing in my shop page

This topic has 61 replies, 3 voices, and was last updated 2 weeks, 2 days ago ago by Andrew Mitchell

  • Avatar: Andrew Mitchell
    Andrew Mitchell
    Support staff
    March 23, 2026 at 11:14

    Hello, Preslav,

    Thank you for your clarification. In this case, we recommend setting this option to “live,” as the “coming” status indicates that the store is in development mode. Consequently, WooCommerce hides products from non-logged-in users to prevent accidental purchases.

    Best regards,
    8Theme Team

    Avatar: Preslav
    Preslav
    Participant
    March 23, 2026 at 15:42

    Yeah, it’s on live, but when all products are hidden from the shop page, fixing is to go to coming and then back to live, idk why?

    Avatar: Andrew Mitchell
    Andrew Mitchell
    Support staff
    March 23, 2026 at 16:02

    Hello, Preslav,

    It is possible that the cause of this is related to cached data.

    We kindly recommend clearing the cache after making changes to products and categories. This includes clearing WooCommerce-related caches, which can be found in the following section:

    WooCommerce -> Status -> Tools

    Please ensure you clear the following fields:
    – WooCommerce transients
    – Expired transients
    – Term counts
    – Brands transients

    If you continue to experience any issues after performing these steps, please do not hesitate to contact us for further assistance.

    Best Regards,
    8Theme’s Team

    Avatar: Preslav
    Preslav
    Participant
    March 23, 2026 at 16:04

    All cache is cleaned and purged.

    Avatar: Andrew Mitchell
    Andrew Mitchell
    Support staff
    March 23, 2026 at 21:12

    Did this help you resolve the issue?
    Best regards,
    The 8Theme Team

    Avatar: Preslav
    Preslav
    Participant
    March 23, 2026 at 21:14

    Nooooo, I requested several problems, but nothing happened.

    Avatar: Andrew Mitchell
    Andrew Mitchell
    Support staff
    March 24, 2026 at 08:58

    Hello, Preslav,

    Unfortunately, the FTP credentials you previously provided are no longer working. Therefore, we kindly ask you to add the following code to the functions.php file of your child theme.

    <?php
    
    /**
     * Replace option key if your installation uses another one.
     */
    function my_xstore_get_store_mode() {
        $possible_keys = array(
            'xstore_store_mode',
            'xstore_shop_status',
            'etheme_store_mode',
            'etheme_coming_soon',
            'shop_status',
        );
    
        foreach ( $possible_keys as $key ) {
            $value = get_option( $key, null );
    
            if ( null !== $value && '' !== $value ) {
                return is_string( $value ) ? strtolower( trim( $value ) ) : $value;
            }
        }
    
        return 'live';
    }
    
    /**
     * Force WooCommerce catalog queries to work normally when store is live.
     */
    add_action( 'pre_get_posts', function( $query ) {
        if ( is_admin() || ! $query->is_main_query() ) {
            return;
        }
    
        if ( 'live' !== my_xstore_get_store_mode() ) {
            return;
        }
    
        if (
            $query->is_post_type_archive( 'product' ) ||
            $query->is_tax( 'product_cat' ) ||
            $query->is_tax( 'product_tag' )
        ) {
            $tax_query = (array) $query->get( 'tax_query' );
    
            // Exclude only products intentionally hidden from catalog.
            $tax_query[] = array(
                'taxonomy' => 'product_visibility',
                'field'    => 'name',
                'terms'    => array( 'exclude-from-catalog' ),
                'operator' => 'NOT IN',
            );
    
            $query->set( 'post_type', 'product' );
            $query->set( 'post_status', 'publish' );
            $query->set( 'tax_query', $tax_query );
        }
    }, 999 );
    
    /**
     * Make sure WooCommerce still treats products as visible on frontend if store is live.
     */
    add_filter( 'woocommerce_product_is_visible', function( $visible, $product_id ) {
        if ( is_admin() ) {
            return $visible;
        }
    
        if ( 'live' !== my_xstore_get_store_mode() ) {
            return $visible;
        }
    
        $product = wc_get_product( $product_id );
    
        if ( ! $product ) {
            return $visible;
        }
    
        // Keep explicitly hidden products hidden.
        if ( 'hidden' === $product->get_catalog_visibility() ) {
            return false;
        }
    
        return true;
    }, 999, 2 );
    
    /**
     * Clear WooCommerce transients once when mode changes.
     * This mimics the manual "coming -> live" refresh effect.
     */
    add_action( 'init', function() {
        if ( is_admin() ) {
            return;
        }
    
        $mode         = my_xstore_get_store_mode();
        $saved_mode   = get_option( '_my_xstore_last_mode', '' );
        $flush_needed = false;
    
        if ( $saved_mode !== $mode ) {
            update_option( '_my_xstore_last_mode', $mode );
            $flush_needed = true;
        }
    
        // Optional self-heal: if store is live and transients were stale, clear once.
        if ( 'live' === $mode && get_option( '_my_xstore_force_flush_live', '1' ) === '1' ) {
            $flush_needed = true;
            update_option( '_my_xstore_force_flush_live', '0' );
        }
    
        if ( $flush_needed && function_exists( 'wc_delete_product_transients' ) ) {
            wc_delete_product_transients();
    
            delete_transient( 'wc_attribute_taxonomies' );
            clean_term_cache( array(), 'product_visibility' );
    
            if ( function_exists( 'wp_cache_flush' ) ) {
                wp_cache_flush();
            }
        }
    }, 20 );

    Best regards,
    8Theme Team

    Avatar: Preslav
    Preslav
    Participant
    March 24, 2026 at 13:20

    Thanks, will try to reset the button on the filter price? The problem is that isnt resseting.

    Avatar: Preslav
    Preslav
    Participant
    March 24, 2026 at 13:44

    Isn’t showing after putting this code!

    Avatar: Andrew Mitchell
    Andrew Mitchell
    Support staff
    March 24, 2026 at 16:19

    In this case, please provide us with the current FTP access details so that we can check it ourselves and adjust the code for your specific situation.
    Best regards,
    8Theme Team

    Avatar: Preslav
    Preslav
    Participant
    March 24, 2026 at 18:01

    Already provided. Just scroll up.

    Avatar: Andrew Mitchell
    Andrew Mitchell
    Support staff
    March 25, 2026 at 09:39

    Hello, Preslav,

    We have made some changes to the code in your functions.php file and have noticed that the issue seems to be resolved. However, we kindly ask you to monitor the situation to ensure that the problem does not reappear in the future.

    Best regards,
    The 8Theme Team

    Avatar: Preslav
    Preslav
    Participant
    March 25, 2026 at 09:51

    This is email monitoring.

    Files is visible for topic creator and
    support staff only.
    Avatar: Andrew Mitchell
    Andrew Mitchell
    Support staff
    March 25, 2026 at 11:06

    This error occurred while we were making changes. We fixed it immediately. Thank you for bringing it to our attention.

    Best regards,
    8Theme Team

    Avatar: Preslav
    Preslav
    Participant
    March 25, 2026 at 11:06

    Perfect, and now please fix the reset button on the filter price.

    Avatar: Preslav
    Preslav
    Participant
    March 25, 2026 at 11:13

    Also, what SEO plugin do you recommend?

    Avatar: Andrew Mitchell
    Andrew Mitchell
    Support staff
    March 25, 2026 at 12:13

    Hello, Preslav,
    Regarding the SEO plugin, we recommend using the All in One SEO plugin.

    Best regards,
    The 8Theme Team

    Avatar: Preslav
    Preslav
    Participant
    March 25, 2026 at 12:25

    is Rank Math is better about functions?

    Avatar: Andrew Mitchell
    Andrew Mitchell
    Support staff
    March 25, 2026 at 13:35

    We cannot directly compare their functionality, but if you believe that Rank Math is better, you are welcome to use it. However, we recommend trying both plugins to see which one performs better on your website.

    Best regards,
    8Theme Team

    Avatar: Preslav
    Preslav
    Participant
    March 25, 2026 at 13:38

    Thanks. About my filter price reset button?

    Avatar: Andrew Mitchell
    Andrew Mitchell
    Support staff
    March 25, 2026 at 15:59

    To resolve the issue with the “Reset Price” button, we made changes to the file wp-content/themes/xstore/js/theme/ajax-filters.min.js
    However, we do not see these changes being applied on the frontend. It seems there might be some additional caching involved, as we have already cleared the cache through the website’s admin panel, but the old files are still being loaded.

    Best regards,
    8Theme Team

    Avatar: Preslav
    Preslav
    Participant
    March 25, 2026 at 16:11

    And now…? Maybe the solution is to remove the button and let customers adjust the price manually.

    Avatar: Andrew Mitchell
    Andrew Mitchell
    Support staff
    March 26, 2026 at 07:43

    Hello, Preslav,

    As an option, you may also replace this widget with the default one.

    Best regards,
    8Theme Team

    Avatar: Preslav
    Preslav
    Participant
    March 28, 2026 at 01:35

    Hello, again, I have a problem with the shop page. All products are hidden again!

    Avatar: Andrew Mitchell
    Andrew Mitchell
    Support staff
    March 30, 2026 at 08:27

    Hello,

    Thank you for informing us about this issue. We have added the following code to the functions.php file of your child theme. This code ensures that WooCommerce consistently recognizes the shop page as the actual shop page. In your case, for reasons unknown to us, WooCommerce occasionally starts treating the shop page as a regular site page after some time.

    /**
     * WooCommerce shop page to behave like product archive
     * when it is incorrectly treated as a normal WordPress page.
     */
    
    add_action( 'pre_get_posts', function( $query ) {
        if ( is_admin() || ! $query->is_main_query() ) {
            return;
        }
    
        $shop_page_id = function_exists( 'wc_get_page_id' ) ? wc_get_page_id( 'shop' ) : 0;
    
        if ( ! $shop_page_id || $shop_page_id < 1 ) {
            return;
        }
    
        $page_id   = (int) $query->get( 'page_id' );
        $pagename  = (string) $query->get( 'pagename' );
        $name      = (string) $query->get( 'name' );
        $queried_is_shop_page =
            ( $page_id && $page_id === $shop_page_id ) ||
            ( 'shop' === $pagename ) ||
            ( 'shop' === $name );
    
        if ( ! $queried_is_shop_page ) {
            return;
        }
    
        // If query already works as product query, do nothing.
        if ( 'product_query' === $query->get( 'wc_query' ) && 'product' === $query->get( 'post_type' ) ) {
            return;
        }
    
        // Force WooCommerce product archive query.
        $query->set( 'post_type', 'product' );
        $query->set( 'post_status', 'publish' );
        $query->set( 'wc_query', 'product_query' );
        $query->set( 'page_id', '' );
        $query->set( 'pagename', '' );
        $query->set( 'name', '' );
    
        if ( ! $query->get( 'orderby' ) ) {
            $query->set( 'orderby', 'menu_order title' );
            $query->set( 'order', 'ASC' );
        }
    
        if ( ! $query->get( 'posts_per_page' ) ) {
            $query->set( 'posts_per_page', get_option( 'posts_per_page' ) );
        }
    
        // Exclude products hidden from catalog, keep normal Woo behavior.
        $tax_query = (array) $query->get( 'tax_query' );
        $tax_query[] = array(
            'taxonomy' => 'product_visibility',
            'field'    => 'term_taxonomy_id',
            'terms'    => array( wc_get_product_visibility_term_ids()['exclude-from-catalog'] ?? 0 ),
            'operator' => 'NOT IN',
        );
        $query->set( 'tax_query', $tax_query );
    
        // Fix query flags.
        $query->is_page              = false;
        $query->is_singular          = false;
        $query->is_post_type_archive = true;
        $query->is_archive           = true;
    }, 999 );

    Best regards,
    8Theme Team

    Avatar: Preslav
    Preslav
    Participant
    March 30, 2026 at 10:37

    Did you add it, or do I need to add it?

    Avatar: Andrew Mitchell
    Andrew Mitchell
    Support staff
    March 30, 2026 at 12:45

    We have already added this code to the functions.php file of your child theme.

    Best regards,
    8Theme Team

    Avatar: Preslav
    Preslav
    Participant
    March 30, 2026 at 12:57

    Will try now.

    Avatar: Andrew Mitchell
    Andrew Mitchell
    Support staff
    March 31, 2026 at 15:32

    Thank you for your message. Please go ahead and try now, and let us know if you need any further assistance.

    Best Regards,
    8Theme’s Team

    Avatar: Preslav
    Preslav
    Participant
    March 31, 2026 at 15:34

    Okay, now I think it is visible, but not sure how long it will be. But I hope.

  • 1 2 3
    Viewing 60 results - 31 through 60 (of 61 total)

You must be logged in to reply to this topic.Log in/Sign up

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.