Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#1 09-20-2007 06:57:36

GoBrushless.com
Member
Registered: 06-29-2005
Posts: 431

Need help modding some text during checkout

Getting quite a few emails now with overseas customers having problems during checkout.  The resounding complaint is that they keep getting the "incomplete form" issue.  I believe it's the fact that they aren't selecting "Non-Applicable" from the state dropdown menu.

Is there a way I can set that field to "autoselect" Nonapplicable?  That way it will always have SOMETHING selected, and US customers (who have to change it anyway) can just drop it down to their state.

If not, where would I add the text to point out that users need to select "Non Applicable" if they are not in the US.  With the "intelligence" built into this app, I'd like to think there's a way to autoselect that field.

Help would be greatly appreciated.

Thanks.

Offline

 

#2 09-25-2007 11:02:20

kiwimum
Member
Registered: 03-30-2004
Posts: 305
Website

Re: Need help modding some text during checkout

Steve (that's you, right?)

Here's what Nick did for us:

I edited the XHTML include 'Formfield: Selection List' to achieve this
and added:

Code:

if ((empty($defaultvalue)) && (preg_match('/stateprov$/',$id))) {
$defaultvalue = 'Not Applicable';
}

it appears to be working.


Jessica
:: CCP5 > CCP6 > Magento > CCP7

Offline

 

#3 02-19-2010 16:31:55

kiwimum
Member
Registered: 03-30-2004
Posts: 305
Website

Re: Need help modding some text during checkout

Hey if anyone wants to do this in CCP7 it still works.  Here's the full code from "Formfield: Selection List"

<?php

$id           = $this->xhtml_encode($this->globals('core_form.field.id'));
$name         = $this->xhtml_encode($this->globals('core_form.field.name'));
$description  = $this->globals('core_form.field.description');
$required     = $this->globals('core_form.field.required');
$defaultvalue = $this->xhtml_encode($this->globals('core_form.field.defaultvalue'));
$cssstyle     = 'formfield';
$values       = $this->globals('core_form.field.values');
if ((empty($defaultvalue)) && (preg_match('/stateprov$/',$id))) {
$defaultvalue = 'Not Applicable';
}
$legstyle = 'formfieldleg';
if (($this->globals('core_form.reqnotcomp')) && ($required)) {
     if ((empty($defaultvalue)) && (!($defaultvalue === '0'))) {
          $legstyle .= '_rnc';
     }
}

?>

<fieldset>

<legend class="strong"><label for="<?php print $id; ?>"><?php print $name; if ($required) {print '*';} ?></label></legend>

<p class="<?php print $legstyle; ?>"><?php print $name; if ($required) {print '*';} ?></p>

<?php if ($description) {print $description;} ?>

<select class="<?php print $cssstyle; ?>" name="<?php print $id; ?>" id="<?php print $id; ?>">

<option value=""></option>
<?php

foreach ($values as $name => $value) {

     $name  = $this->xhtml_encode($name);
     $value = $this->xhtml_encode($value);

     if ($defaultvalue == $name) {$selected = ' selected="selected"';}
     else {$selected = '';}

     $field  = '<option value="' . $name . '"' . $selected;
     $field .= '>' . $value . '</option>' . $this->globals('core.eol');

     print $field;

} // End of foreach statement.

?>
</select>

</fieldset>


Jessica
:: CCP5 > CCP6 > Magento > CCP7

Offline

 

#4 02-25-2010 09:11:01

Design_Wholesale
Member
From: England!
Registered: 11-21-2008
Posts: 1104
Website

Re: Need help modding some text during checkout

Something like this might also help:

https://forum.kryptronic.com/viewtopic.php?id=23322

Offline

 

Board footer