Jump to content

Edit History

AlainMartel

AlainMartel


No response

Hello.

I need to have the fields 'firstname' and 'lastname' as readonly in the "personal information" page of the front store. But I also need the client to fill them in the "Create an account" page of the front store.  We have succeeded in version 1.7.1.2 but we are not able in version 1.7.5.1.

Can any one help please?

In version 1.7.1.2, we modifying the 'themes/classic/templates/_partials/form-fields.tpl' with these modifications:

 * @license   http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
 * International Registered Trademark & Property of PrestaShop SA
 *}
{** NZ START *}
    {if $field.name === 'id_customer'}
            {assign var="cust_id" value={$field.value} scope="root"}
    {/if}
{* NZ END *}

{if $field.type == 'hidden'}

  {block name='form_field_item_hidden'}
    <input type="hidden" name="{$field.name}" value="{$field.value}">
  {/block}

{else}

...

{block name='form_field_item_other'}
          <input
            class="form-control"
            name="{$field.name}"
            type="{$field.type}"
            value="{$field.value}"
        {** NZ START *}
        {if !empty($cust_id)}
            {if $field.name === 'firstname'}readonly{/if}
            {if $field.name === 'lastname'}readonly{/if}
        {/if}
                {** NZ END *}

            {if isset($field.availableValues.placeholder)}placeholder="{$field.availableValues.placeholder}"{/if}
            {if $field.maxLength}maxlength="{$field.maxLength}"{/if}
            {if $field.required}required{/if}

Thanks,

Alain Martel

AlainMartel

AlainMartel

Hello.

I need to have the fields 'firstname' and 'lastname' as readonly in the "personal information" page of the front store. But I also need the client to fill them in the "Create an account" page of the front store.  We have version 1.7.1.2 and we have succeeded by modifying the 'themes/classic/templates/_partials/form-fields.tpl' with these modifications:

 @license   http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
 * International Registered Trademark & Property of PrestaShop SA
 *}
{** NZ START *}
    {if $field.name === 'id_customer'}
            {assign var="cust_id" value={$field.value} scope="root"}
    {/if}
{* NZ END *}

{if $field.type == 'hidden'}

  {block name='form_field_item_hidden'}
    <input type="hidden" name="{$field.name}" value="{$field.value}">
  {/block}

{else}

...

{block name='form_field_item_other'}
          <input
            class="form-control"
            name="{$field.name}"
            type="{$field.type}"
            value="{$field.value}"
        {** NZ START *}
        {if !empty($cust_id)}
            {if $field.name === 'firstname'}readonly{/if}
            {if $field.name === 'lastname'}readonly{/if}
        {/if}
                {** NZ END *}

            {if isset($field.availableValues.placeholder)}placeholder="{$field.availableValues.placeholder}"{/if}
            {if $field.maxLength}maxlength="{$field.maxLength}"{/if}
            {if $field.required}required{/if}

Now... when we upgrade to version 1.7.5.1 and it doesn't work anymore :( I have tried many things for weeks with no success. Version 1.7.5.1 has many advantages that we would like to use.

Can anyone help me with this?

Thanks,

Alain Martel

AlainMartel

AlainMartel

Hello.

I need to have the fields 'firstname' and 'lastname' as readonly in the "personal information" page of the front store. But I also need the client to fill them in the "Create an account" page of the front store.  We have version 1.7.1.2 and we have succeeded by modifying the 'themes/classic/templates/_partials/form-fields.tpl' with these modifications:

 @license   http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
 * International Registered Trademark & Property of PrestaShop SA
 *}
{** NZ START *}
    {if $field.name === 'id_customer'}
            {assign var="cust_id" value={$field.value} scope="root"}
    {/if}
{* NZ END *}

{if $field.type == 'hidden'}

  {block name='form_field_item_hidden'}
    <input type="hidden" name="{$field.name}" value="{$field.value}">
  {/block}

{else}

...

{block name='form_field_item_other'}
          <input
            class="form-control"
            name="{$field.name}"
            type="{$field.type}"
            value="{$field.value}"
        {** NZ START *}
        {if !empty($cust_id)}
            {if $field.name === 'firstname'}readonly{/if}
            {if $field.name === 'lastname'}readonly{/if}
        {/if}
                {** NZ END *}

            {if isset($field.availableValues.placeholder)}placeholder="{$field.availableValues.placeholder}"{/if}
            {if $field.maxLength}maxlength="{$field.maxLength}"{/if}
            {if $field.required}required{/if}

Now... when we upgrade to version 1.7.5.1 and it doesn't work anymore :( I have tried many things for weeks with no success. Version 1.7.5.1 has many advantages that we would like to use.

Can anyone help me with this?

Thanks,

Alain Martel

×
×
  • Create New...