Hi,
I'm having some issues with a little Miva project I'm helping out on (Coming back to Miva's a bit of a culture shock coming from my ASP.NET day job). I'm attempting to display option-level stock information on a category page in order to build a JSON object which gives a full representation of in-stock items for that category. Aiming to end up with something like:
To that end I've got a page with Category List layout of:
...and Product Attribute Template of:
This works perfectly well for the first product but after that it doesn't seem to load the option stock data properly so I end up with something like:
I've naively played around with where I put the InventoryManager "load_data" but I think that's me barking up the wrong tree. Stock is definitely tracking properly for all the products in this category soooo... Can anyone point out the error I'm making?
Cheers,
Sam
I'm having some issues with a little Miva project I'm helping out on (Coming back to Miva's a bit of a culture shock coming from my ASP.NET day job). I'm attempting to display option-level stock information on a category page in order to build a JSON object which gives a full representation of in-stock items for that category. Aiming to end up with something like:
Code:
[ { "Code": "Product1", "Attributes": [ { "Prompt": "Black Small" }, { "Prompt": "Black Medium" }, { "Prompt": "Black Large" } ] }, { "Code": "Product2", "Attributes": [ { "Prompt": "Black Small" }, { "Prompt": "Black Large" }, { "Prompt": "Black XL" } ] }, ... ]
Code:
[<mvt:foreach iterator="product" array="products">{ "Code": "&mvt:product:code;", "Attributes": <mvt:item name="product_attributes" /> }, </mvt:foreach> ]
Code:
<mvt:item name="InventoryManager" param="load_data" /> [ <mvt:foreach iterator="attribute" array="attributes"> <mvt:foreach iterator="option" array="attribute:options"> <mvt:if expr="l.settings:option:im_inventory:inv_count GT 0"> {"Prompt": "&mvt:option:prompt;"}, </mvt:if> </mvt:foreach> </mvt:foreach>""]
Code:
[ { "Code": "Product1", "Attributes": [ { "Prompt": "Black Small" }, { "Prompt": "Black Medium" }, { "Prompt": "Black Large" } ] }, { "Code": "Product2", "Attributes": [] }, { "Code": "Product3", "Attributes": [] }, { "Code": "Product4", "Attributes": [] } ]
Cheers,
Sam
Comment