Solved

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

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
E-commerce is quite a gambling world, and you should never entrust your business to a lucky chance. In order to outrun your competitors in a race to attract as many customers as possible, you need to have a well thought-out strategy under your belt.…
The purpose of this video is to demonstrate how to exclude a particular blog category from the main blog page. This is can be used when a category already has its own tab, or you simply want certain types of posts not to show up on the main blog. …
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…

747 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now