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 07-04-2024 10:54:09

antsevo
Member
From: Surrey, UK
Registered: 02-08-2005
Posts: 604
Website

Select Default Country in "Create Account"

I did do this in version 8, but can I have some pointers to do this in V9

I need the default country set as United Kingdom in "Create Account" form rather that it asking for "Select" as the majority of our customers are from the UK.

And obviously customers can still select the drop down box to select their county if it is not the default


Anthony - Manufacturers of Personalised and Celebrity Face Masks

Offline

 

#2 07-08-2024 07:45:25

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19818
Website

Re: Select Default Country in "Create Account"

This can be done by modifying the default value for the country field (only if blank) in the files:

{private}/core/CORE/includes/formfield_country.php
{private}/core/CORE/includes/formfield_countryship.php

For version 9.3+, isolate your mods to make future updates quick and easy using these instructions:

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


Nick Hendler

Offline

 

#3 07-08-2024 22:36:36

antsevo
Member
From: Surrey, UK
Registered: 02-08-2005
Posts: 604
Website

Re: Select Default Country in "Create Account"

Thanks Nick... perfect although I just commented out the "// print '<option value="" label="Select"></option>' . $eol;" - seemed to be the logical choice



print '<select'; if (!(empty($cssstyle))) {print ' class="' . $cssstyle . '"';} print ' name="' . $id . '" id="' . $id . '" title="' . $fieldtitle . '">' . $eol;

// print '<option value="" label="Select"></option>' . $eol;

foreach ($values as $valueid => $data) {

     $name    = $this->xhtml_encode($data['id']);
     $value   = $this->xhtml_encode($data['id']);

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

     print '<option value="' . $name . '"' . $selected . '>' . $value . '</option>' . $eol;

} // End of foreach statement.

print '</select>' . $eol;

Last edited by antsevo (07-08-2024 22:45:58)


Anthony - Manufacturers of Personalised and Celebrity Face Masks

Offline

 

Board footer