Solved

Is there any woocommerce plugin that allows you to display a product page filtered by badge?

Posted on 2014-12-15
10
223 Views
Last Modified: 2014-12-16
Hi all,

Does anyone know of any plugin, free or commercial, that might allow me to display a page with products filtered by badge such as "NEW" or "ON SALE" or "OUT OF STOCK"? What I very probably am looking for is a plugin that allows me to first assign custom badges to products and then filter through them too.

thanks in advance.
0
Comment
Question by:badwolfff
  • 5
  • 4
10 Comments
 
LVL 4

Expert Comment

by:Morgan Finley
ID: 40501317
You should probably do this by adding items to categories, which would allow for filtering and other manipulation. You could then add a class to each image/post based on the category, and use CSS to add the "badges" to each.
0
 

Author Comment

by:badwolfff
ID: 40501825
Hmm thanks but not what I am looking for. My items all have categories. But across these categories there are items that from time-to-time share "on sale" or "out of stock" etc. badges. Some of these badges are auto-generated too. I need a plugin capable of loading a page with items grouped by the badge. No CSS hack can do that.
0
 
LVL 4

Expert Comment

by:Morgan Finley
ID: 40501854
My solution involves both categories and CSS. To clarify with an example:

Create a category called "On Sale" so that wp can query the database for posts/items that are on sale
The category name should now be amended to the post as a class, depending on your theme's output
Target posts with the category in your CSS and style them however you would like (perhaps overlay the badges on the post images, etc.)

You should try not to use a plugin to do something WordPress can do natively-- querying the database for posts/items of a type/category.

The benefit of doing it this way is that you can apply that badge to the post/item anywhere it's displayed on site, regardless of if they are looking at only items on sale. So if they are looking at all items/posts of a category, the CSS will style the items with the "on sale" class to have the desired badge.

What plugin generates the badges? Does it output them as images you can re-use? If it's auto-generating them, it should be able to programmatically apply them to posts of a type/category/tag. Either way it will use CSS to add the badges- it's just a question of where that CSS comes from, the plugin or the theme.
0
 

Author Comment

by:badwolfff
ID: 40501935
When items go out of stock on woocommerce, all the plugins that handle badges automatically put in a out of stock badge. Same applies to time based coupon promotions or discounts. See it is impossible with a site full of content to do it using your method. Too mechanical :(

thanks anyway
0
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

 
LVL 4

Accepted Solution

by:
Morgan Finley earned 500 total points
ID: 40501964
My solution is still the same. CSS is being applied through the plugin, probably using custom fields (which are tracked through the back end). Look at the classes and CSS of these posts/items and you will see what is happening.

Only difference from my previous answer is that instead of filtering/querying by category, it's filtering by custom field. Find out what custom fields or post meta are used by your woocommerce plugin and you will have the answer for how to filter or query the database and display only those posts you want to show.
0
 
LVL 4

Expert Comment

by:Morgan Finley
ID: 40501965
Even if it's actually adding a badge image with the img tag, it's based on what custom fields or post meta is associated with the items.
0
 

Author Comment

by:badwolfff
ID: 40501993
now that is an interesting thought worth thinking. Hmmmm...
I need to experiment. You have to be right. There must be some custom field that makes the badge go on or off.
Will keep you posted :D
0
 

Author Comment

by:badwolfff
ID: 40501996
You see the thing is, I am NOT trying to apply the badges. They are already there automatically or manually and some even expire on their own. I just want to filter them. And I think with this custom field business there might be a chance. Only problem is I have to find such info inside the plugin's code because on the GUI there are none.
0
 
LVL 4

Expert Comment

by:Morgan Finley
ID: 40501998
I understand you are not applying the badges,  but to filter them you will have to either dive into the plugin code or the plugin documentation, and find out how they are being applied. That's the first step to solve this problem.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

These days socially coordinated efforts have turned into a critical requirement for enterprises.
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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 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…

705 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

18 Experts available now in Live!

Get 1:1 Help Now