Jump to content

Creating a dialog when a certain quantity is inserted into 'Add to Cart'


Recommended Posts

Hi everyone,

I'm not the most knowledgeable person when it comes to coding, but I can usually find and achieve what I want through googling a load of stuff, this however has me stumped.

We have an online shop which is running fine. With every product it has the enter quantity feature followed by add to cart.

One product we sell is sold in singles and the majority of the time customers need 2 or more of it for it to suit its purpose. Even though it is stated on the website that it is sold in singles, customers still buy just one thinking they are getting a pair, which means we are contacting customers daily and having to amend their order.

I want to be able to have the cart feature set up so that on this particular product, if they enter a quantity of just one, a  box will pop up asking if they're sure they're only wanting just one. Then the option to cancel so they can amend the quantity, or an option to carry on with the purchase and it will then take them straight to the checkout page. But if they enter anything from 2 and over, it will just ignore it and go straight to the checkout page.

I've had a look into the Javascript if/else statements, and it seems roughly along the lines of want I'm needing. I just can't figure out the correct way to do it. I can create a dialog box, but it will come up regardless of what quantity you insert, which is not what I'm wanting to achieve.

Any help would be absolutely fantastic.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...