| 1 | <?xml version="1.0" encoding="UTF-8" ?> |
| 2 | <templates xml:space="preserve"> |
| 3 | <t t-name="sale.Product"> |
| 4 | <td class="o_sale_product_configurator_img py-3 px-0"> |
| 5 | <img |
| 6 | class="w-75 w-lg-100 border rounded" |
| 7 | t-att-src="imageUrl" |
| 8 | alt="Product Image" |
| 9 | /> |
| 10 | </td> |
| 11 | <td class="p-0 p-md-3 product_name_description"> |
| 12 | <div |
| 13 | name="o_sale_product_configurator_name" |
| 14 | class="mb-1 mb-lg-3 text-break text-truncate" |
| 15 | > |
| 16 | <span class="h5" t-out="this.props.display_name"/> |
| 17 | <div |
| 18 | t-if="this.props.description_sale" |
| 19 | t-out="this.props.description_sale" |
| 20 | class="text-muted small text-truncate" |
| 21 | /> |
| 22 | <div t-if="this.props.selectedComboItems" class="text-muted small"> |
| 23 | <div |
| 24 | t-foreach="this.props.selectedComboItems" |
| 25 | t-as="comboItem" |
| 26 | t-key="comboItem_index" |
| 27 | t-out="comboItem.name" |
| 28 | /> |
| 29 | </div> |
| 30 | </div> |
| 31 | <t t-foreach="this.props.attribute_lines" t-as="ptal" t-key="ptal.id"> |
| 32 | <PTAL |
| 33 | t-if="shouldShowPtal(ptal)" |
| 34 | t-props="ptal" |
| 35 | productTmplId="this.props.product_tmpl_id" |
| 36 | /> |
| 37 | </t> |
| 38 | <div t-if="!this.env.isPossibleCombination(this.props)" class="alert alert-warning impossible_combination_alert mt-3"> |
| 39 | <span>This option or combination of options is not available</span> |
| 40 | </div> |
| 41 | <t t-if="this.props.available_uoms" t-call="sale.uom_selector"/> |
| 42 | </td> |
| 43 | <t t-if="!this.props.optional"> |
| 44 | <td |
| 45 | class="o_sale_product_configurator_qty w-25 py-3 px-0 text-end" |
| 46 | > |
| 47 | <div |
| 48 | t-if="env.showPrice" |
| 49 | class="d-md-flex gap-2 align-items-baseline justify-content-end" |
| 50 | > |
| 51 | <t t-call="sale.product_price" name="sale_product_configurator_price"/> |
| 52 | </div> |
| 53 | <t t-set="isComboProduct" t-value="isMainProduct && this.props.selectedComboItems.length"/> |
| 54 | <t t-if="env.showQuantity && !isComboProduct"> |
| 55 | <QuantityButtons |
| 56 | quantity="this.props.quantity" |
| 57 | setQuantity="quantity => this.env.setQuantity(this.props.product_tmpl_id, quantity)" |
| 58 | isMinusButtonDisabled="this.props.quantity === 1 && isMainProduct" |
| 59 | /> |
| 60 | </t> |
| 61 | <span |
| 62 | t-elif="env.showQuantity && isComboProduct" |
| 63 | t-out="this.props.quantity" |
| 64 | class="h5" |
| 65 | /> |
| 66 | <a |
| 67 | class="d-block mt-2 text-end" |
| 68 | role="button" |
| 69 | t-if="!isMainProduct" |
| 70 | t-on-click="() => this.env.removeProduct(this.props.product_tmpl_id)" |
| 71 | > |
| 72 | Remove |
| 73 | </a> |
| 74 | </td> |
| 75 | </t> |
| 76 | <t t-else=""> |
| 77 | <td |
| 78 | name="price" |
| 79 | class="o_sale_product_configurator_price py-3 px-0 text-end" |
| 80 | > |
| 81 | <div |
| 82 | t-if="env.showPrice" |
| 83 | class="d-md-flex gap-2 align-items-baseline justify-content-end" |
| 84 | > |
| 85 | <t t-call="sale.product_price" name="sale_product_configurator_optional_price"/> |
| 86 | </div> |
| 87 | <button |
| 88 | name="sale_product_configurator_add_button" |
| 89 | class="btn btn-secondary" |
| 90 | t-att-class="{'disabled': !this.env.isPossibleCombination(this.props)}" |
| 91 | t-on-click="() => this.env.addProduct(this.props.product_tmpl_id)" |
| 92 | > |
| 93 | <i class="oi oi-plus" role="img"/> |
| 94 | <span name="add_button" class="ms-2 d-none d-md-inline">Add</span> |
| 95 | </button> |
| 96 | </td> |
| 97 | </t> |
| 98 | </t> |
| 99 | |
| 100 | <t t-name="sale.product_price"> |
| 101 | <span |
| 102 | name="sale_product_configurator_formatted_price" |
| 103 | class="h5 text-nowrap fw-bold text-end h6 mb-2 d-block" |
| 104 | t-out="getFormattedPrice()" |
| 105 | /> |
| 106 | <div t-if="this.props.price_info" t-out="this.props.price_info" class="text-muted"/> |
| 107 | </t> |
| 108 | |
| 109 | <t t-name="sale.uom_selector"> |
| 110 | <div class="d-flex gap-2 flex-column align-items-start justify-content-start mb-2 small"> |
| 111 | <label t-out="UoMTitle" class="fw-bold me-3"/> |
| 112 | <ul class="list-unstyled d-flex flex-column flex-lg-row gap-2 flex-grow-1 mb-0"> |
| 113 | <li |
| 114 | t-foreach="this.props.available_uoms" |
| 115 | t-as="uom" |
| 116 | t-key="`${this.props.product_tmpl_id}-${uom.id}`" |
| 117 | t-att-class="{'active': uom.id == props.uom.id}" |
| 118 | class="o_sale_product_configurator_uom_choice" |
| 119 | > |
| 120 | <label |
| 121 | class="btn btn-outline-secondary" |
| 122 | t-attf-for="{{this.props.product_tmpl_id}}-{{uom.id}}-input" |
| 123 | t-out="uom.display_name" |
| 124 | /> |
| 125 | <input |
| 126 | class="btn-check" |
| 127 | type="radio" |
| 128 | t-attf-id="{{this.props.product_tmpl_id}}-{{uom.id}}-input" |
| 129 | t-att-value="uom.id" |
| 130 | t-attf-name="uom-{{this.props.product_tmpl_id}}" |
| 131 | t-att-checked="uom.id == props.uom.id" |
| 132 | t-on-change="selectUoM" |
| 133 | /> |
| 134 | </li> |
| 135 | </ul> |
| 136 | </div> |
| 137 | </t> |
| 138 | </templates> |