Solved

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

Posted on 2014-12-15
10
231 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
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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.

 

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

Suggested Solutions

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
The purpose of this video is to demonstrate how to update a WordPress Site’s version. WordPress releases new versions of its software frequently and it is important to update frequently in order to keep your site secure, and to get new WordPress…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

820 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