Jump to content

[Solved] Displaying Proper Inventory Levels for Attributes


Recommended Posts

Is it possible to have the inventory listed on a product page change depending on which attribute is selected? It seems like this would be the default behavior, but it isn't (as far as I can tell). Here's an example of what I'm looking for: My client sells necklaces, and every necklace is available in 18" and 20" lengths. It's easy enough to create those attributes and assign them to the necklaces, and to set the inventory levels per attribute (Necklace A @ 18", 4 in stock; Necklace A @ 20", 7 in stock). The product page shows the inventory for the 18", since it's the default choice ("4 in stock"), but when the user chooses the 20" length, the stock numbers don't change (it should say "7 in stock" after it's changed). Again, this seems like it should be the default behavior - am I missing something in my configuration? I can probably come up with some code that will do the trick, but I'd like to avoid doing so if I can.

Link to comment
Share on other sites

I started digging into this problem and it looks like it *is* trying to alter the quantity listing when the user selects a different attribute - it's just coming up with the wrong quantity number (it appears to be assigning the quantity of the first attribute as the quantity for all attributes). I haven't altered the product.js scripts at all, so is this a known issue?

Link to comment
Share on other sites

I'm going to mark this as solved, even though I haven't quite figured it out just yet. I switched to the default theme and the stock quantity started updating properly, so it's clearly a problem with my custom theme. It's not throwing any JavaScript errors, so I've got some digging to do.

Link to comment
Share on other sites

×
×
  • Create New...