Developer forum

Forum » Development » Stock numbers and ordering

Stock numbers and ordering


Reply
I've got a question about the Stock numbers / status from Ecom.

Our Customer uses the build-in stock status. So when an item drops below 1, it stops to display the item.

But, it's still possible for someone to order 13 items of the same product, while the Stock number is on 5. Ecom accepts it and just shows it as -8 then.

Is there a way to stop this? So that if an item has a stock of 5, people can't order more than 5?

Thanks in advance,

Replies

 
Reply

Hi Robert,

There are two ways of handling it:

1)
Frontend via javascript. Make use of the <!--@Ecom:Product.Stock--> template tag. Make a comparison on the required amount (text input) and the amount on stock (template tag) and prevent the submit from happening if it doesn't apply your rules.

2)
Use the CartLineAdded notification to check the same as above. This requires a custom DLL and is not as straight forward as #1.


Regards /Snedker

 

You must be logged in to post in the forum