| 1 | <?xml version="1.0" ?> |
| 2 | <odoo><data> |
| 3 | |
| 4 | <template id="website_sale_confirmation_slide" inherit_id="website_sale.confirmation"> |
| 5 | <xpath expr="//div[@id='oe_structure_website_sale_confirmation_2']" position="after"> |
| 6 | <t t-if="any( |
| 7 | product.service_tracking == 'course' for product in order.order_line.product_id |
| 8 | )" t-call="website_sale_slides.course_purchased_confirmation_message"/> |
| 9 | </xpath> |
| 10 | </template> |
| 11 | |
| 12 | <template id="course_purchased_confirmation_message"> |
| 13 | <div> |
| 14 | <h4> |
| 15 | <t t-if="order.state == 'sale'">You have gained access to the following course(s):</t> |
| 16 | <t t-else="">Once your order is paid & confirmed, you will gain access to:</t> |
| 17 | </h4> |
| 18 | </div> |
| 19 | <div class="mt-2"> |
| 20 | <t t-foreach="order.order_line" t-as="line"> |
| 21 | <div t-foreach="line.product_id.channel_ids" t-as="course" class="row mx-0 my-2 border"> |
| 22 | <div class="col-5 d-flex justify-content-center my-auto"> |
| 23 | <span t-if="course.image_1920" t-field="course.image_1920" t-options="{'widget': 'image', 'class': 'my-2'}"/> |
| 24 | <img t-else="" class="img img-fluid my-2" src="/website_slides/static/src/img/channel-training-default.jpg"/> |
| 25 | </div> |
| 26 | <t t-set="invitation_link" t-value="course_memberships[course].invitation_link if course in course_memberships else ''"/> |
| 27 | <div class="col-7"> |
| 28 | <a t-att-href="invitation_link"><h3 t-out="course.name" class="m-2"/></a> |
| 29 | <div t-out="course.description_short" class="fw-light o_wslides_desc_truncate_2 ms-2"/> |
| 30 | <div class="fw-light ms-2 mt-2"> |
| 31 | <t t-out="course.total_time" t-options="{'widget': 'duration', 'unit': 'hour', 'round': 'minute'}"/> |
| 32 | <t t-if="course.total_slides"> |
| 33 | <t t-if="course.total_time"> - </t><t t-out="course.total_slides"/> step(s) |
| 34 | </t> |
| 35 | </div> |
| 36 | <a role="button" class="btn btn-primary ms-2 my-2" t-attf-class="btn btn-primary ms-2 my-2 #{'disabled' if not invitation_link else ''}" t-att-href="invitation_link"> |
| 37 | Start Learning |
| 38 | </a> |
| 39 | </div> |
| 40 | </div> |
| 41 | </t> |
| 42 | </div> |
| 43 | </template> |
| 44 | |
| 45 | <template id="cart_summary_inherit_website_sale_slides" |
| 46 | inherit_id="website_sale.cart_summary_content" |
| 47 | name="Course Cart right column"> |
| 48 | <xpath expr="//td[@name='website_sale_cart_summary_product_name']/span" position="after"> |
| 49 | <div t-if="line.product_id.channel_ids" |
| 50 | t-foreach="line.product_id.channel_ids.filtered(lambda course: course.enroll == 'payment')" |
| 51 | t-as="course" |
| 52 | t-out="course.name"/> |
| 53 | </xpath> |
| 54 | </template> |
| 55 | |
| 56 | </data></odoo> |