[-] BO : Fix bug #PSCFV-7468 required phone in address creation
This commit is contained in:
@@ -50,7 +50,7 @@
|
|||||||
<input type="hidden" name="{$input.name}" id="{$input.name}" value="{$fields_value[$input.name]|escape:'htmlall':'UTF-8'}" />
|
<input type="hidden" name="{$input.name}" id="{$input.name}" value="{$fields_value[$input.name]|escape:'htmlall':'UTF-8'}" />
|
||||||
{else}
|
{else}
|
||||||
{if $input.name == 'id_state'}
|
{if $input.name == 'id_state'}
|
||||||
<div id="contains_states" {if $contains_states}style="display:none;"{/if}>
|
<div id="contains_states" {if !$contains_states}style="display:none;"{/if}>
|
||||||
{/if}
|
{/if}
|
||||||
{block name="label"}
|
{block name="label"}
|
||||||
{if isset($input.label)}<label>{$input.label} </label>{/if}
|
{if isset($input.label)}<label>{$input.label} </label>{/if}
|
||||||
@@ -318,7 +318,7 @@
|
|||||||
{if isset($input.required) && $input.required && $input.type != 'radio'} <sup>*</sup>{/if}
|
{if isset($input.required) && $input.required && $input.type != 'radio'} <sup>*</sup>{/if}
|
||||||
{/block}{* end block input *}
|
{/block}{* end block input *}
|
||||||
{block name="description"}
|
{block name="description"}
|
||||||
{if isset($input.desc)}
|
{if isset($input.desc) && !empty($input.desc)}
|
||||||
<p class="preference_description">
|
<p class="preference_description">
|
||||||
{if is_array($input.desc)}
|
{if is_array($input.desc)}
|
||||||
{foreach $input.desc as $p}
|
{foreach $input.desc as $p}
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ class AdminAddressesControllerCore extends AdminController
|
|||||||
'name' => 'phone_mobile',
|
'name' => 'phone_mobile',
|
||||||
'size' => 33,
|
'size' => 33,
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'desc' => sprintf($this->l('You must register at least one phone number %s'), '<sup>*</sup>')
|
'desc' => Configuration::get('PS_ONE_PHONE_AT_LEAST')? sprintf($this->l('You must register at least one phone number %s'), '<sup>*</sup>') : ''
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'type' => 'textarea',
|
'type' => 'textarea',
|
||||||
@@ -367,6 +367,9 @@ class AdminAddressesControllerCore extends AdminController
|
|||||||
$this->errors[] = Tools::displayError('Your Postal Code/Zip Code is incorrect.');
|
$this->errors[] = Tools::displayError('Your Postal Code/Zip Code is incorrect.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Configuration::get('PS_ONE_PHONE_AT_LEAST') && !Tools::getValue('phone') && !Tools::getValue('phone_mobile'))
|
||||||
|
$this->errors[] = Tools::displayError('You must register at least one phone number');
|
||||||
|
|
||||||
/* If this address come from order's edition and is the same as the other one (invoice or delivery one)
|
/* If this address come from order's edition and is the same as the other one (invoice or delivery one)
|
||||||
** we delete its id_address to force the creation of a new one */
|
** we delete its id_address to force the creation of a new one */
|
||||||
if ((int)Tools::getValue('id_order'))
|
if ((int)Tools::getValue('id_order'))
|
||||||
|
|||||||
Reference in New Issue
Block a user