Stock Available Yes or No

I would like to have my stock showing Yes or No, rather than how many items. I am now running 1.3.5 and have searched the forum for the answer but when I put the suggested code into the tpl it does not work, can somebody please explain how I get this to work in 1.3.5 as the coding seems to be different?

Thanks a bundle!

Have a look at this thread - this worked great for our site.



[url]http://forum.cs-cart.com/showthread.php?t=3175&highlight=stock[/url]



Barry

I tried that one yesterday and it gave me fatal errors as the coding was different from the old cs cart, do you happen to have the code you have used and paste it up here so I can use it please,

Did you create two languages? ie $lang.stock_available



Barry

{{$product.amount} {$lang.items}}



{if $product.amount >0} {$lang.stock_available}

{/if}

{if $product.amount <=0} {$lang.stock_not_available}

{/if}

I’ll give that a shot thankyou !

BarryH.



If you’ld encode the coding portions with these brackets at the start and finish it will show the code exactly as pasted.



“[code.] and [/code.]” (remove the “.'s in each”)

Thanks Jesse will try to remember, I don’t post much code as it’s not my strong point, I am still running trying to catch up with the average coder!!!



Barryh

Brilliant that worked, I had not made the variables… but its fine thanks for the help!

I can’t get this one to work with options. I looked at the thread posted above and the javascript that was offered didn’t work for me. Any ideas on where I’m messing this up?

[quote name=‘moka’]I can’t get this one to work with options. I looked at the thread posted above and the javascript that was offered didn’t work for me. Any ideas on where I’m messing this up?[/QUOTE]



Not really sure where you going wrong ours works fine in options…



[url]http://www.bhdiyandpets.co.uk/brown-suede-and-fur-with-reversible-cushions-.html[/url]



Don’t recall having done any alterations in options tho???



Barryh

The code that was posted has “whatever you want here” written… so I’m wondering I filled that in right!



When I alter them, it still says “available” for items not in stock.

[quote name=‘BarryH’]{{$product.amount} {$lang.items}}



{if $product.amount >0} {$lang.stock_available}

{/if}

{if $product.amount <=0} {$lang.stock_not_available}

{/if}[/QUOTE]

These are all you need to do! The code at the bottom of the post is for something else.



You will need to edit languages if you want to change what it says.

In settings have you got “allow negative stock” ticked?

Neg. stock is not ticked. The above code works great if I have no options, but if I one option is “0”, it still says available. The thread posted above says to edit exceptions.js, and gives a code, but is rather vague. Gives a code that says “whatever you want here”. It also doesn’t say whether you also need to change category-details or not.:confused:

Have you got “track with options” set on the detailed information for your product?



Barry

yes, I am tracking with options… thanks for trying to help me with this!!

If you can post your url or PM it to me so I can have a look!



Barry

What version are you on?

I’m on 1.3.5 sp2

Does yours say “unavailable” with 0 inventory with options? Thank you for trying to help me!