| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
product options validation | ||||
|
|
Thread Tools | Search this Thread |
#11
|
|||||||
|
|||||||
Does anybody know how to make this work for blank user input field?
Thanks. M |
|||||||
#12
|
|||||||
|
|||||||
Mitchi
If you just want a field that the customer can type something about the product, say if you offer personalisation of pens or mugs and you want the customer to be able to say what they want printed on it, just type "personalisation" or whatever in the Option Class box, type "Please anter your message" in the Option Text box, and leave the Options List empty. When the customer types the message in the box, you see it as an item option on the order. hth Dave
__________________
Quiet please... I'm trying to unscramble my brian. http://lizzybug.co.uk (live, minor mods, 4.0.15) EZCheckout/EZUpsell (Must have mods!) Firetank's Featured Products Manager, and loads of little mods off the forum (thanks all!) http://www.jellybeangifts.co.uk (live, 4.0.18 ) Fancy Cats + custom colour mod |
|||||||
#13
|
|||||||
|
|||||||
Thank's, Dave! I'll give it a try.
M |
|||||||
#14
|
|||||||
|
|||||||
Can anyone help finally getting this to work?
Here is my thinking and need. I have seen several post requesting to cange an image based on a selected option. What I need to make this happen are the variables associated with the option. (Obvious) right?
My thinking is that if exceptions (If they worked) can pop an alert, I should be able to capture the values needed to make a simple image change. I have copied and pasted the example straight from the Product admin, and when I click add to cart it does not respond at all. The question I ask is was this tested prior to included it in the release build and if so, why not help us out if it is not working. I need to check the forum to see if there is a Bug reporting category, but that is still not going to help the group out at all. If there is any kind sole out there that is not going to respond to this request with psot it in the professional section so I can cash in on your pain, please help me out. I have been punding at this non-stop for 3 days now and really need assistance so I can move on to more important things like developing my product line. Thanks you guys George |
|||||||
#15
|
|||||||
|
|||||||
Follow-up - break through
This will help the folks that simply want to get exceptions to work! Beware that if you are on a mac like I am, no alerts will pop until you do what is lsited below. I hit it on a PC and the behavior is that if there is 1 exception and 10 options, it will only alert for that single exception and proceed to the cart.
Here is the secret that is not documented anywhere: 1. If you have 10 options, you'd better make exceptions for all 10. The numbering does not start at 1, it starts at 0. The Real example: if (product_option('Shirt').selectedIndex == 0) { alert('You have chosen Color White Shirt'); return true; } if (product_option('Shirt').selectedIndex == 1) { alert('You have chosen Color Gray Shirt'); return true; } if (product_option('Shirt').selectedIndex == 2) { alert('You have chosen Color Charcoal Shirt'); return true; } if (product_option('Shirt').selectedIndex == 3) { alert('You have chosen Color Laguna Shirt'); return true; } if (product_option('Shirt').selectedIndex == 4) { alert('You have chosen Color Blue Shirt'); return true; } if (product_option('Shirt').selectedIndex == 5) { alert('You have chosen Color Orange Shirt'); return true; } if (product_option('Shirt').selectedIndex == 6) { alert('You have chosen Color Purple Shirt'); return true; } if (product_option('Shirt').selectedIndex == 7) { alert('You have chosen Color Yellow Shirt'); return true; } if (product_option('Shirt').selectedIndex == { alert('You have chosen Color Red Shirt'); return true; } if (product_option('Shirt').selectedIndex == 9) { alert('You have chosen Color Green Shirt'); return true; } I am getting it to pop up with the correct color selections now. Now it's on to capturing and storing so that I can construct an image name. Once I figure this out, I'll share it here as well. (If I am successful of course) Maybe someone else can jump in with suggestions on how to change the alert to a javascript variable that can be used in php! to be continued .... |
|||||||
#16
|
|||||||
|
|||||||
I have a single blank input field as a product option, for the customer to fill in a promotional code.
Any idea what validation script to use, so the option is not left blank? Thanks PhilJ |
|||||||
#17
|
|||||||
|
|||||||
How to Validate a Text Entry Field / Product Option
This example assumes you have a product option with a class of PaperColor and you want to make sure the field isn't left completely blank.
Quote:
The "return false;" statement stops X-Cart from adding the product to the cart. You could also ask the user if the field is intentionally left blank using the following code: Quote:
The confirm is like an alert except it has "OK" and "CANCEL" buttons. If the user clicks "OK" the product will be added, if they click "CANCEL" it will not be added. If you need any other JavaScript validation help let me know - I know JS like the back of my hand. Al Ponte agponte@infosolvllc.com
__________________
--------------------------------------------- Infosolv, LLC A Professional Services Company X-Cart v3.5.10 & 4.01 Find our MOD\'s at: Custom X-Cart MOD\'s, Add-On\'s & X-Cart Hosting! |
|||||||
#18
|
|||||||
|
|||||||
Mod That Auto-Checks All Options
I have a mod that I developed that allows you to specify whether an option is "Required", "Verified" or "None" by using a drop-down box next to each option.
If an option is "Required" then the customer cannot add to cart if the field is blank, "Verified" asks the user to confirm the blank entry before adding to the cart, finally "None" is not validated at all. Email me if you are interested.... Al Ponte agponte@infosolvllc.com
__________________
--------------------------------------------- Infosolv, LLC A Professional Services Company X-Cart v3.5.10 & 4.01 Find our MOD\'s at: Custom X-Cart MOD\'s, Add-On\'s & X-Cart Hosting! |
|||||||
#19
|
|||||||
|
|||||||
Many thanks Adian009
Code:
You can still bypass it, by pressing Enter in the product option field, so I disabled the Enter key... Add this script to the top of skin1/customer/main/product.tpl Code:
then find /skin1/modules/Product_Options/customer_options.tpl change Code:
to Code:
|
|||||||
|
|||
X-Cart forums © 2001-2020
|