[Admin] Add hook for showing ip address in order

This commit is contained in:
Michał Pysiak 2024-10-02 12:46:19 +02:00
parent 5f68148f5f
commit cb998231f3
No known key found for this signature in database
GPG key ID: 9C1F2D0F99830187
2 changed files with 16 additions and 0 deletions

View file

@ -178,6 +178,8 @@ twig_hooks:
template: '@SyliusAdmin/order/show/content/sections/general/language.html.twig'
channel:
template: '@SyliusAdmin/order/show/content/sections/general/channel.html.twig'
ip_address:
template: '@SyliusAdmin/order/show/content/sections/general/ip_address.html.twig'
notes:
template: '@SyliusAdmin/order/show/content/sections/general/notes.html.twig'

View file

@ -0,0 +1,14 @@
{% set order = hookable_metadata.context.resource %}
<div>
<div>
<strong>{{ 'sylius.ui.ip_address'|trans }}:</strong>
</div>
<div class="mb-3" {{ sylius_test_html_attribute('ip-address') }}>
{% if order.customerIp is not null %}
{{ order.customerIp }}
{% else %}
-
{% endif %}
</div>
</div>