내가 어떤 파일에 추가하는 무슨 일 output.So를 얻으려면?DISPALY 사용자 이름을하고 있어요
-1
A
답변
0
catalog/controller/common/header.php
에 고객 우선 &성에 다음 코드를 추가하십시오. catalog/view/theme/your-theme/template/common/header.twig
&에서
$data['customer_firstname'] = $this->customer->getFirstName();
$data['customer_lastname'] = $this->customer->getLastName();
다음 이름과 성을 위해 다음 코드를 추가합니다.
{{ customer_firstname }}
{{ customer_lastname }}
변경 후 개발자 캐시를 새로 고침하세요 & 다음을 확인합니다. 자세한 내용은 여기를 참조하십시오. 캐시 새로 고침 - Disable template caching for development in OpenCart 3
0
고객이에 로그인했는지 먼저 확인하는 것이 좋습니다. 고객이 로그인하지 않으면 코드가 오류를 반환 할 수 있습니다.
if ($this->customer->isLogged()) {
$data['customer_firstname'] = $this->customer->getFirstName();
$data['customer_lastname'] = $this->customer->getLastName();
}