?
Solved

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

Posted on 2014-12-15
10
Medium Priority
?
245 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
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!

 

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 2000 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In this article, we will look at our content management system as a whole, to get an idea of how we will start to manage these content items.
I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
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.
Suggested Courses

719 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