mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-14 09:02:12 +00:00
[Admin] Render view in store button in the variant edit page
This commit is contained in:
parent
6a1cdaaf0d
commit
a046ac804b
2 changed files with 9 additions and 5 deletions
|
|
@ -13,6 +13,9 @@ twig_hooks:
|
|||
'sylius_admin.product_variant.update.content.header.title_block.actions':
|
||||
price_history:
|
||||
template: '@SyliusAdmin/product_variant/form/content/update/header/actions/price_history.html.twig'
|
||||
view_in_store:
|
||||
template: '@SyliusAdmin/product/common/header/title_block/actions/view_in_store.html.twig'
|
||||
|
||||
|
||||
'sylius_admin.product_variant.update.content.form':
|
||||
side_navigation:
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
{% from '@SyliusAdmin/shared/helper/icon.html.twig' import icon %}
|
||||
|
||||
{% set product = (hookable_metadata.context.resource) %}
|
||||
{% set enabled_channels = product.channels|filter(channel => channel.enabled == true) %}
|
||||
|
||||
{% if sylius_bundle_loaded_checker('SyliusShopBundle') %}
|
||||
{% from '@SyliusAdmin/shared/helper/icon.html.twig' import icon %}
|
||||
|
||||
{% set product = hookable_metadata.context.resource.product|default(hookable_metadata.context.resource) %}
|
||||
{% set enabled_channels = product.channels|filter(channel => channel.enabled == true) %}
|
||||
|
||||
{% if not product.enabled or enabled_channels|length < 1 %}
|
||||
<a class="btn disabled" href="{{ (url is not defined) ? '#' : url|raw }}" target="_blank" {{ sylius_test_html_attribute('view-in-store') }}>
|
||||
{{ icon({ icon: 'arrow_up_right', class: 'icon icon-tabler' }) }}
|
||||
|
|
@ -26,6 +26,7 @@
|
|||
class="dropdown-item{% if url is not defined %} disabled{% endif %}"
|
||||
href="{{ (url is not defined) ? '#' : url|raw }}"
|
||||
target="_blank"
|
||||
{{ sylius_test_html_attribute('channel-code', channel.code) }}
|
||||
>
|
||||
{{ icon({ icon: 'arrow_up_right', class: 'icon dropdown-item-icon icon-tabler' }) }}
|
||||
{{ channel.name }} ({{ channel.code }})
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue