Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Product Options Pulldown

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 03-01-2007, 11:20 AM
 
grayloon grayloon is offline
 

Member
  
Join Date: Oct 2006
Posts: 27
 

Red face Product Options Pulldown

I modified /skin1/modules/Product_Options/customer_options.tpl with the code below to display "Select an option..." in the product options select menu. How/where do I modify the javascript to require a selection before adding to the cart?

Code:
<select id="po{$v.classid}" name="{$poname}"{if $disable} disabled="disabled"{/if}{if $nojs ne 'Y'} onchange="javascript: check_options();"{/if}> <option value="" selected="selected">Select an option...</option> {foreach from=$v.options item=o} <option value="{$o.optionid}"{if $o.selected eq 'Y'}{/if}>{$o.option_name}{if $v.is_modifier eq 'Y' && $o.price_modifier ne 0} ({if $o.modifier_type ne '%'}{include file="currency.tpl" value=$o.price_modifier display_sign=1 plain_text_message=1}{else}{$o.price_modifier}%{/if}){/if}</option> {/foreach} </select>
__________________
X-Cart Pro 4.1.5
Reply With Quote
  #2  
Old 03-01-2007, 12:49 PM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default Re: Product Options Pulldown

Not sure about the pro 4.1 version, but in 4.0.x it is done with validation scripts. Have a look at the manual which gives some examples.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #3  
Old 03-02-2007, 05:13 AM
 
grayloon grayloon is offline
 

Member
  
Join Date: Oct 2006
Posts: 27
 

Default Re: Product Options Pulldown

I checked the manual, and it appears to be product specific. My providers are going to be totally lost if I try to explain the necessity and procedure of adding javascript validation scripts for products with options. Anything easier I could do?
__________________
X-Cart Pro 4.1.5
Reply With Quote
  #4  
Old 03-02-2007, 05:17 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default Re: Product Options Pulldown

I just had X-Cart write me a global product option validation, but it was done for 4.0.18, so that won't help you in 4.1
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #5  
Old 04-13-2007, 06:14 AM
 
gfiebich gfiebich is offline
 

Senior Member
  
Join Date: Feb 2003
Location: St. Paul, MN
Posts: 108
 

Default Re: Product Options Pulldown

Any chance you'd be willing to share that global validation script? I'm in need of that functionality for a 4.0.18 site.

thanks,
Glen
__________________
NO LONGER USING X-CART - NOT ACTIVE IN THESE FORUMS
Reply With Quote
  #6  
Old 04-13-2007, 06:17 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default Re: Product Options Pulldown

Yea, I've been meaning to post it in the Completed Custom Mods forum, but haven't had time to extract the custom code out. I may just post the revised files instead of the step by step code edits. I'll post here when I have added the thread.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #7  
Old 05-05-2007, 04:06 AM
  Dongan's Avatar 
Dongan Dongan is offline
 

X-Wizard
  
Join Date: Jul 2005
Location: www.mercuryminds.com
Posts: 1,531
 

Default Re: Product Options Pulldown

Quote:
Originally Posted by balinor
Yea, I've been meaning to post it in the Completed Custom Mods forum, but haven't had time to extract the custom code out. I may just post the revised files instead of the step by step code edits. I'll post here when I have added the thread.

Hi Balinor,

Do you mind sharing it now?
Reply With Quote
  #8  
Old 05-05-2007, 01:25 PM
 
inebriate inebriate is offline
 

eXpert
  
Join Date: May 2006
Posts: 301
 

Default Re: Product Options Pulldown

use DOM...

some pseudocode to get you started (for onsubmit of the add to cart button)
Code:
var selall = boolean(true); var sel = document.getElementsByTagName("select"); for(i=0;i<sel.length;i++) { if(sel[i].value == "") { selall = false; break; } } if(sellall) add to cart else alert user that they need to select option(s)
__________________
x-cart pro 4.0.18
linux
www.fabric8d.com (currently undergoing construction)
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 07:23 AM.

   

 
X-Cart forums © 2001-2020