Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

受注登録でお届け先に氏名が表示されない #4980

Closed
hironori-tanaka opened this issue Mar 22, 2021 · 4 comments
Closed

受注登録でお届け先に氏名が表示されない #4980

hironori-tanaka opened this issue Mar 22, 2021 · 4 comments
Labels
bug:Low good-first-issue Good for newcomers/簡単に修正できそうなもの Status: dev-ready
Milestone

Comments

@hironori-tanaka
Copy link

概要(Overview)

受注登録でお届け先に氏名が表示されない

再現手順(Procedure)

受注登録ページで、複数配送のときにお届け先が複数表示されるが、会社名が空だと各お届け先に氏名が表示されない

環境 (environment)

  • EC-CUBE: 4.0.5

関連情報 (Ref)

@okazy
Copy link
Contributor

okazy commented Mar 22, 2021

@hironori-tanaka
問題の箇所はこちらでしょうか?

image

デモ環境で試してみましたが、会社名を設定しても氏名が表示されませんでした。。。

@okazy okazy added the bug:Low label Mar 22, 2021
@okazy okazy added this to the 4.0.x milestone Mar 22, 2021
@hironori-tanaka
Copy link
Author

はい、そちらの箇所になります。

app/template/admin/Order/edit.twig
の三項演算子の処理順序がおかしいのかなと思います。

■現行
{% set shipping_name = shipping.full_name ~ '(' ~ shipping.full_name_kana ~ ')' ~ shipping.company_name is not null ? shipping.company_name : '' %}

■修正案
{% set shipping_name = shipping.full_name ~ '(' ~ shipping.full_name_kana ~ ')' ~ (shipping.company_name is not null ? shipping.company_name : '') %}

@okazy
Copy link
Contributor

okazy commented Mar 22, 2021

確かに書き方がよくなさそうですね。

shipping_nameshipping_company_name は変数を分けた方が良さそうです。

{% for shipping in Order.Shippings %}
<div class="col">
<span class="mr-5">{{ 'admin.order.delivery'|trans }}({{ loop.index }})</span>
{% set shipping_name = shipping.full_name ~ '(' ~ shipping.full_name_kana ~ ')' ~ shipping.company_name is not null ? shipping.company_name : '' %}
{% set shipping_addr = 'admin.common.postal_symbol'|trans ~ shipping.postal_code ~ ' ' ~ shipping.pref ~ shipping.addr01 ~ shipping.addr02 %}
{% set shipping_date = shipping.shipping_date is not null ? shipping.shipping_date|date_day : '' %}
{{ shipping_name }} {{ shipping_addr }} {{ shipping.phone_number }} {{ shipping_date }}
</div>
{% endfor %}

@okazy okazy added good-first-issue Good for newcomers/簡単に修正できそうなもの affected:admin_template 管理画面テンプレートのDOMに影響のある変更 Status: dev-ready and removed affected:admin_template 管理画面テンプレートのDOMに影響のある変更 labels Mar 22, 2021
chihiro-adachi added a commit that referenced this issue Nov 17, 2021
受注登録でお届け先に氏名が表示されない #4980
@chihiro-adachi chihiro-adachi modified the milestones: 4.0.x, 4.1.1 Nov 17, 2021
@chihiro-adachi
Copy link
Contributor

#5213 で修正のためクローズします。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug:Low good-first-issue Good for newcomers/簡単に修正できそうなもの Status: dev-ready
Projects
None yet
Development

No branches or pull requests

3 participants