Solved

How do I make a custom product loop in woocommerce just for category display?

Posted on 2015-01-29
1
279 Views
Last Modified: 2015-05-21
Hi,

I'm using WordPress and the Woocommerce plugin and I need to display the category loops differently from the main shop loop but can't work out how to do it.

The theme that I am using uses shortcodes to pull in the product loops. For example:

[product_category category="Courses" orderby="name" order="asc"]

Open in new window


I need to customise this and other category loops differently from the main shop which displays all products.

The main shop will remain as a 4 column grid but the category pages need to have a totally different layout and styling.

I've been all over the web and grepped for code and tags in the plugin dir but I just can't find any hint of what I need to do.

Can someone please point me in the right direction?

Thanks.
0
Comment
Question by:Letterpart
1 Comment
 
LVL 15

Accepted Solution

by:
eemit earned 500 total points
ID: 40580113
You can do the following:

Add columns attribute to the shortcode e.g:
[product_category category="Courses" orderby="name" order="asc" columns="3"]

Open in new window


Style it with CSS (add this to your child theme's style.css) e.g.:
.woocommerce.columns-3 ul.products li.product {
    float: left;
    margin: 0 3.8% 2.992em 0;
    padding: 0;
    position: relative;
    width: 29.4%;
}

Open in new window


You can also try to override content-product_cat.php template
by copying it to yourchildtheme/woocommerce/content-product_cat.php.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
The purpose of this video is to demonstrate how to prevent comment spam on a WordPress Website. This will be demonstrated using a Windows 8 PC. Plugin Akismet will be used. Go to your WordPress login page. This will look like the following: myw…
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question