Hiding the size or color attribute when they are out of stock
Written by Matt on July 16, 2008 – 2:30 pmYou can hide the size attributes on the Product/Catalog Detail page if the attribute is out of stock, you can modify it for color as well. You could take this code and modify it for other similar functions.
**note** Most likely this code will only work with Advanced Tier or higher ProStores sites.
**note** This snippet of code ONLY works on the Product/Catalog Detail template. You will need to do some editing with the Add to Cart template as well as the Detail template to get this code to work properly.
<td>
<font face="arial,helv" size="2"><b>Size</b>
<select name="size">
<ss:foreach item="attr" within="$product.attributes">
<ss:if test="$attr.quantity <> 0">
<option value="$attr.size"><ss:value source="$attr.size"/></option>
</ss:if>
</ss:foreach>
</select>
</font>
</td>
Tags: coding, product detail template, prostores, Tips
Posted in ProStores Coding, Tips | 12 Comments »
July 16th, 2008 at 3:54 pm
Does this only really apply to Advanced Tier Prostores?
July 16th, 2008 at 4:01 pm
Thats a good observation, I hadn’t thought of that so I’ve looked it up and I cannot tell you for sure because I don’t have access to a business level account.
But! Most likely you are correct, if the business level accounts don’t have attributes with quantities then this code wouldn’t apply/work.
I note the post to reflect this.
Thanks!
January 6th, 2009 at 4:39 pm
Aloha…
any idea how the functionality ofyour code to the following chunck?
Size:
Mahalo from Hawaii
January 6th, 2009 at 4:45 pm
Hi Bill,
I only see the word “Size:” Could you provide a little more detail?
Thanks!
Matt
January 6th, 2009 at 5:04 pm
sorry Matt
i pasted a chunk of code but all tags (html and ssml) were stripped out
is there a trick?
I’ll try it again
Size:
January 6th, 2009 at 5:25 pm
This is the one thing thats been really annoying with Wordpress, I’m constantly having issues with posting code in it. It may be spam protection built into wordpress.
Try sending to it to my e-mail matt@onetakemedia.net and I’ll repost it back.
January 6th, 2009 at 5:34 pm
here it goes…
Size:
February 10th, 2009 at 12:00 am
I still can’t get this code to work. Where exactly in the Product Detail page or Add to Cart page do you paste it in?
February 15th, 2009 at 2:29 pm
Hi Mr. Jenkins, What exactly is happening when you say its not working, is there an error message?
February 26th, 2009 at 8:03 pm
is there any way to hide the “add to cart” button, even when quatity says “0″? want to display the product info but need to disable the “add to cart” feature. help! any ideas?
February 26th, 2009 at 8:33 pm
Hmm, that would require creating a if statement that determined if the total of all attributes = 0 then hide the add to cart button or display an alternate graphic.
That would take some time and probably some custom coding, right now my schedule doesn’t really have spot in it to create something like that.
But if you spend some time in the SSML reference guide I get you could create it.
Thanks for reading!!
Matt
February 27th, 2009 at 3:52 pm
sounds like a good idea. i will try reading the guide…thanks!