how do i add a top variant - ie, -- please select--
we don't want our variants to default to the first size or color -- how can we have it be a --- please select ---? i added it to the macro code, but it still switches to small even though i have --- please select -- hard coded. where is this being set?
No you need to just add the ---Select--- to the html.
Then when its in the html you will have to fix the javascript to not auto select the first variant. I cant remeber where it is in the JS but try and debug it :)
This is the code you're looking for in the teaCommerce_Advanced.js:
jQuery('select.productVariants').live('change',function(){ //Update a single product in the UI updateProduct(jQuery(this).closest('.productToUpdate')); });
Check the value of jQuery(this) and do nothing if it's zero.
Have you purchased your tickets for this years Code Garden in Copenhagen? Hope to be seing you there again.
/*
PRODUCT VARIANTS CHANGE
*/
jQuery('select.productVariants').live('change', function () {
//Update a single product in the UI
if (jQuery(this)== '0') {
// do nothing
} else {
updateProduct(jQuery(this).closest('.productToUpdate'));
}
});
how do i add a top variant - ie, -- please select--
we don't want our variants to default to the first size or color -- how can we have it be a --- please select ---? i added it to the macro code, but it still switches to small even though i have --- please select -- hard coded. where is this being set?
thanks,
Hi Bob,
The --please select-- is just an option you should add to the variants select.
Just set it's value="0". You might then have to change some JavaScript int the advanced js, to ignore the onChange event when the value is 0.
How does that sound?
/Rune
but that is what i am doing... however, it selects the first actual variant -- are you saying i need to add a variant called --- select -- ?
Hi Bob
No you need to just add the ---Select--- to the html.
Then when its in the html you will have to fix the javascript to not auto select the first variant. I cant remeber where it is in the JS but try and debug it :)
Kind regards
Anders
the only thing i can find is here... and i dont' think this is what does it?
This is the code you're looking for in the teaCommerce_Advanced.js:
jQuery('select.productVariants').live('change', function () {
//Update a single product in the UI
updateProduct(jQuery(this).closest('.productToUpdate'));
});
Check the value of jQuery(this) and do nothing if it's zero.
Have you purchased your tickets for this years Code Garden in Copenhagen? Hope to be seing you there again.
/Rune
Rune, my ticket for the event is purchased... now to get travel and room squared away!
thanks for the pointer on the piece of javascript... let me see what i can figure out from here... stay tuned.
hmmm... that did not appear to do anything...
if it is at all helpful... here is the page.
http://iouelocal30.org.ourdevsite.com/local-30-store.aspx
Hi Bob,
Here you go:
http://api.jquery.com/val/
And cool that you're coming to Copenhagen. Then I can give you a few jQuery pointers ;)
/Rune
is working on a reply...