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}
@@ -248,14 +250,20 @@ {l s='DNI / NIF / NIE'}
+ {if !$postCodeExist} + + {/if} {if !$stateExist} -+
- {/if} + {/if}@@ -280,6 +288,7 @@
+ {$postCodeExist = true} +
@@ -349,8 +359,14 @@ {/if} {/foreach} + {if !$postCodeExist} + + {/if} {if !$stateExist} -