|
| 1 | +<?xml version="1.0" encoding="utf-8" ?> |
| 2 | +<odoo> |
| 3 | + |
| 4 | + <template id="payment" inherit_id="website_sale.payment"> |
| 5 | + <xpath expr="//div[@id='payment_method']" position="before"> |
| 6 | + <div t-if="website_sale_order.is_gift" id="order_is_gift" class="mt-3"> |
| 7 | + <h3>This order is a gift</h3> |
| 8 | + <p> |
| 9 | + <b>Date of the gift:</b> <span |
| 10 | + t-out="website_sale_order.gift_date" |
| 11 | + /> |
| 12 | + </p> |
| 13 | + </div> |
| 14 | + </xpath> |
| 15 | + </template> |
| 16 | + |
| 17 | + <template id="checkout" inherit_id="website_sale.checkout"> |
| 18 | + <!-- Add date for gift formular --> |
| 19 | + <xpath |
| 20 | + expr="//div[hasclass('oe_cart')]//div[hasclass('row')]" |
| 21 | + position="before" |
| 22 | + > |
| 23 | + <div class="row" id="date_for_gift" t-if="website_sale_order.is_gift"> |
| 24 | + <div class="col-lg-12"> |
| 25 | + <h3 |
| 26 | + class="o_page_header mt8" |
| 27 | + >When should the gift be delivered ?</h3> |
| 28 | + </div> |
| 29 | + <div class="col-lg-12"> |
| 30 | + <form |
| 31 | + action="/shop/checkout" |
| 32 | + method="post" |
| 33 | + name="date_for_gift" |
| 34 | + t-att-class="'was-validated' if errors else None" |
| 35 | + > |
| 36 | + <input |
| 37 | + type="hidden" |
| 38 | + name="csrf_token" |
| 39 | + t-att-value="request.csrf_token()" |
| 40 | + t-nocache="The csrf token must always be up to date." |
| 41 | + /> |
| 42 | + <div class="form-group"> |
| 43 | + <label class="form-label" for="date_for_gift"> |
| 44 | + Date for the gift |
| 45 | + </label> |
| 46 | + <input |
| 47 | + type="date" |
| 48 | + t-att-min="datetime.date.today()" |
| 49 | + required="required" |
| 50 | + class="form-control" |
| 51 | + id="date_for_gift" |
| 52 | + name="date_for_gift" |
| 53 | + /> |
| 54 | + <div |
| 55 | + t-if="errors.get('date_for_gift')" |
| 56 | + t-out="errors.get('date_for_gift')" |
| 57 | + class="invalid-feedback" |
| 58 | + /> |
| 59 | + </div> |
| 60 | + </form> |
| 61 | + </div> |
| 62 | + </div> |
| 63 | + </xpath> |
| 64 | + |
| 65 | + <!-- Replace confirm button --> |
| 66 | + <xpath expr="//a[@href='/shop/confirm_order']" position="attributes"> |
| 67 | + <attribute name="style">display: none;</attribute> |
| 68 | + </xpath> |
| 69 | + |
| 70 | + <xpath expr="//a[@href='/shop/confirm_order']" position="after"> |
| 71 | + <button id="gift_form_confirm_button" class="btn btn-primary mb32"> |
| 72 | + Confirm |
| 73 | + <i class="fa fa-chevron-right" /> |
| 74 | + </button> |
| 75 | + </xpath> |
| 76 | + |
| 77 | + <!-- Change section title accordingly --> |
| 78 | + <xpath |
| 79 | + expr="//div[hasclass('oe_cart')]//h3[@class='o_page_header mt16 mb4']" |
| 80 | + position="after" |
| 81 | + > |
| 82 | + <h3 |
| 83 | + id="title_gift_for" |
| 84 | + class="o_page_header mt16 mb4" |
| 85 | + t-if="website_sale_order.is_gift" |
| 86 | + >Gift for</h3> |
| 87 | + </xpath> |
| 88 | + |
| 89 | + <xpath |
| 90 | + expr="//div[hasclass('oe_cart')]//h3[@class='o_page_header mt16 mb4']" |
| 91 | + position="attributes" |
| 92 | + > |
| 93 | + <attribute name="id">title_shipping_address</attribute> |
| 94 | + <attribute name="t-if">not website_sale_order.is_gift</attribute> |
| 95 | + </xpath> |
| 96 | + </template> |
| 97 | + |
| 98 | +</odoo> |
0 commit comments