{% set isActiveMethod = cart.shipping_method.id == method.id %}
<div class="mall-shipping-method__entry js-mall-select-shipping-method
     {{ isActiveMethod ? 'mall-shipping-method__entry--active' : '' }}"
     data-id="{{ method.id }}"
>
    <div class="mall-shipping-method__logo">
        {% if method.logo %}
            <img class="mall-shipping-method__logo" src="{{ method.logo.thumb(120, 'auto') }}" alt=""/>
        {% endif %}
    </div>
    <div class="mall-shipping-method__text">
        <div>
            <div class="mall-shipping-method__heading">
                <div class="mall-shipping-method__name">{{ method.name }}</div>
                <div class="mall-shipping-method__meta">
                    {% if method.guaranteed_delivery_days %}
                        <div class="mall-shipping-method__delivery-days">
                            {% set days = method.guaranteed_delivery_days %}
                            {{ 'offline.mall::frontend.shipping_method.guaranteed_delivery_days'
                                | transchoice(days, {days: days})
                            }}
                        </div>
                    {% endif %}
                    <div class="mall-shipping-method__price">
                        {{ method.price().integer > 0
                        ? (method.price().string | raw)
                        : ('offline.mall::frontend.no_additional_charges' | trans) }}
                    </div>
                </div>
            </div>
            <div class="mall-shipping-method__toggle"
                 style="{% if not isActiveMethod %}display: none{% endif %}">
                {% if method.description %}
                    <div class="mall-shipping-method__description">
                        {{ method.description | raw }}
                    </div>
                {% endif %}
                <div class="mall-shipping-method__submit">
                    <button class="mall-btn mall-btn--primary" type="submit" data-attach-loading>
                        {{ 'offline.mall::frontend.shipping_method.proceed' | trans }}
                    </button>
                </div>
            </div>
        </div>
    </div>
    <div class="mall-shipping-method__selector">
        {% if not isActiveMethod %}
            <button class="mall-shipping-method__select-button"
                    data-attach-loading
                    data-request="{{ __SELF__ }}::onChangeMethod"
                    data-request-success="$.publish('mall.cart.shippingMethodChanged', data)"
                    data-request-data="id: '{{ method.id }}'">
                {{ 'offline.mall::frontend.shipping_method.button_label' | trans }}
            </button>
        {% endif %}
    </div>
</div>
