| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Product Options Dropdown "Select XXXX..." | ||||
![]() |
|
|
Thread Tools | Search this Thread |
#21
|
|||||||
|
|||||||
![]() When I add the javascript validation, it disables the OUT OF STOCK javascript standard warning, and when a customer chooses a variant that is not in stock, and clicks the Add to cart button, it redirects to the cart (instead of the javascript alert that says OUT OF STOCK).
__________________
4.1.8 Gold (Unix) |
|||||||
#22
|
|||||||
|
|||||||
![]() Have you had a chance to try this mod with the ver 4.1.9 release? I tried applying your modifications as shown below and added the validation codes below into the "Validation Script (Javascript)" section of the product options.
---------------------------------------------------------------------------------------------------------------------------------if (document.getElementById('po3').selectedIndex == 0) { alert('Please select a size for your item.'); return false; } if (document.getElementById('po4').selectedIndex == 0) { alert('Please select a color for your item.'); return false; } else return true; --------------------------------------------------------------------------------------------------------------------------------- It doesn't work as expected. Am I missing something? When the customer click "Add to Cart", IE throw up the "error on page" message. Thanks -Tuan Quote:
__________________
Win2003 IIS6, PHP 5.2.3, MySQL 5.0.45 and X-Cart 4.1.9 |
|||||||
#23
|
|||||||
|
|||||||
![]() And this is how my "skin1\modules\Product_Options\customer_options.tp l" file looks.
-------------------------------------------------------------------------------------------------------------------------- {* $Id: customer_options.tpl,v 1.24 2006/04/07 05:19:21 svowl Exp $ *} {if $product_options ne ''} {if $nojs ne 'Y'} <tr style="display: none;"><td> <script type="text/javascript" language="JavaScript 1.2"> <!-- var alert_msg = '{$alert_msg}'; --> </script> {include file="modules/Product_Options/check_options.tpl"} </td></tr> {/if} {foreach from=$product_options item=v} {if $v.options ne '' || $v.is_modifier eq 'T'} <tr> <td valign="middle" height="25">{if $usertype eq "A"}{$v.class}{else}{$v.classtext|default:$v.class }{/if}</td> <td valign="middle"> {if $cname ne ""} {assign var="poname" value="$cname[`$v.classid`]"} {else} {assign var="poname" value="product_options[`$v.classid`]"} {/if} {if $v.is_modifier eq 'T'} <input id="po{$v.classid}" type="text" name="{$poname}" value="{$v.default|escape}" /> {else} <select id="po{$v.classid}" name="{$poname}"{if $disable} disabled="disabled"{/if}{if $nojs ne 'Y'} onchange="javascript: check_options();"{/if}> <option>Please Select Your {$v.classtext|default:$v.class}...{if $o.selected eq 'Y'} selected="selected"{/if}</option> {foreach from=$v.options item=o} <option value="{$o.optionid}">{$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> {/if} </td> </tr> {/if} {/foreach} {/if} {if $product_options_ex ne ""} <tr> <td colspan="2"><font id="exception_msg" color="red"></font></td> </tr> {if $err ne ''} <tr> <td colspan="2"><font class="CustomerMessage">{$lng.txt_product_options_ combinations_warn}:</font></td> </tr> {foreach from=$product_options_ex item=v} <tr> <td>{foreach from=$v item=o}{if $usertype eq "A"}{$o.class}{else}{$o.classtext}{/if}: {$o.option_name}<br />{/foreach}<br /></td> </tr> {/foreach} {/if} {/if} --------------------------------------------------------------------------------------------------------------------------
__________________
Win2003 IIS6, PHP 5.2.3, MySQL 5.0.45 and X-Cart 4.1.9 |
|||||||
#24
|
|||||||
|
|||||||
![]() Is there an easier way to do this in 4.1.9? You would think x-cart would already have it so that a customer would have to choose a product option rather than it selecting a default one.
__________________
Thanks. Dustin // Captain [ BrandFly ] Design & Other Creative Stuff BrandFly.com X-Cart Gold v4.1.1 |
|||||||
#25
|
|||||||
|
|||||||
![]() read post #12 and #18
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4 |
|||||||
#26
|
|||||||
|
|||||||
![]() Ya, post #12 and #18 work fine, I was just hoping that x-cart would make this an easier fix in future versions. It seems like a simple feature, but oh well, a boy can dream.
__________________
Thanks. Dustin // Captain [ BrandFly ] Design & Other Creative Stuff BrandFly.com X-Cart Gold v4.1.1 |
|||||||
#27
|
|||||||||
|
|||||||||
![]() I am getting the warning line "Please select your size" as the second line on my drop down and "select size" on my first line. The warning works on line 1 but just returns me when I select line 2. Where did I go wrong?
__________________
www.usapolicesupply.com v4.6.3 Xcartmods reBoot Template WebsiteCM CDSEO Pro SEO BCS Multipe Upselling Links Firetank Feed Manager BCS Product Importer Updater Pro BCS Drop Shipper Pro BCS Quote Request Module BCS Printable Online Catalog |
|||||||||
#28
|
|||||||
|
|||||||
![]() I have version 4.16 and cannot get this to work. when I click on an option nothing happens. It will not add it to the cart.
__________________
Shareen sparker2@cox.net http://www.stitches4u.com X-Cart Version 4.5.0 with Smart Template vs 4.4.x |
|||||||
#29
|
|||||||
|
|||||||
![]() First let me say, Thank You!!! This is exactly what I was looking for.
Everything is working but the validation script, and like everyone else I recieve an error when I add it. So for now I am leaving it out. I'm using Version 4.1.11 and I was wondering if anyone has found a fix for the validation script yet. Thanks, Ryan
__________________
Version 4.1.11 Pro Add-on: X-Affiliate Add-on: X-RMA Add-on: X-FancyCategories |
|||||||
#30
|
|||||||||
|
|||||||||
![]() Quote:
thanks a bunch carpeperdiem, worked like a charm. EDIT: all of the current store items have multiple size options with each size option having its own unique item number. with this mod in place, the 'item no.' in the details area of an item is defaulting to the the lowest item number. we would like to have this not be the case UNTIL a size is chosen. any way of having a unique item number along with this mod? or perhaps have the item no. not show until a size is selected? or simply have that field be blank? i am attaching a pic to hopefully show what i am speaking of. thanks in advance for any help.
__________________
X-Cart Gold Plus 4.6.6 Altered Cart - Checkout One Altered Cart - Checkout One Payments Altered Cart - Cash Rewards Altered Cart - On Sale Smack Digital - CDSEO Smack Digital - CDSEO Rich Snippets Smack Digital - xCMS The xCart Store - xBanners2 Star Plugins - Cloud Zoom Heavily Customized by Starts Here Ltd. (UK) |
|||||||||
|
|||
X-Cart forums © 2001-2020
|