2

I have to make something like this:

Change the color of "Availability: In stock " depending the quantity from the stock?

but I've configurable products.

What's the way? Thanks

  • You are using default configuration for managing stock for configurable product, or, you're using "Manage Stock"? – Rahul Kumar Das Dec 30 '14 at 9:52
  • I'm using "Manage Stock" – Giacomo Dec 30 '14 at 9:59
  • You need to make the change at design level, i.e. in phtml files under template – Rahul Kumar Das Dec 30 '14 at 10:05
  • Uhm, about which file specificaly do you speak? – Giacomo Dec 30 '14 at 10:20
  • app/design/frontend/YOUR_PKG/YOUR_THEME/template/catalog/product/view.phtml – Rahul Kumar Das Dec 30 '14 at 11:11
2

You could override Mage_Catalog_Block_Product_View_Type_Configurable::getJsonConfig() to include the qtys of the associated products, then extend the JavaScript function Product.reloadPrice() to also update the CSS class of the availability element based on the respective qty.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.