42 lines
2.3 KiB
HTML
42 lines
2.3 KiB
HTML
<!-- Basket Item -->
|
|
<!-- requires:
|
|
Basket_Item basket_item
|
|
bool show_delivery_option
|
|
-->
|
|
<div class="container row">
|
|
{% set product = basket_item.product %}
|
|
{% set permutation = product.get_permutation_selected() %}
|
|
<div class="container">
|
|
<img class="img-thumbnail" src="{{ product.get_image_from_index(0).url }}" alt="Basket icon"> <!-- model.get_many_product_image_src(product.id_product, '', True, 'THUMBNAIL') -->
|
|
</div>
|
|
{% set form = product.form_basket_edit %}
|
|
<!-- <form {{ model.attr_form_type }}="{{ form.form_type }}" {{ model.attr_id_product }}="{{ product.id }}" class="container column" action="{{ url_for('basket_add') }}" method="POST"> -->
|
|
<form {{ model.attr_form_type }}="{{ form.form_type }}" class="{{ model.flag_container }} {{ model.flag_column }}" {{ model.attr_id_product }}="{{ product.id_product}}" {{ model.attr_id_permutation }}="{{ permutation.id_permutation }}"> <!-- id="form_basket_item_id_{{ basket_item.product.id }}" -->
|
|
{{ form.hidden_tag() }}
|
|
<h2>{{ product.name }}</h2>
|
|
{% if permutation.is_available %}
|
|
<h3 style="white-space: nowrap;">{{ basket_item.quantity }} x {{ product.output_price(model.app.is_included_VAT) }} = {{ basket_item.output_subtotal() }}</h3>
|
|
{% set tmp_quantity = basket_item.quantity %}
|
|
{% include 'components/common/inputs/_input_number_plus_minus.html' %}
|
|
{% elif permutation.is_unavailable_in_currency_or_region %}
|
|
<h3 style="white-space: nowrap;">Product not available in currency and region</h3>
|
|
{% else %}
|
|
<h3 style="white-space: nowrap;">Product not available</h3>
|
|
{% endif %}
|
|
<a class="{{ model.FLAG_DELETE }}">Delete</a>
|
|
{% if show_delivery_option %}
|
|
<div class="{{ model.flag_container_input }}">
|
|
{{ product.form_delivery_option.label }}
|
|
{{ product.form_delivery_option() }}
|
|
</div>
|
|
{% endif %}
|
|
<script>
|
|
if (_verbose) {
|
|
console.log('creating basket item for:');
|
|
console.log('product id: {{ product.id_product }}');
|
|
console.log('permutation id: {{ product.get_id_permutation() }}');
|
|
console.log('quantity: {{ basket_item.quantity }}');
|
|
}
|
|
</script>
|
|
</form>
|
|
</div> |