Jump to content

Faktura Vat i odwieczny problem prestashop FIX 1.6.16


c64girl

Recommended Posts

Witam postanowiłem naprawić w prestashop odwieczny problem faktur.  Mi ta zmiana odpowiada więc postanowiłem się nią podzielić.

 

Czyli gdy klient wybierał inny adres rozliczeniowy to wgrywały mu się dane imię i nazwisko co mogło powodować błędne wystawianie faktur. Po zmianach klient nie będzie mógł już wpisać danych firmy + imienia i nazwiska. Imie i nazwisko automatycznie się kasuje mimo że ktoś je wpisze i wpisze dane firmy. Sprawdzałem przy zalogowanym koncie jak i jako gość robiący zamówienie i i wpisujący pierwszy raz dane.

 

! Zmiany robicie na własne ryzyko ! - u mnie działa poprawnie ps 1.6.1.6

 

classes/Address.php

 

szukaj:

            'lastname' =>            array('type' => self::TYPE_STRING, 'validate' => 'isName', 'required' => true, 'size' => 32),
            'firstname' =>            array('type' => self::TYPE_STRING, 'validate' => 'isName', 'required' => true, 'size' => 32),

zmień:

            'lastname' =>            array('type' => self::TYPE_STRING, 'validate' => 'isName', 'size' => 32),
            'firstname' =>            array('type' => self::TYPE_STRING, 'validate' => 'isName', 'size' => 32),

themes\twojatheme\js\tools\vatManagement.js

 

szukaj:

function vat_number()
{
	if ($('#company').length && ($('#company').val() != ''))
		$('#vat_number, #vat_number_block').show();
	else
		$('#vat_number, #vat_number_block').hide();

	if ($('#company_invoice').length && ($('#company_invoice').val() != ''))
		$('#vat_number_block_invoice').show();
	else
		$('#vat_number_block_invoice').hide();
}

zmień:

function vat_number()
{
	if ($('#company').length && ($('#company').val() != '')) {
		$('#vat_number, #vat_number_block').show();
		$('.vat_firstname, .vat_lastname').hide();
		$('#firstname_invoice, #lastname_invoice, .vat_firstname_clear, .vat_lastname_clear').val('.');
	} else {
		$('#vat_number, #vat_number_block').hide();
		$('.vat_firstname, .vat_lastname').show();
	}

	if ($('#company_invoice').length && ($('#company_invoice').val() != '')) {
		$('#vat_number_block_invoice').show();
		$('.vat_firstname, .vat_lastname').hide();
		$('#firstname_invoice, #lastname_invoice, .vat_firstname_clear, .vat_lastname_clear').val('');
	} else {
		$('#vat_number_block_invoice').hide();
	}
}

themes\twojatheme\address.tpl

 

szukaj:

			{if $field_name eq 'firstname'}
				<div class="required form-group">
					<label for="firstname">{l s='First name'} <sup>*</sup></label>
					<input class="is_required validate form-control" data-validate="{$address_validation.$field_name.validate}" type="text" name="firstname" id="firstname" value="{if isset($smarty.post.firstname)}{$smarty.post.firstname}{else}{if isset($address->firstname)}{$address->firstname|escape:'html':'UTF-8'}{/if}{/if}" />
				</div>
			{/if}
			{if $field_name eq 'lastname'}
				<div class="required form-group">
					<label for="lastname">{l s='Last name'} <sup>*</sup></label>
					<input class="is_required validate form-control" data-validate="{$address_validation.$field_name.validate}" type="text" id="lastname" name="lastname" value="{if isset($smarty.post.lastname)}{$smarty.post.lastname}{else}{if isset($address->lastname)}{$address->lastname|escape:'html':'UTF-8'}{/if}{/if}" />
				</div>
			{/if}

zmień:

			{if $field_name eq 'firstname'}
				<div class="required form-group vat_firstname">
					<label for="firstname">{l s='First name'} </label>
					<input class="is_required validate form-control vat_firstname_clear" data-validate="{$address_validation.$field_name.validate}" type="text" name="firstname" id="firstname" value="{if isset($smarty.post.firstname)}{$smarty.post.firstname}{else}{if isset($address->firstname)}{$address->firstname|escape:'html':'UTF-8'}{/if}{/if}" />
				</div>
			{/if}
			{if $field_name eq 'lastname'}
				<div class="required form-group vat_lastname">
					<label for="lastname">{l s='Last name'} </label>
					<input class="is_required validate form-control vat_lastname_clear" data-validate="{$address_validation.$field_name.validate}" type="text" id="lastname" name="lastname" value="{if isset($smarty.post.lastname)}{$smarty.post.lastname}{else}{if isset($address->lastname)}{$address->lastname|escape:'html':'UTF-8'}{/if}{/if}" />
				</div>
			{/if}

themes\twojatheme\authentication.tpl

 

szukaj:

						{elseif $field_name eq "firstname"}
						<div class="required form-group">
							<label for="firstname_invoice">{l s='First name'} <sup>*</sup></label>
							<input type="text" class="form-control" id="firstname_invoice" name="firstname_invoice" value="{if isset($smarty.post.firstname_invoice) && $smarty.post.firstname_invoice}{$smarty.post.firstname_invoice}{/if}" />
						</div>
						{elseif $field_name eq "lastname"}
						<div class="required form-group">
							<label for="lastname_invoice">{l s='Last name'} <sup>*</sup></label>
							<input type="text" class="form-control" id="lastname_invoice" name="lastname_invoice" value="{if isset($smarty.post.lastname_invoice) && $smarty.post.lastname_invoice}{$smarty.post.lastname_invoice}{/if}" />
						</div>

zmień:

						{elseif $field_name eq "firstname"}
						<div class="required form-group vat_firstname">
							<label for="firstname_invoice">{l s='First name'} </label>
							<input type="text" class="form-control" id="firstname_invoice" name="firstname_invoice" value="{if isset($smarty.post.firstname_invoice) && $smarty.post.firstname_invoice}{$smarty.post.firstname_invoice}{/if}" />
						</div>
						{elseif $field_name eq "lastname"}
						<div class="required form-group vat_lastname">
							<label for="lastname_invoice">{l s='Last name'} </label>
							<input type="text" class="form-control" id="lastname_invoice" name="lastname_invoice" value="{if isset($smarty.post.lastname_invoice) && $smarty.post.lastname_invoice}{$smarty.post.lastname_invoice}{/if}" />
						</div>

szukaj:

			<div class="required form-group">
				<label for="customer_firstname">{l s='First name'} <sup>*</sup></label>
				<input onkeyup="$('#firstname').val(this.value);" type="text" class="is_required validate form-control" data-validate="isName" id="customer_firstname" name="customer_firstname" value="{if isset($smarty.post.customer_firstname)}{$smarty.post.customer_firstname}{/if}" />
			</div>
			<div class="required form-group">
				<label for="customer_lastname">{l s='Last name'} <sup>*</sup></label>
				<input onkeyup="$('#lastname').val(this.value);" type="text" class="is_required validate form-control" data-validate="isName" id="customer_lastname" name="customer_lastname" value="{if isset($smarty.post.customer_lastname)}{$smarty.post.customer_lastname}{/if}" />
			</div>

zmień:

			<div class="required form-group vat_firstname">
				<label for="customer_firstname">{l s='First name'} </label>
				<input onkeyup="$('#firstname').val(this.value);" type="text" class="is_required validate form-control" data-validate="isName" id="customer_firstname" name="customer_firstname" value="{if isset($smarty.post.customer_firstname)}{$smarty.post.customer_firstname}{/if}" />
			</div>
			<div class="required form-group vat_lastname">
				<label for="customer_lastname">{l s='Last name'} </label>
				<input onkeyup="$('#lastname').val(this.value);" type="text" class="is_required validate form-control" data-validate="isName" id="customer_lastname" name="customer_lastname" value="{if isset($smarty.post.customer_lastname)}{$smarty.post.customer_lastname}{/if}" />
			</div>
Edited by c64girl (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...