Website Building » WooCommerce » How Do I Create a Custom Shop Page in WooCommerce?

How Do I Create a Custom Shop Page in WooCommerce?

Last updated on January 18, 2023 @ 1:23 pm

There are two ways to create a custom shop page in WooCommerce. One is to create a new page template and the other is to use a plugin.

Creating a new page template:

In your theme folder, create a new folder called ‘WooCommerce’.

PRO TIP: If you are not comfortable with code or making changes to your site content, then we recommend that you seek help from a WooCommerce expert before proceeding. Making changes to your shop page can have unintended consequences and break your WooCommerce shop.

In this new folder, create a file called ‘shop.php’ and paste the following code into it:

<li class="product">
<?php
if (has_post_thumbnail( $loop->post->ID )) {
  echo get_the_post_thumbnail($loop->post->ID, 'shop_catalog');
} else {
  echo '<img src="'.woocommerce_placeholder_img_src().'" alt="Placeholder" width="65px" height="115px" />';
}
?>
<a href="<?php echo get_permalink($loop->post->ID)?>" title="<?php echo esc_attr($loop->post->post_title ? $loop->post->post_title : $loop->post->ID); ?>"> <?php the_title(); ?> </a>
<br />
<?php echo $product->get_price_html(); ?>
</li>
<?php
endwhile;
echo '</ul><!--/.products-->';
} else {
echo 'No products found';
}
wp_reset_query();

In conclusion, there are two ways to create a custom shop page in WooCommerce.

Drew Clemente

Drew Clemente

Devops & Sysadmin engineer. I basically build infrastructure online.