[-] FO : Fix bug isGuest not defined, set id_carrier in base at login

This commit is contained in:
gRoussac
2013-02-26 14:27:48 +01:00
parent 0bcadd5d8d
commit f35e1c56ed
2 changed files with 17 additions and 16 deletions
+14 -14
View File
@@ -208,13 +208,13 @@ $(document).ready(function() {
</p>
<p class="required text">
<label for="firstname">{l s='First name'} <sup>*</sup></label>
<input type="text" class="text" id="firstname" name="firstname" onblur="$('#customer_firstname').val($(this).val());" value="{if isset($smarty.post.firstname)}{$smarty.post.firstname}{/if}">
<input type="hidden" class="text" id="customer_firstname" name="customer_firstname" value="{if isset($smarty.post.firstname)}{$smarty.post.firstname}{/if}">
<input type="text" class="text" id="firstname" name="firstname" onblur="$('#customer_firstname').val($(this).val());" value="{if isset($smarty.post.firstname)}{$smarty.post.firstname}{/if}"/>
<input type="hidden" class="text" id="customer_firstname" name="customer_firstname" value="{if isset($smarty.post.firstname)}{$smarty.post.firstname}{/if}"/>
</p>
<p class="required text">
<label for="lastname">{l s='Last name'} <sup>*</sup></label>
<input type="text" class="text" id="lastname" name="lastname" onblur="$('#customer_lastname').val($(this).val());" value="{if isset($smarty.post.lastname)}{$smarty.post.lastname}{/if}">
<input type="hidden" class="text" id="customer_lastname" name="customer_lastname" value="{if isset($smarty.post.lastname)}{$smarty.post.lastname}{/if}">
<input type="text" class="text" id="lastname" name="lastname" onblur="$('#customer_lastname').val($(this).val());" value="{if isset($smarty.post.lastname)}{$smarty.post.lastname}{/if}"/>
<input type="hidden" class="text" id="customer_lastname" name="customer_lastname" value="{if isset($smarty.post.lastname)}{$smarty.post.lastname}{/if}"/>
</p>
<p class="select">
<span>{l s='Date of Birth'}</span>
@@ -253,11 +253,11 @@ $(document).ready(function() {
</p>
{if isset($newsletter) && $newsletter}
<p class="checkbox">
<input type="checkbox" name="newsletter" id="newsletter" value="1" {if isset($smarty.post.newsletter) && $smarty.post.newsletter == '1'}checked="checked"{/if}>
<input type="checkbox" name="newsletter" id="newsletter" value="1" {if isset($smarty.post.newsletter) && $smarty.post.newsletter == '1'}checked="checked"{/if}/>
<label for="newsletter">{l s='Sign up for our newsletter!'}</label>
</p>
<p class="checkbox">
<input type="checkbox" name="optin" id="optin" value="1" {if isset($smarty.post.optin) && $smarty.post.optin == '1'}checked="checked"{/if}>
<input type="checkbox" name="optin" id="optin" value="1" {if isset($smarty.post.optin) && $smarty.post.optin == '1'}checked="checked"{/if}/>
<label for="optin">{l s='Receive special offers from our partners!'}</label>
</p>
{/if}
@@ -278,17 +278,17 @@ $(document).ready(function() {
{elseif $field_name eq "address1"}
<p class="required text">
<label for="address1">{l s='Address'} <sup>*</sup></label>
<input type="text" class="text" name="address1" id="address1" value="{if isset($smarty.post.address1)}{$smarty.post.address1}{/if}">
<input type="text" class="text" name="address1" id="address1" value="{if isset($smarty.post.address1)}{$smarty.post.address1}{/if}"/>
</p>
{elseif $field_name eq "postcode"}
<p class="required postcode text">
<label for="postcode">{l s='Zip / Postal Code'} <sup>*</sup></label>
<input type="text" class="text" name="postcode" id="postcode" value="{if isset($smarty.post.postcode)}{$smarty.post.postcode}{/if}" onblur="$('#postcode').val($('#postcode').val().toUpperCase());">
<input type="text" class="text" name="postcode" id="postcode" value="{if isset($smarty.post.postcode)}{$smarty.post.postcode}{/if}" onblur="$('#postcode').val($('#postcode').val().toUpperCase());"/>
</p>
{elseif $field_name eq "city"}
<p class="required text">
<label for="city">{l s='City'} <sup>*</sup></label>
<input type="text" class="text" name="city" id="city" value="{if isset($smarty.post.city)}{$smarty.post.city}{/if}">
<input type="text" class="text" name="city" id="city" value="{if isset($smarty.post.city)}{$smarty.post.city}{/if}"/>
</p>
<!--
if customer hasn't update his layout address, country has to be verified
@@ -316,7 +316,7 @@ $(document).ready(function() {
{elseif $field_name eq "phone"}
<p class="required text">
<label for="phone">{l s='Phone'} <sup>*</sup></label>
<input type="text" class="text" name="phone" id="phone" value="{if isset($smarty.post.phone)}{$smarty.post.phone}{/if}">
<input type="text" class="text" name="phone" id="phone" value="{if isset($smarty.post.phone)}{$smarty.post.phone}{/if}"/>
</p>
{/if}
{/foreach}
@@ -328,8 +328,8 @@ $(document).ready(function() {
</select>
</p>
{/if}
<input type="hidden" name="alias" id="alias" value="{l s='My address'}">
<input type="hidden" name="is_new_customer" id="is_new_customer" value="0">
<input type="hidden" name="alias" id="alias" value="{l s='My address'}" />
<input type="hidden" name="is_new_customer" id="is_new_customer" value="0" />
<!-- END Account -->
</div>
</fieldset>
@@ -337,7 +337,7 @@ $(document).ready(function() {
<h3>{l s='Tax identification'}</h3>
<p class="required text">
<label for="dni">{l s='Identification number'}</label>
<input type="text" class="text" name="dni" id="dni" value="{if isset($smarty.post.dni)}{$smarty.post.dni}{/if}" />
<input type="text" class="text" name="dni" id="dni" value="{if isset($smarty.post.dni)}{$smarty.post.dni}{/if}"/>
<span class="form_info">{l s='DNI / NIF / NIE'}</span>
</p>
</fieldset>
@@ -345,7 +345,7 @@ $(document).ready(function() {
<p class="cart_navigation required submit">
<span><sup>*</sup>{l s='Required field'}</span>
<input type="hidden" name="display_guest_checkout" value="1" />
<input type="submit" class="exclusive" name="submitGuestAccount" id="submitGuestAccount" value="{l s='Continue'}">
<input type="submit" class="exclusive" name="submitGuestAccount" id="submitGuestAccount" value="{l s='Continue'}"/>
</p>
</form>
{/if}
+3 -2
View File
@@ -400,6 +400,7 @@ function updateNewAccountToAddressBlock()
updateCartSummary(json.summary);
updateAddressesDisplay(true);
updateCarrierList(json.carrier_data);
updateCarrierSelectionAndGift();
updatePaymentMethods(json);
if ($('#gift-price').length === 1)
$('#gift-price').html(json.gift_price);
@@ -595,7 +596,7 @@ $(function() {
});
}
isGuest = ($('#is_new_customer').val() === 1 ? 0 : 1);
isGuest = parseInt($('#is_new_customer').val()) === 1 ? 0 : 1;
// update addresses id
if(jsonData.id_address_delivery !== undefined && jsonData.id_address_delivery > 0)
$('#opc_id_address_delivery').val(jsonData.id_address_delivery);
@@ -628,7 +629,7 @@ $(function() {
// force to refresh carrier list
if (isGuest)
{
{
isLogged = 1;
$('#opc_account_saved').fadeIn('slow');
$('#submitAccount').hide();