Author: erwan
Date: Fri Jun 24 13:13:44 2011
New Revision: 1139291
URL:
http://svn.apache.org/viewvc?rev=1139291&view=revLog:
A patch from Stephane Ducas - OFBIZ-4324 - When creating a customer from the shopping cart the selected country has to be the default one
I slightly modified your patch and put the defaultCountryGeoId in CommonScreens.xml#countries so the geoId will always be filled
Modified:
ofbiz/trunk/framework/common/webcommon/includes/countries.ftl
ofbiz/trunk/framework/common/widget/CommonScreens.xml
Modified: ofbiz/trunk/framework/common/webcommon/includes/countries.ftl
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/webcommon/includes/countries.ftl?rev=1139291&r1=1139290&r2=1139291&view=diff==============================================================================
--- ofbiz/trunk/framework/common/webcommon/includes/countries.ftl (original)
+++ ofbiz/trunk/framework/common/webcommon/includes/countries.ftl Fri Jun 24 13:13:44 2011
@@ -18,6 +18,9 @@ under the License.
-->
<#assign countries = Static["org.ofbiz.common.CommonWorkers"].getCountryList(delegator)>
<#list countries as country>
- <option value='${country.geoId}'>${country.get("geoName",locale)?default(country.geoId)}</option>
+ <#if defaultCountryGeoId?exists>
+ <option value='${country.geoId}' ${(country.geoId==defaultCountryGeoId)?string("selected=\"selected\"","")}>${country.get("geoName",locale)?default(country.geoId)}</option>
+ <#else>
+ <option value='${country.geoId}'>${country.get("geoName",locale)?default(country.geoId)}</option>
+ </#if>
</#list>
-
Modified: ofbiz/trunk/framework/common/widget/CommonScreens.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/widget/CommonScreens.xml?rev=1139291&r1=1139290&r2=1139291&view=diff==============================================================================
--- ofbiz/trunk/framework/common/widget/CommonScreens.xml (original)
+++ ofbiz/trunk/framework/common/widget/CommonScreens.xml Fri Jun 24 13:13:44 2011
@@ -31,6 +31,9 @@ under the License.
</screen>
<screen name="countries">
<section>
+ <actions>
+ <property-to-field field="defaultCountryGeoId" resource="general" property="country.geo.id.default" default="USA"/>
+ </actions>
<widgets>
<platform-specific><html><html-template location="component://common/webcommon/includes/countries.ftl"/></html></platform-specific>
</widgets>