Solved

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

Posted on 2014-12-15
10
229 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 3

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 3

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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

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
 
LVL 3

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 3

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 3

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

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
This article discusses how to create an extensible mechanism for linked drop downs.
The purpose of this video is to demonstrate how to reset a WordPress password if you are locked out and cannot reset the password. A typical use would be if you cannot access the email to which WordPress would send the password recovery email to…
The viewer will learn how to dynamically set the form action using jQuery.

809 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