You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

PrestaShop 1.7后台客户信息显示‘hobbies’字段方法求助

Hey there! Since you're new to PrestaShop 1.7, let's walk through exactly how to get that 'hobbies' field (which maps to the phone number) showing up alongside other customer details in the back office. I've been there struggling to find the right files as a beginner, so let's break this down step by step:

Step 1: Locate the right template file

First, head to your PrestaShop installation's back office template directory. The file you need to edit lives here:

/admin-dev/themes/default/template/customers/tabs/customer_information.tpl

Note: If you renamed your admin folder during setup (a smart security move!), replace admin-dev with your custom admin directory name.

Step 2: Find where existing customer fields are displayed

Open that customer_information.tpl file in a code editor (like VS Code or Sublime). Look for the section where other contact/info fields are rendered—you'll see blocks of Smarty code that look like this (for the phone number, for example):

<div class="form-group">
    <label class="control-label col-lg-3">{$l->s('Phone')}</label>
    <div class="col-lg-8">
        <p class="form-control-static">{$customer->phone|escape:'htmlall':'UTF-8'}</p>
    </div>
</div>
Step 3: Add your 'hobbies' field

Now insert your 'hobbies' field right next to these existing blocks. The exact code depends on how you set up the 'hobbies' field:

  • If you added 'hobbies' directly to the ps_customer database table:
    Add this code block (adjust the label text if you want to call it something else):
    <div class="form-group">
        <label class="control-label col-lg-3">{$l->s('Hobbies')}</label>
        <div class="col-lg-8">
            <p class="form-control-static">{$customer->hobbies|escape:'htmlall':'UTF-8'}</p>
        </div>
    </div>
    
  • If you used PrestaShop's native Custom Fields feature (Customers > Customer Fields):
    You'll need to fetch the value using the custom field helper. Replace the variable line in the block above with:
    <p class="form-control-static">{$customer->getCustomFieldValue('hobbies')|escape:'htmlall':'UTF-8'}</p>
    
Step 4: Test your changes

Save the file, then jump back to your PrestaShop back office. Open any customer's details page—your 'Hobbies' field should now show up alongside the other customer information fields!

Quick beginner pro tip

To avoid losing your changes when you update PrestaShop, don't edit the default back office theme directly. Instead, create a child theme:

  1. Make a new folder at /admin-dev/themes/default-child/
  2. Copy the customer_information.tpl file into the same directory structure inside the child theme: /admin-dev/themes/default-child/template/customers/tabs/customer_information.tpl
  3. Go to Back Office > Advanced Parameters > Administration and select your new default-child theme from the "Back office theme" dropdown.
  4. Make all your edits in the child theme's file instead.

内容的提问来源于stack exchange,提问作者H_Hmd

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.08 20:52:55