Woocommerce Category Template

Posted onby admin
  1. Woocommerce Product Category Page Template
  2. Woocommerce Template Files
  3. Woocommerce Template Page

From this tutorial, you will learn how to create a custom categories archive page for WooCommerce products using JetWooBuilder plugin.

WooCommerce is an open-source plugin for WordPress which helps you create and sell anything you like, from actual products to services and digital items. We’ll overview the JetWooBuilder plugin, but first things first.

The products shortcode is one of our most robust shortcodes, which can replace various other strings used in earlier versions of WooCommerce. The products shortcode allows you to display products by post ID, SKU, categories, attributes, with support for pagination, random sorting, and product tags, replacing the need for multiples shortcodes such as featuredproducts, saleproducts. Returns true if on a page which uses WooCommerce templates (cart and checkout are standard pages with shortcodes and thus are not included). Main shop page ↑ Back to top isshop Returns true when on the product archive page (shop). Product category page ↑ Back to top isproductcategory Returns true when viewing a product category archive. WooCommerce Product categories is a custom taxonomy productcat, product tags is a custom taxonomy producttag, right? So, according to the template hierarchy in WordPress Codex, the files should be taxonomy-productcat.php, archive.php etc?

  • If so, then to create a custom category template for Woocommerce products, you need create “woocommerce” folder inside the child theme and inside it copy the file ‘archive-product.php’ from “jupiter/woocommerce/” folder inside the parent theme directory. Now you can edit this new file and it will override default parent template.
  • With our new Cosmetics Retailer WooCommerce Templates is easy to charm your clients and keep the investment to the minimum at the same time. Cosmetics Retailer WooCommerce Templates We know that a lady's heart can be conquered with gorgeous, high-quality images, which is why all our WordPress cosmetics department store themes are mainly visual.

Once you’ve created several products, usually you’re good to go. But what if you have too many products to display at once, and you want to display the product categories instead of the actual products. Thus you enable the visitors to click the specific category and access the goods that belong with it.

Styling up the product categories might be a very complicated task, that requires some coding skills. Yet you are able to work with Elementor in order to create the WooCommerce Categories Archive template using this intuitive page builder in combination with the JetWooBuilder plugin.

1 Step— Create a template

Firstly, go to JetPlugins > Jet Woo Templates tab in the WordPress Dashboard and click the “Add New” button.

Set the Category template and provide a title for it in the corresponding field at the Add Template screen.

It is possible for you to select one of the ready-to-use layouts to start.

In case you still don’t have the categories assigned for the products – create them. Go to Products > Categories, fill in the descriptions, and provide the thumbnail images representing the category to the visitors.

Click the “Create Template” button in the same window to proceed to the Elementor page builder. Here feel free to use such widgets as Title, Thumbnail, Desсription, and Count, which are made specifically for Category Archive templates and have extensive stylization settings. Mix and match them to get the desired layout of the category.

NOTE. You can enable needed widgets for the Archive Category template in the WP Dashboard in the JetPlugins > JetWooBuilder Settings > Archive Category Available Widgets section.

Navigate to the Settings block in the bottom left corner to access the Jet Woo Category Template Settings. Here you can change the template’s title, status, and, finally, manage the columns count to define how the categories will be shown in an archive.

Woocommerce Product Category Page Template

When you are done, click the “Publish” button.

2 Step— Assign the template to the page

Go back to the WordPress Dashboard and open WooCommerce > Settings. Proceed to the Jet Woo Builder tab and scroll down to the Categories Archive section.

Tick the Enable custom categories archive page option. After that, select a template you’ve recently created to set it as a custom categories archive template.

The last step is to click the “Save Changes” button and that’s it.

Now let’s take a look at the template you’ve just created. Go to your website’s frontend and check it out!

What about other options available with Crocoblock?

Keep exploring Jet plugins to get the best results in boosting your website.

Note: This is a Developer level doc. If you are unfamiliar with code/tags and resolving potential conflicts, select a WooExpert or Developer for assistance. We are unable to provide support for customizations under ourSupport Policy.
CategoryProduct

What are “conditional tags”? ↑ Back to top

The conditional tags of WooCommerce and WordPress can be used in your template files to change what content is displayed based on what conditions the page matches. For example, you may want to display a snippet of text above the shop page. With the is_shop() conditional tag, you can.

Because WooCommerce uses custom post types, you can also use many of WordPress’ conditional tags. See: http://codex.wordpress.org/Conditional_Tags for a list of the tags included with WordPress.

Note: You can only use conditional query tags after the posts_selectionaction hook in WordPress (the wp action hook is the first one through which you can use these conditionals). For themes, this means the conditional tag will never work properly if you are using it in the body of functions.php.

Woocommerce Template Files

Available conditional tags ↑ Back to top

All conditional tags test whether a condition is met, and then return either TRUE or FALSE. Conditions under which tags output TRUE are listed below the conditional tags.

The list below holds the main conditional tags. To see all conditional tags, visit the WooCommerce API Docs.

WooCommerce page ↑ Back to top

is_woocommerce()
Returns true if on a page which uses WooCommerce templates (cart and checkout are standard pages with shortcodes and thus are not included).
Template

Woocommerce Template Page

Main shop page ↑ Back to top

is_shop()
Returns true when on the product archive page (shop).

Product category page ↑ Back to top

is_product_category()
Returns true when viewing a product category archive.
is_product_category( 'shirts' )
When the product category page for the ‘shirts’ category is being displayed.
is_product_category( array( 'shirts', 'games' ) )
When the product category page for the ‘shirts’ or ‘games’ category is being displayed.

Product tag page ↑ Back to top

is_product_tag()
Returns true when viewing a product tag archive
is_product_tag( 'shirts' )
When the product tag page for the ‘shirts’ tag is being displayed.
is_product_tag( array( 'shirts', 'games' ) )
When the product tag page for the ‘shirts’ or ‘games’ tags is being displayed.

Single product page ↑ Back to top

is_product()
Returns true on a single product page. Wrapper for is_singular.

Cart page ↑ Back to top

is_cart()
Returns true on the cart page.

Checkout page ↑ Back to top

is_checkout()
Returns true on the checkout page.

Customer account pages ↑ Back to top

is_account_page()
Returns true on the customer’s account pages.

Endpoint ↑ Back to top

is_wc_endpoint_url()
Returns true when viewing a WooCommerce endpoint
is_wc_endpoint_url( 'order-pay' )
When the endpoint page for order pay is being displayed.
is_wc_endpoint_url( 'order-received' )
When the endpoint page for order received is being displayed.
is_wc_endpoint_url( 'view-order' )
When the endpoint page for view order is being displayed.
is_wc_endpoint_url( 'edit-account' )
When the endpoint page for edit account is being displayed.
is_wc_endpoint_url( 'edit-address' )
When the endpoint page for edit address is being displayed.
is_wc_endpoint_url( 'lost-password' )
When the endpoint page for lost password is being displayed.
is_wc_endpoint_url( 'customer-logout' )
When the endpoint page for customer logout is being displayed.
is_wc_endpoint_url( 'add-payment-method' )
When the endpoint page for add payment method is being displayed.

Ajax request ↑ Back to top

is_ajax()
Returns true when the page is loaded via ajax.

Working example ↑ Back to top

The example illustrates how you would display different content for different categories.

if ( is_product_category() ) {
if ( is_product_category( 'shirts' ) ) {
echo 'Hi! Take a look at our sweet tshirts below.';
} elseif ( is_product_category( 'games' ) ) {
echo 'Hi! Hungry for some gaming?';
} else {
echo 'Hi! Check our our products below.';
}
}