From 699053da271746209afcf70cbe5f48c8e7b0d3d5 Mon Sep 17 00:00:00 2001
From: gRoussac
Date: Tue, 25 Jun 2013 16:17:58 +0200
Subject: [PATCH] [-] FO : Fix bug #PSCFV-8412 no zipcode for countries when
default country has no zip code in adress format
---
classes/Tools.php | 7 ++++--
themes/default/address.tpl | 8 +++++++
themes/default/authentication.tpl | 20 +++++++++++++---
themes/default/mobile/address.tpl | 12 ++++++++--
.../mobile/authentication-create-account.tpl | 11 +++++++--
themes/default/mobile/authentication.tpl | 1 +
themes/default/order-opc-new-account.tpl | 24 +++++++++++++++----
7 files changed, 70 insertions(+), 13 deletions(-)
diff --git a/classes/Tools.php b/classes/Tools.php
index 3a80f749b..177fd7cf4 100644
--- a/classes/Tools.php
+++ b/classes/Tools.php
@@ -433,8 +433,11 @@ class ToolsCore
{
// get currency from context
$currency = Shop::getEntityIds('currency', Context::getContext()->shop->id);
- $cookie->id_currency = $currency[0]['id_currency'];
- return Currency::getCurrencyInstance((int)$cookie->id_currency);
+ if (isset($currency[0]) && $currency[0]['id_currency'])
+ {
+ $cookie->id_currency = $currency[0]['id_currency'];
+ return Currency::getCurrencyInstance((int)$cookie->id_currency);
+ }
}
}
$currency = Currency::getCurrencyInstance(Configuration::get('PS_CURRENCY_DEFAULT'));
diff --git a/themes/default/address.tpl b/themes/default/address.tpl
index 77a01cb1a..e5054515e 100644
--- a/themes/default/address.tpl
+++ b/themes/default/address.tpl
@@ -95,6 +95,7 @@ $(function(){ldelim}
{l s='DNI / NIF / NIE'}
{assign var="stateExist" value="false"}
+ {assign var="postCodeExist" value="false"}
{foreach from=$ordered_adr_fields item=field_name}
{if $field_name eq 'company'}
@@ -138,6 +139,7 @@ $(function(){ldelim}
{/if}
{if $field_name eq 'postcode'}
+ {assign var="postCodeExist" value="true"}
@@ -195,6 +197,12 @@ $(function(){ldelim}
{/if}
{/foreach}
+ {if $postCodeExist eq "false"}
+
+
+
+
+ {/if}
{if $stateExist eq "false"}
diff --git a/themes/default/authentication.tpl b/themes/default/authentication.tpl
index 080f8b778..d80efa7c2 100644
--- a/themes/default/authentication.tpl
+++ b/themes/default/authentication.tpl
@@ -78,6 +78,7 @@ $(document).ready(function() {
{if !isset($back) || $back != 'my-account'}{assign var='current_step' value='login'}{include file="$tpl_dir./order-steps.tpl"}{/if}
{include file="$tpl_dir./errors.tpl"}
{assign var='stateExist' value=false}
+{assign var="postCodeExist" value=false}
{if !isset($email_create)}
{assign var='stateExist' value=false}
+{assign var='postCodeExist' value=false}
{if !isset($email_create)}
{include file="./authentication-choice.tpl"}
{else}
diff --git a/themes/default/order-opc-new-account.tpl b/themes/default/order-opc-new-account.tpl
index f34a384a5..10970a2e9 100644
--- a/themes/default/order-opc-new-account.tpl
+++ b/themes/default/order-opc-new-account.tpl
@@ -178,6 +178,7 @@
{/if}
{l s='Delivery address'}
{$stateExist = false}
+ {$postCodeExist = false}
{foreach from=$dlv_all_fields item=field_name}
{if $field_name eq "company"}
{if $b2b_enable}
@@ -207,6 +208,7 @@
{elseif $field_name eq "postcode"}
+ {$postCodeExist = true}
@@ -248,14 +250,20 @@
{l s='DNI / NIF / NIE'}
+ {if !$postCodeExist}
+
+
+
+
+ {/if}
{if !$stateExist}
-
+
- {/if}
+ {/if}
@@ -280,6 +288,7 @@
{assign var=stateExist value=false}
+ {assign var=postCodeExist value=false}
{l s='Invoice address'}
{foreach from=$inv_all_fields item=field_name}
{if $field_name eq "company"}
@@ -320,7 +329,8 @@
{elseif $field_name eq "postcode"}
-
+ {$postCodeExist = true}
+
@@ -349,8 +359,14 @@
{/if}
{/foreach}
+ {if !$postCodeExist}
+
+
+
+
+ {/if}
{if !$stateExist}
-
+