Download & Extend

Adding product Status class - In order to display out of stock badge

Project:Commerce Stock
Version:7.x-2.0-alpha3
Component:Miscellaneous
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

NOTE: I previously posted this as an issue for Drupal commerce (http://drupal.org/node/1877792) but I figured people here might be a lot more interested in this solution and willing to help out, so I reposted it here.

First things first, I am using this: http://drupal.org/node/1689458#comment-6619434 rule in order to disable product variations that are out of stock. This causes the product to be completely disabled once all of its variations are out of stock.

It would be great if the status field that can be displayed for each product stating whether it is disabled or active would have a extra class that would simply state whether or not the product was disabled or active. So in the source code it would be something like this "status-disabled"> "

This would enable you to display an out of stock badge over the image with a tiny bit of css trickery and thus give people the much so desired "Out of Stock Badge" (A little googling will show you endless results of people asking for it)

I am a designer and not a programmer so unfortunately I can't provide a patch myself. But I would be more than happy to create the css and badge image in order to help people get started if someone is willing to help out with the coding. :)

Regads,
Gilli

Comments

#1

For those interested, I found a way to display an out of stock badge for drupal commerce using the add to cart form rather than the Status field. I created a tutorial that shows you how. You can find it here

#2

Status:active» closed (fixed)

@s2sz, Thanks for sharing

nobody click here