Jump to content
CName

如何修改註冊頁面

Recommended Posts

post-995114-0-27962100-1432031554_thumb.jpg

 

請問如何將 "姓氏"跟"名字"這兩個欄位合併成一個"姓名"欄位

 

另外送貨地址的部分,如何取消*必要欄位 

Share this post


Link to post
Share on other sites

在这里进行修改:LOCALIZATION / COUNTRIES / Edit: (Your target country)

Share this post


Link to post
Share on other sites
我看了一下程式碼輸出 姓氏姓名 的方法,發現皆為
{$address['firstname']} {$address['lastname']}
我猜測應該無法透過設定的方式來修改輸出格式
 
因此我用了一個在註冊頁面中做弊的方式:
1.我先註解輸入姓氏的欄位,讓它不會出現在註冊頁面上,目的是為了讓使用者只輸入姓名firstname就好
<!--
<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>
-->
 
2.拉出原本輸入姓氏欄位的程式碼,進行修改
<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}" />
 
3.刪除註冊頁面檢查必填欄位的程式碼,並讓value塞入空白值,目的是為了傳到PHP驗證時可以通過檢查。
 
<input onkeyup="$('#lastname').val(this.value);" type="hidden" class="is_required validate form-control" data-validate="isName" id="customer_lastname" name="customer_lastname" value=" " />

 

以上方法或許不是最好,但會是解決這問題的方案之一

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More