{% extends 'layout.html.twig' %}
{% form_theme form _self %}
{% block head %}
{{ parent() }}
<meta name="robots" content="noindex, nofollow"/>
{% endblock head %}
{% block tel_widget -%}
{% if widget is constant('Misd\\PhoneNumberBundle\\Form\\Type\\PhoneNumberType::WIDGET_COUNTRY_CHOICE') %}
<div class="promo-config--field">
<span>{{ 'app.gift_form.placeholder.country' | trans }}</span>
{{- form_widget(form.country, {'attr':{'class' : 'promo-config--select form-control' }}) -}}
</div>
<div class="promo-config--field">
<span>{{ 'app.gift_form.placeholder.phone' | trans }}</span>
{{- form_widget(form.number, {'attr':{'class' : 'promo-config--input form-control' }}) -}}
{{ form_errors(form) }}
</div>
{% else -%}
{{- block('form_widget_simple') -}}
{%- endif %}
{%- endblock tel_widget %}
{% block header %}
{% include 'partials/global/header.html.twig' %}
{% endblock header %}
{% block content %}
{% block administration %}{% endblock %}
<main class="main-block--container">
<div class="promo-config--header">
<div class="container">
<h4>{{ 'gift_form.process'|trans }}</h4>
</div>
</div>
<div class="container">
<form name="gift_form" method="POST" novalidate class="promo-config js-promo-form" action="{{ url('app_ecommerce_store_checkout', {id: gift.id}) }}">
<div class="promo-config--container">
<div class="promo-config--content js-gift" data-text="{{ 'app.gifthasextra.included' | trans }}">
<div class="promo-config--first-col">
<div class="promo-config--section is-focus">
<div class="promo-config--title is-focus">
<h4 id="gif-presonalize" class="">
<span>{{ 'gift_form.1'|trans }}</span>
</h4>
</div>
<div class="promo-config--block">
{% if gift.image %}
<div class="promo-config--image">
{% set Image = {
url: gift.image | resize(420)|file_url,
alt: '',
alternatives: [],
height: 940,
width: 1920
} %}
<picture-component class="js-picture-component is-absolute" :image={{Image|json_encode()}}></picture-component>
</div>
{% endif %}
<div class="promo-config--text">
<h4>{{ gift.title }}</h4>
{% for giftHotel in gift.hotels %}<p>
<strong>{{ giftHotel }} / {{ giftHotel.city|upper }}</strong>
</p>{% endfor %}
{{ gift.description | raw }}
{{ gift.giftInfo1|raw }}
</div>
</div>
</div>
<h4 class="promo-config--title">
<span>2.
{{ 'app.gifts.personalize' | trans }}</span>
</h4>
<div class="promo-config--fields">
{#TODO @etebar nuevo campo check #}
{#<div class="promo-config--field is-check">#}
{#<input type="checkbox" name="gift">#}
{#<p>No deseo personalizar el regalo</p>#}
{#</div>#}
<div class="promo-config--field"> <label>{{ 'app.gift_form.placeholder.from' | trans }}</label>
{{ form_widget(form.from, {'attr':{'class' : 'promo-config--input is-required small-padding',
'placeholder':('app.gift_form.placeholder.namefull'|trans)}}) }}
{{ form_errors(form.from) }}
</div>
<div class="promo-config--field">
<label>{{ 'app.gift_form.placeholder.to' | trans }}</label>
{{ form_widget(form.to, {'attr':{'class' : 'promo-config--input is-required small-padding',
'placeholder':('app.gift_form.placeholder.namefull'|trans) }}) }}
{{ form_errors(form.to) }}
</div>
<div class="promo-config--field is-full">
<label>{{ 'app.gift_form.placeholder.dedication'|trans }}</label>
<div class="promo-config--field is-textarea">
{{ form_widget(form.dedication, {'attr':{'placeholder':('app.gift_form.placeholder.dedication'|trans),
'class' : 'promo-config--input has-offset is-required',
'cols':"30",
'rows':"5",
'maxlength':'300'
}}) }}
<div class="promo-config--field-limit">{{ 'gift_form.limit'|trans }}</div>
</div>
</div>
</div>
{% if extraTypes| length > 0 %}
<h4 class="promo-config--title">
<span>3.
{{ 'gift_form.3'|trans }}</span>
</h4>
<div class="promo-config--fields">
{% for extraType in extraTypes %}
{% set extraTypeField = "extras"~loop.index %}
<div class="promo-config--field">
<p class="promo-config--extra">{{ extraType }}</p>
{{ form_widget(form.offsetGet(extraTypeField), {'attr':{'placeholder':('app.gift_form.placeholder.extras'~loop.index |trans), 'class' : 'promo-config--select js-extra-select' }}) }}
</div>
{% endfor %}
</div>
{% endif %}
<h4 id="gif-data" class="promo-config--title">
<span>{{ extraTypes| length > 0 ? '4.' : '3.' }}
{{ 'gift_form.4'|trans }}</span>
</h4>
<div class="promo-config--fields">
<div class="promo-config--field">
{# <span>{{ 'app.gift_form.placeholder.name' | trans }}</span> #}
{{ form_widget(form.billing.name, {'attr':{'class' : 'promo-config--input form-control',
'placeholder':('app.gift_form.placeholder.name'|trans) }}) }}
{{ form_errors(form.billing.name) }}
</div>
<div class="promo-config--field">
{# <span>{{ 'app.gift_form.placeholder.surname' | trans }}</span> #}
{{ form_widget(form.billing.surname, {'attr':{'class' : 'promo-config--input form-control',
'placeholder':('app.gift_form.placeholder.surname' | trans) }}) }}
{{ form_errors(form.billing.surname) }}
</div>
<div class="promo-config--field">
{# <span>{{ 'app.gift_form.placeholder.nif' | trans }}</span> #}
{{ form_widget(form.billing.nif, {'attr':{'class' : 'promo-config--input form-control',
'placeholder':('app.gift_form.placeholder.nif' | trans) }}) }}
{{ form_errors(form.billing.nif) }}
</div>
<div class="field--spacer"></div>
<div class="promo-config--field is-full">
{# <span>{{ 'app.gift_form.placeholder.addressLine1' | trans }}</span> #}
{{ form_widget(form.billing.addressLine1, {'attr':{'class' : 'promo-config--input form-control',
'placeholder':('app.gift_form.placeholder.addressLine1' | trans) }}) }}
{{ form_errors(form.billing.addressLine1) }}
</div>
<div class="promo-config--field is-full">
{# <span>{{ 'app.gift_form.placeholder.addressLine2' | trans }}</span> #}
{{ form_widget(form.billing.addressLine2, {'attr':{'class' : 'promo-config--input form-control',
'placeholder':('app.gift_form.placeholder.addressLine2' | trans) }}) }}
{{ form_errors(form.billing.addressLine2) }}
</div>
<div class="promo-config--field">
{# <span>{{ 'app.gift_form.placeholder.city' | trans }}</span> #}
{{ form_widget(form.billing.city, {'attr':{'class' : 'promo-config--input form-control',
'placeholder':('app.gift_form.placeholder.city' | trans) }}) }}
{{ form_errors(form.billing.city) }}
</div>
<div class="promo-config--field">
{# <span>{{ 'app.gift_form.placeholder.province' | trans }}</span> #}
{{ form_widget(form.billing.province, {'attr':{'class' : 'promo-config--input form-control',
'placeholder':('app.gift_form.placeholder.province' | trans) }}) }}
{{ form_errors(form.billing.province) }}
</div>
<div class="promo-config--field">
{# <span>{{ 'app.gift_form.placeholder.postalCode' | trans }}</span> #}
{{ form_widget(form.billing.postalCode, {'attr':{'class' : 'promo-config--input form-control',
'placeholder':('app.gift_form.placeholder.postalCode' | trans) }}) }}
{{ form_errors(form.billing.postalCode) }}
</div>
<div class="field--spacer"></div>
<div class="promo-config--field">
{# <span>{{ 'app.gift_form.placeholder.country' | trans }}</span> #}
{{ form_widget(form.billing.country, {'attr':{'class' : 'promo-config--input form-control promo-config--select'}}) }}
{{ form_errors(form.billing.country) }}
</div>
<div class="promo-config--field">
{# <span>{{ 'app.gift_form.placeholder.email' | trans }}</span> #}
{{ form_widget(form.billing.email, {'attr':{'class' : 'promo-config--input form-control',
'placeholder':('app.gift_form.placeholder.email' | trans) }}) }}
{{ form_errors(form.billing.email) }}
</div>
{{ form_widget(form.billing.phone, {'attr':{'class' : 'promo-config--input is-full form-control','placeholder':('app.gift_form.placeholder.email' | trans) }}) }}
</div>
<h4 class="promo-config--title">
<span>{{ extraTypes| length > 0 ? '5.' : '4.' }}
{{ 'app.global.shipping' | trans }}</span>
</h4>
<div class="promo-config--fields">
{% for choice in form.shipping_method.children %}
<div class="promo-config--field is-full">
<input class="promo-config--checkbox js-send-input" data-shipping-cost="{{ get_ecommerce_shipping_cost(choice.vars.value) }}" type="radio" name="{{ choice.vars.full_name }}" id="{{ loop.index }}" value="{{ choice.vars.value }}" {% if form.shipping_method.vars.data %} {{ choice.vars.checked ? 'checked' : '' }} {% else %} {{ loop.first ? 'checked' : '' }} {% endif %}>
<label for="{{ loop.index }}">
<span></span>
{{ choice.vars.label | trans }}</label>
{% if choice.vars.label == 'gift_form.picking_up' %}
<select class="promo-config--select" name="{{ form.children['picking_place'].vars.full_name }}" id="{{ form.children['picking_place'].vars.id }}">
<option value="" {% if form.children['picking_place'].vars.data is null %} selected {% endif %}>
{{ form.children['picking_place'].vars.placeholder|trans }}
</option>
{% for pick in form.children['picking_place'].vars.choices %}
<option value="{{ pick.value }}" {% if form.children['picking_place'].vars.data == pick.value %} selected {% endif %}>
{{ pick.label | trans }}
</option>
{% endfor %}
</select>
{% if form.children['picking_place'].vars.errors|length %}
<ul class="list-unstyled">
<li>{{ form.children['picking_place'].vars.errors[0].message|trans }}</li>
</ul>
{% endif %}
{% endif %}
</div>
{% endfor %}
<div class="promo-config--text">{{ 'gift_form.standard_shipping_conditions'|trans }}</div>
<div class="promo-config--text">{{ 'gift_form.express_shipping_conditions'|trans }}</div>
</div>
<div class="promotion-options--tabs">
<div class="promotion-options--tab" data-option="1">
<div class="promo-config--option">
<h4 class="promo-config--title">
<span>{{ 'app.gift_form.send_to' | trans }}</span>
</h4>
<div class="promo-config--fields">
<div class="promo-config--field">
{# <span>{{ 'app.gift_form.placeholder.name' | trans }}</span> #}
{{ form_widget(form.email.name, {'attr':{'class' : 'promo-config--input form-control',
'placeholder':('app.gift_form.placeholder.name' | trans) }}) }}
{{ form_errors(form.email.name) }}
</div>
<div class="promo-config--field">
{# <span>{{ 'app.gift_form.placeholder.surname' | trans }}</span> #}
{{ form_widget(form.email.surname, {'attr':{'class' : 'promo-config--input form-control',
'placeholder':('app.gift_form.placeholder.surname' | trans) }}) }}
{{ form_errors(form.email.surname) }}
</div>
<div class="promo-config--field is-full">
{# <span>{{ 'app.gift_form.placeholder.email' | trans }}</span> #}
{{ form_widget(form.email.email, {'attr':{'class' : 'promo-config--input form-control','placeholder':('app.gift_form.placeholder.email' | trans) }}) }}
{{ form_errors(form.email.email) }}
</div>
{{ form_widget(form.email.phone, {'attr':{'class' : 'promo-config--input form-control' }}) }}
<div class="promo-config--field is-full">
{# <span>{{ 'app.gift_form.placeholder.comment' | trans }}</span> #}
{{ form_widget(form.email.comment, {'attr':{'class' : 'promo-config--input form-control','placeholder':('app.gift_form.placeholder.comment' | trans) }}) }}
{{ form_errors(form.email.comment) }}
</div>
</div>
</div>
</div>
<div class="promotion-options--tab not-selected" data-option="2">
<div class="promo-config--option">
<h4 class="promo-config--title">
<span>{{ 'app.gift_form.send_to' | trans }}</span>
</h4>
<div class="promo-config--fields">
<div class="promo-config--field">
{# <span>{{ 'app.gift_form.placeholder.name' | trans }}</span> #}
{{ form_widget(form.shipping.name, {'attr':{'class' : 'promo-config--input form-control','placeholder':('app.gift_form.placeholder.name' | trans) }}) }}
{{ form_errors(form.shipping.name) }}
</div>
<div class="promo-config--field">
{# <span>{{ 'app.gift_form.placeholder.surname' | trans }}</span> #}
{{ form_widget(form.shipping.surname, {'attr':{'class' : 'promo-config--input form-control','placeholder':('app.gift_form.placeholder.surname' | trans) }}) }}
{{ form_errors(form.shipping.surname) }}
</div>
<div class="field--spacer"></div>
<div class="promo-config--field is-full">
{# <span>{{ 'app.gift_form.placeholder.addressLine1' | trans }}</span> #}
{{ form_widget(form.shipping.addressLine1, {'attr':{'class' : 'promo-config--input form-control','placeholder':('app.gift_form.placeholder.addressLine1' | trans) }}) }}
{{ form_errors(form.shipping.addressLine1) }}
</div>
<div class="promo-config--field">
{# <span>{{ 'app.gift_form.placeholder.city' | trans }}</span> #}
{{ form_widget(form.shipping.city, {'attr':{'class' : 'promo-config--input form-control','placeholder':('app.gift_form.placeholder.city' | trans) }}) }}
{{ form_errors(form.shipping.city) }}
</div>
<div class="promo-config--field">
{# <span>{{ 'app.gift_form.placeholder.postalCode' | trans }}</span> #}
{{ form_widget(form.shipping.postalCode, {'attr':{'class' : 'promo-config--input form-control','placeholder':('app.gift_form.placeholder.postalCode' | trans) }}) }}
{{ form_errors(form.shipping.postalCode) }}
</div>
<div class="field--spacer"></div>
<div class="promo-config--field">
{# <span>{{ 'app.gift_form.placeholder.country' | trans }}</span> #}
{{ form_widget(form.shipping.country, {'attr':{'class' : 'promo-config--input form-control','placeholder':('app.gift_form.placeholder.country' | trans) }}) }}
{{ form_errors(form.shipping.country) }}
</div>
<div class="promo-config--field">
{# <span>{{ 'app.gift_form.placeholder.email' | trans }}</span> #}
{{ form_widget(form.shipping.email, {'attr':{'class' : 'promo-config--input form-control','placeholder':('app.gift_form.placeholder.email' | trans) }}) }}
{{ form_errors(form.shipping.email) }}
</div>
{{ form_widget(form.shipping.phone, {'attr':{'class' : 'promo-config--select form-control' }}) }}
<div class="promo-config--field is-full">
{# <span>{{ 'app.gift_form.placeholder.comment' | trans }}</span> #}
{{ form_widget(form.shipping.comment, {'attr':{'class' : 'promo-config--input form-control', 'placeholder':('app.gift_form.placeholder.comment' | trans) }}) }}
{{ form_errors(form.shipping.comment) }}
</div>
{% do form.shipping.setRendered %}
</div>
</div>
</div>
<div class="promotion-options--tab not-selected" data-option="3">
<div class="promo-config--option">
<h4 class="promo-config--title">
<span>{{ 'app.gift_form.send_to' | trans }}</span>
</h4>
<div class="promo-config--fields">
<div class="promo-config--field">
{# <span>{{ 'app.gift_form.placeholder.name' | trans }}</span> #}
{{ form_widget(form.picking_up.name, {'attr':{'class' : 'promo-config--input form-control','placeholder':('app.gift_form.placeholder.name' | trans) }}) }}
{{ form_errors(form.picking_up.name) }}
</div>
<div class="promo-config--field">
{# <span>{{ 'app.gift_form.placeholder.surname' | trans }}</span> #}
{{ form_widget(form.picking_up.surname, {'attr':{'class' : 'promo-config--input form-control','placeholder':('app.gift_form.placeholder.surname' | trans) }}) }}
{{ form_errors(form.picking_up.surname) }}
</div>
<div class="promo-config--field is-full">
{# <span>{{ 'app.gift_form.placeholder.email' | trans }}</span> #}
{{ form_widget(form.picking_up.email, {'attr':{'class' : 'promo-config--input form-control','placeholder':('app.gift_form.placeholder.email' | trans) }}) }}
{{ form_errors(form.picking_up.email) }}
</div>
{{ form_widget(form.picking_up.phone, {'attr':{'class' : 'promo-config--input form-control' }}) }}
<div class="promo-config--field is-full">
{# <span>{{ 'app.gift_form.placeholder.comment' | trans }}</span> #}
{{ form_widget(form.picking_up.comment, {'attr':{'class' : 'promo-config--input form-control', 'placeholder':('app.gift_form.placeholder.comment' | trans) }}) }}
{{ form_errors(form.picking_up.comment) }}
</div>
</div>
</div>
</div>
</div>
{% do form.shipping_method.setRendered %}
{% do form.picking_place.setRendered %}
</div>
{% include 'partials/gift_detail/gift_popup.html.twig' %}
</div>
{% set title = gift ? gift.title : '' %}
{% set giftTerms = gift ? gift.giftTerms : '' %}
{% set price = gift ? gift.price : '' %}
<div class="promo-resumee--container js-resumee" data-sticky-container>
<div class="promo-resumee--block" data-sticky-class="is-sticky" data-margin-top="150">
<div class="promo-resumee">
<h3 class="promo-resumee--section-title">{{ 'app.gift_cart.summary' | trans }}</h3>
<div class="promo-resumee--row">
<div class="promo-resumee--content">
<p class="promo-resumee--title">{{ title }}</p>
<p class="promo-resumee--text">{{ giftTerms }}</p>
</div>
<div class="promo-resumee--price" data-price="{{ price }}">{{ price }}
€</div>
</div>
<div class="promo-resumee--extra">
<p class="promo-resumee--title is-extra js-extra-title hidden">{{ 'app.gift_cart.extras_description' | trans }}</p>
<span class="js-extra"></span>
</div>
<div class="promo-resumee--send">
<p class="promo-resumee--title is-extra js-send-title hidden">{{ 'app.gift_cart.ship' | trans }}</p>
<span class="js-send"></span>
</div>
<div class="promo-resumee--total">
<p class="promo-resumee--total-text">{{ 'app.gift_cart.total' | trans }}:</p>
<div class="promo-resumee--price is-total js-total-price"></div>
</div>
<div class="promo-resumee--checks">
<div class="check--item">
<input class="check--input" type="checkbox" name="{{ form.billing.acceptOfferAndNew.vars.full_name }}" id="OfferAndNews" value="{{ form.billing.acceptOfferAndNew.vars.value }}">
<label for="newsletter">
<span></span>
{{ 'form.offer'|trans }}</label>
</div>
<div class="check--item">
<input class="check--input" type="checkbox" name="{{ form.privacy.vars.full_name }}" id="OfferAndNews" value="{{ form.privacy.vars.value }}">
<label for="privacy">
<a target="_blank" href="{{ url('aviso_legal') }}" class="promo-config--link" data-dest="popup-legal">{{ 'form.terms.privacy' | trans |capitalize }}</a>
</label>
{{ form_errors(form.privacy) }}
{% if not form.vars.valid %}
<ul class="list-unstyled">
<li>
<i class="fa fa-exclamation-circle" aria-hidden="true"></i>
{{ 'gift_form.error'|trans }}</li>
</ul>
{% endif %}
</div>
</div>
</div>
<div class="promo-resumee--submit">
<input class="promo-config--submit button green js-send-form" type="submit" value="{{ 'app.global.continue' | trans }}">
</div>
</div>
</div>
</div>
{% do form.billing.acceptOfferAndNew.setRendered %}
{% do form.privacy.setRendered %}
{{ form_rest(form) }}
</form>
</div>
</main>
{% endblock content %}