feat: order creation on cart detail view
This commit is contained in:
@@ -78,27 +78,179 @@
|
||||
{% translate 'Dirección de envío' %}
|
||||
</h2>
|
||||
|
||||
{% for address in shipping_addresses %}
|
||||
<input type="radio" id="shipping_address_{{ address.pk }}" name="shipping_address"
|
||||
value="{{ address.pk }}">
|
||||
<label for="shipping_address_{{ address.pk }}">
|
||||
{{ address }}
|
||||
</label>
|
||||
{% endfor %}
|
||||
<div class="grid gap-4 sm:grid-cols-2 sm:gap-6 my-2">
|
||||
{% if user.is_anonymous %}
|
||||
<div class="sm:col-span-2">
|
||||
<label for="email"
|
||||
class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">{% translate 'E-Mail' %}</label>
|
||||
<input type="text" name="email" id="email"
|
||||
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-primary-600
|
||||
focus:border-primary-600 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600
|
||||
dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-500 dark:focus:border-primary-500"
|
||||
placeholder="{% translate 'E-Mail' %}"
|
||||
value=""
|
||||
required=""
|
||||
>
|
||||
</div>
|
||||
{% else %}
|
||||
<input type="hidden" name="email" value="{{ user.email }}">
|
||||
{% endif %}
|
||||
<div class="sm:col-span-2">
|
||||
<label for="shipping_address_full_name"
|
||||
class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">{% translate 'Nombre completo' %}</label>
|
||||
<input type="text" name="shipping_address_full_name" id="shipping_address_full_name"
|
||||
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-primary-600
|
||||
focus:border-primary-600 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600
|
||||
dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-500 dark:focus:border-primary-500"
|
||||
placeholder="{% translate 'Nombre completo' %}"
|
||||
value="{% if shipping_address %}{{ shipping_address.full_name }}{% endif %}"
|
||||
required=""
|
||||
>
|
||||
<label for="shipping_address"
|
||||
class="block my-2 text-sm font-medium text-gray-900 dark:text-white">{% translate 'Dirección' %}</label>
|
||||
<input type="text" name="shipping_address" id="shipping_address"
|
||||
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-primary-600
|
||||
focus:border-primary-600 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600
|
||||
dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-500 dark:focus:border-primary-500"
|
||||
placeholder="{% translate 'Dirección' %}"
|
||||
value="{% if shipping_address %}{{ shipping_address.address }}{% endif %}"
|
||||
required=""
|
||||
>
|
||||
</div>
|
||||
<div class="w-full">
|
||||
<label for="shipping_address_town"
|
||||
class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">{% translate 'Localidad' %}</label>
|
||||
<input type="text" name="shipping_address_town" id="shipping_address_town"
|
||||
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-primary-600
|
||||
focus:border-primary-600 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600
|
||||
dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-500 dark:focus:border-primary-500"
|
||||
placeholder="{% translate 'Localidad' %}"
|
||||
value="{% if shipping_address %}{{ shipping_address.address_town }}{% endif %}"
|
||||
required=""
|
||||
>
|
||||
</div>
|
||||
<div class="w-full">
|
||||
<label for="shipping_address_zip"
|
||||
class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">{% translate 'Código postal' %}</label>
|
||||
<input type="text" name="shipping_address_zip" id="shipping_address_zip"
|
||||
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-primary-600
|
||||
focus:border-primary-600 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600
|
||||
dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-500 dark:focus:border-primary-500"
|
||||
placeholder="{% translate 'Código postal' %}"
|
||||
value="{% if shipping_address %}{{ shipping_address.address_zip }}{% endif %}"
|
||||
required=""
|
||||
>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="shipping_address_state"
|
||||
class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">{% translate 'Provincia' %}</label>
|
||||
<input type="text" name="shipping_address_state" id="shipping_address_state"
|
||||
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-primary-600
|
||||
focus:border-primary-600 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600
|
||||
dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-500 dark:focus:border-primary-500"
|
||||
placeholder="{% translate 'Provincia' %}"
|
||||
value="{% if shipping_address %}{{ shipping_address.address_state }}{% endif %}"
|
||||
required=""
|
||||
>
|
||||
|
||||
</div>
|
||||
<div>
|
||||
<label for="shipping_address_country"
|
||||
class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">{% translate 'País' %}</label>
|
||||
<input type="text" name="shipping_address_country" id="shipping_address_country"
|
||||
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-primary-600
|
||||
focus:border-primary-600 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600
|
||||
dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-500 dark:focus:border-primary-500"
|
||||
placeholder="{% translate 'País' %}"
|
||||
value="{% if shipping_address %}{{ shipping_address.address_country }}{% endif %}"
|
||||
required=""
|
||||
>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2 class="text-xl font-semibold text-gray-900 dark:text-white sm:text-2xl">
|
||||
{% translate 'Dirección de facturación' %}
|
||||
{% translate 'Dirección de envío' %}
|
||||
</h2>
|
||||
|
||||
{% for address in billing_addresses %}
|
||||
<input type="radio" id="billing_address_{{ address.pk }}" name="billing_address"
|
||||
value="{{ address.pk }}">
|
||||
<label for="billing_address_{{ address.pk }}">
|
||||
{{ address }}
|
||||
</label>
|
||||
{% endfor %}
|
||||
<div class="grid gap-4 sm:grid-cols-2 sm:gap-6 my-2">
|
||||
<div class="sm:col-span-2">
|
||||
<label for="billing_address_full_name"
|
||||
class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">{% translate 'Nombre completo' %}</label>
|
||||
<input type="text" name="billing_address_full_name" id="billing_address_full_name"
|
||||
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-primary-600
|
||||
focus:border-primary-600 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600
|
||||
dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-500 dark:focus:border-primary-500"
|
||||
placeholder="{% translate 'Nombre completo' %}"
|
||||
value="{% if billing_address %}{{ billing_address.full_name }}{% endif %}"
|
||||
required=""
|
||||
>
|
||||
<label for="billing_address"
|
||||
class="block my-2 text-sm font-medium text-gray-900 dark:text-white">{% translate 'Dirección' %}</label>
|
||||
<input type="text" name="billing_address" id="billing_address"
|
||||
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-primary-600
|
||||
focus:border-primary-600 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600
|
||||
dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-500 dark:focus:border-primary-500"
|
||||
placeholder="{% translate 'Dirección' %}"
|
||||
value="{% if billing_address %}{{ billing_address.address }}{% endif %}"
|
||||
required=""
|
||||
>
|
||||
</div>
|
||||
<div class="w-full">
|
||||
<label for="billing_address_town"
|
||||
class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">{% translate 'Localidad' %}</label>
|
||||
<input type="text" name="billing_address_town" id="billing_address_town"
|
||||
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-primary-600
|
||||
focus:border-primary-600 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600
|
||||
dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-500 dark:focus:border-primary-500"
|
||||
placeholder="{% translate 'Localidad' %}"
|
||||
value="{% if billing_address %}{{ billing_address.address_town }}{% endif %}"
|
||||
required=""
|
||||
>
|
||||
</div>
|
||||
<div class="w-full">
|
||||
<label for="billing_address_zip"
|
||||
class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">{% translate 'Código postal' %}</label>
|
||||
<input type="text" name="billing_address_zip" id="billing_address_zip"
|
||||
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-primary-600
|
||||
focus:border-primary-600 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600
|
||||
dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-500 dark:focus:border-primary-500"
|
||||
placeholder="{% translate 'Código postal' %}"
|
||||
value="{% if billing_address %}{{ billing_address.address_zip }}{% endif %}"
|
||||
required=""
|
||||
>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="billing_address_state"
|
||||
class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">{% translate 'Provincia' %}</label>
|
||||
<input type="text" name="billing_address_state" id="billing_address_state"
|
||||
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-primary-600
|
||||
focus:border-primary-600 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600
|
||||
dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-500 dark:focus:border-primary-500"
|
||||
placeholder="{% translate 'Provincia' %}"
|
||||
value="{% if billing_address %}{{ billing_address.address_state }}{% endif %}"
|
||||
required=""
|
||||
>
|
||||
|
||||
</div>
|
||||
<div>
|
||||
<label for="billing_address_country"
|
||||
class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">{% translate 'País' %}</label>
|
||||
<input type="text" name="billing_address_country" id="billing_address_country"
|
||||
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-primary-600
|
||||
focus:border-primary-600 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600
|
||||
dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-500 dark:focus:border-primary-500"
|
||||
placeholder="{% translate 'País' %}"
|
||||
value="{% if billing_address %}{{ billing_address.address_country }}{% endif %}"
|
||||
required=""
|
||||
>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
|
||||
Reference in New Issue
Block a user