| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Product Options Dropdown "Select XXXX..." | ||||
|
|
Thread Tools | Search this Thread |
#11
|
|||||||
|
|||||||
Hey thanks Yes, I'm a big fan of clean and simple.
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#12
|
|||||||
|
|||||||
In 4.1.0, the "{if $o.selected eq 'Y'} selected="selected"{/if}" forces the first option to be selected and ignores my added "option". You simply have to move "{if $o.selected eq 'Y'} selected="selected"{/if}" from the looped option to the title option that you added.
I didn't notice this being forced prior to 4.1, but the code was there prior. There must be something that prevented the forced selection in previous versions that is fixed now. - Mike
__________________
4.1.9 |
|||||||
#13
|
|||||||
|
|||||||
can we add the javascript code anywhere in a global spot to alert, with a generic message, if the first item is selected? Instead of having to add the validation code in the product options for each product and changing the 'poNNNN', etc....
__________________
----------------------- x-cart v4.7.6 [LIVE] x-cart v4.0.18 [retired 2004-2016] x-cart v3.5.13 [retired] x-cart v3.4.14 [retired] |
|||||||
#14
|
|||||||
|
|||||||
You can import the javascript validation in 4.1.x if that helps. Otherwise there are probably some options about the forum.
- Mike
__________________
4.1.9 |
|||||||
#15
|
|||||||
|
|||||||
Hi Mike and everybody,
thats amazing mod, thanks Mike. I have a question if customer choose ONLY one option so they can only choose color option or size option. What can i do? --HEK
__________________
HEK X-Cart 4.1.3 Gold PHP 4.3.11 MySQL server 4.0.27 |
|||||||
#16
|
|||||||
|
|||||||
If you create the validation for each (and all) options, then it isn't possible to select only one option.
- Mike
__________________
4.1.9 |
|||||||
#17
|
|||||||
|
|||||||
Re: Product Options Dropdown "Select XXXX..."
Thanks Mike. Great Mod. Just what I needed.
__________________
X-Cart Gold v 4.3.2 X-AOM, Marketing Manager, On Sale |
|||||||
#18
|
|||||||
|
|||||||
Re: Product Options Dropdown "Select XXXX..."
Wow. Lovely mod. Very useful. Thank you.
Post #12 is required reading to make this work for 4.1.x Here are the changes I made to my customer_options.tpl, as a reference (version 4.1.8 ) FIND: Code:
REPLACE WITH: Code:
Mike -- this a GREAT addition. Thank you!
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4 |
|||||||
#19
|
|||||||
|
|||||||
Re: Product Options Dropdown "Select XXXX..."
Mike (or any javascript expert):
In Firefox/Mac (only) the warning popup box hugs the top of the window. IN every other browser (including Firefox/win, Safari/mac, MSIE 6/7) the box either centers on the display or is at a position to be visible to the user. Is this a default of the error popup box, or do you know if it's possible to position this error box somehwere -- force it to the middle of the screen, or x=300 y=300 or something besides huging the top of the window (as it does in Firefox/mac). This may be a Firefox bug -- but it may be solved with a line of code that forces the error ox where we want it. Any ideas? Thanks! Jeremy
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4 |
|||||||
#20
|
|||||||
|
|||||||
Re: Product Options Dropdown "Select XXXX..."
you should use document.getElementsByTagName("select") rather than using product option id's since some products may have multiple options
that will return an array of all the elements that have the <select> tags you would then loop through each array element's value and if it equals "noneselected" (replace with the value you used for the default none selected option, if it doesnt have a value, assign one) or you can compare with the index equaling 0 if the loop stumbles upon just 1 thats not selected, break the loop and throw an error message |
|||||||
|
|||
X-Cart forums © 2001-2020
|