![]() |
Need help with options script
I'm using a validation script, and need some help. I have framed artwork, 7 sizes, 5 frame options. Howver the smallest size doesn't come framed. So I need to check they've picked a size, and a frame, unless the size they picked was the first option, then a frame isn't required. Here's what I've messed with so far
Code:
if (document.getElementById('po1701').selectedIndex == 0) |
Re: Need help with options script
OK I think the problem is in checking two elements in one if statement, b/c if I start with
Code:
if (document.getElementById('po1701').selectedIndex == 0) They both work fine. Now if I add the two variable if statement it doesn't add to cart, the function works, but it never adds to cart. Code:
if (document.getElementById('po1701').selectedIndex == 0) I'm gonna have to figure out what's up since I want two statements that check multiple values |
Re: Need help with options script
I got rid of that return true inside the if, I don't get it, it all seems to work, but the product doesn't add to cart, the page just reloads with ?&err=options in the URL
currently using: Code:
if (document.getElementById('po1701').selectedIndex == 0) |
Re: Need help with options script
Seriously! I just tried pasting the code onto another product and each product has a different class id!? There has to be a better way to do this validation!?
|
Re: Need help with options script
Ahh OK now I get it, it is working. But when it returns true, there is no product variant that matches that... so it can't add a product to the cart. Hmmm what to do now?
|
Re: Need help with options script
I'm just really annoyed at this point
|
Re: Need help with options script
OH FOR THE LOVE!
If I put in this code: Code:
if (document.getElementById('po1701').selectedIndex == 0) And have product variants that say select art size, select frame style, then it works perfectly. So does anyone know how I can take this and apply it universally without using a specific products poID? |
All times are GMT -8. The time now is 10:42 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.