skip to Main Content

I am setting up a shop section of my website in WooCommerce.

I only have 1 product to sell, so therefore when my users click the ‘store’ option from my main menu I want it to take them straight to that specific product page where they can see an image of the product,a full description and add it to their basket.
I don’t want them to have to navigate to a conventional ‘store’ page beforehand because 1 only have 1 product but WooCommerce won’t let me set it up this way. It should be as simple as defining a custom URL but it appears not.

Any ideas as to how I can get around this? Thanks

3

Answers


  1. You should use any Redirect plugin, redirect yourdomain/shop to yourdomain/specific-product-page.

    Login or Signup to reply.
  2. Why don’t you create a custom link to the product page in your main menu, and name the link “Shop”.

    Login or Signup to reply.
  3. You could add a redirect to the_post hook with the product_id of the product in question to your themes/child themes functions.php file like this:

    function stackoverflow_redirect_back_from_shop(){
        if( is_shop() ){
            $url = get_permalink( $product_id );
            wp_redirect($url);
        }
    }
    
    add_action('the_post', 'stackoverflow_redirect_back_from_shop');
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search