Single Product WooCommerce Website

Sometimes you have an online store with one product or service to sell only. Sometimes that is because that is all you are selling, sometimes it is because you are just starting out. So how could you make the shop look good with a single product WooCommerce website?

Single Product Shop Layout

Oftentimes you will think that having a shop page is kind of overkill, but WooCommerce creates this page as it creates other pages like “My Account”, Cart and Checkout. So what should you do with this shop page? Well you could style it in such a way that the shop page looks a lot like the single product page. And then you could make it possible to directly put the item in the basket and go to the one page checkout. This way you will be bypassing the product page itself though that page will also exist.

Bypass Shop Page

Somehow that does not seem right to me. I would think it is better to have the product page and not have the shop page. So how could we do this? Well, we could make visitors skip the shop page, but building in a redirect to your product and by hiding the shop page by not mentioning it in the menu.

Helga the Viking mentioned a possible redirect option here:

function so_template_redirect(){
 if( function_exists( 'is_shop' ) && is_shop() ){
 $product_id = 999; // change to the ID of your 1 product
 $permalink = get_permalink( $product_id );
 wp_redirect( $permalink );
 exit();
 }
 }
 add_action( 'template_redirect', 'so_template_redirect' );

Using the template_redirect a redirect can be done the WordPress way. I may be stating the obvious, but you need to add this code to the functions.php of your child theme or add it to a separate plugin perhaps dedicated to custom functions.

Presentation Single Product

The single product could be mentioned the navigation using the name shop or whatever you would like it to be. This way you create a single product WooCommerce website. A shop with one product that bypasses the superfluous shop overview page.

Jasper Frumau

Jasper has been working with web frameworks and applications such as Laravel, Magento and his favorite CMS WordPress including Roots Trellis and Sage for more than a decade. He helps customers with web design and online marketing. Services provided are web design, ecommerce, SEO, content marketing. When Jasper is not coding, marketing a website, reading about the web or dreaming the internet of things he plays with his son, travels or run a few blocks.