Display $$STOCKQUANTITY$$ for each product on category page
$$STOCKQUANTITY$$ works fine on product pages, but how can I get the same to work on category pages? FYI, I need this to work in just ONE category, not the entire store.
Thanks in advance for any help/suggestions!
-
Hi Kathy,
On the category page, I believe you have to use the merge code ##QUANTITYONHAND##.
The only way I can think of off the top of my head to make this show up on only one category would be to have the merge code hidden on all category pages, and use JavaScript to check the page URL or some other variable that only exists on that category and have it unhide that section.
Just a quick example:
In category template, add the following where you want the in stock quantity to show:
<div class='hide' id='QOH'>##QUANTITYONHAND##</div>
Javascript:
<script>
if (window.location.href.indexOf("This_Category_URL.html") > -1){
$('#QOH').removeClass('hide');
}
</script>0 -
Thank you Joshua. Not sure how I missed this reply, but I will certainly give this a try!
0
Please sign in to leave a comment.
Comments
2 comments