Help: Limit Maximum Item Quantity

we would like our customers to order only up to 5 items per order. I tried to use below script but I am having a problem. After alert is displayed, I want the customers to stay in the same page where they visited but it does not load that page and I rather get blank page.

if ($quantity > 5) DIE (“”);

Thanks for your help in advance.

You can implement javascript validation on the ordering page, say when they click on “Checkout” button, you can show alert (add this javascript code only if $quantity is greater than 5). If you want to validate in PHP script, you need to modify PHP code that generates ordering page too.

Thanks for your reply.

Sponsor our Newsletter | Privacy Policy | Terms of Service