Solved

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

Posted on 2015-01-29
1
273 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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Suggested Solutions

In order to have all security and back ups taken care of, WordPress users can sign up for services with WP Engine.
Businesses who process credit card payments have to adhere to PCI Compliance standards. Here’s why that’s important.
The purpose of this video is to demonstrate how to add AdSense Ads to a WordPress Website, and how to set up WordPress to automatically place Ads in Sidebars. This will be demonstrated using a Windows 8 PC. Log into your AdSense account. : Cli…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

828 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