You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

190 lines
12 KiB

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="verify_checkout" inherit_id="website_sale.navigation_buttons">
<!-- Replacing the button checkout -->
<xpath expr="//div" position="replace">
<!-- Checking if it is a public user.if it is a public user then open a modal to verify -->
<t t-if="website.is_public_user()">
<t t-set="step_specific_values"
t-value="website._get_checkout_steps(xmlid)"/>
<div t-attf-class="#{_container_classes} d-flex #{_form_send_navigation and 'flex-column flex-lg-row align-items-lg-center' or 'flex-column'} pt-4">
<t t-if="website_sale_order and website_sale_order.website_order_line">
<t t-if="xmlid == 'website_sale.payment'">
<div t-if="not website_sale_order.amount_total"
name="o_website_sale_free_cart">
<form name="o_wsale_confirm_order"
class="d-flex flex-column"
target="_self"
action="/shop/payment/validate"
method="post">
<input type="hidden"
name="csrf_token"
t-att-value="request.csrf_token()"
t-nocache="The csrf token must always be up to date."/>
<t t-call="payment.submit_button">
<t t-set="submit_button_label">Confirm
Order
</t>
</t>
</form>
</div>
<t t-else="" t-call="payment.submit_button"/>
</t>
<t t-else="">
<a role="button" class="btn btn-primary float-end"
name="website_sale_main_button"
data-bs-toggle="modal"
t-attf-class="#{_cta_classes} btn btn-primary #{not website_sale_order._is_cart_ready() and 'disabled'} #{_form_send_navigation and 'order-lg-3 w-100 w-lg-auto ms-lg-auto' or 'w-100'}"
data-bs-target="#portal_deactivate_account_modal">
<span>Process Checkout</span>
<span class="fa fa-chevron-right"/>
</a>
<div t-attf-class="modal #{'show d-block' if open_deactivate_modal else ''}"
id="portal_deactivate_account_modal"
tabindex="-1"
role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content" style="margin-top:50px;">
<div class="modal-header">
<button type="button"
class="btn-close"
data-bs-dismiss="modal"/>
</div>
<form class="oe_login_form modal-body"
role="form"
t-attf-action="/web/login"
method="post"
onsubmit="this.action = '/web/login' + location.hash">
<input type="hidden"
name="csrf_token"
t-att-value="request.csrf_token()"/>
<div class="mb-3 field-login">
<label for="login"
class="form-label">
Email
</label>
<input type="text"
placeholder="Email"
name="login"
t-att-value="login"
id="login"
t-attf-class="form-control #{'form-control-sm' if form_small else ''}"
required="required"
autofocus="autofocus"
autocapitalize="off"/>
</div>
<div class="mb-3">
<label for="password"
class="form-label">
Password
</label>
<input type="password"
placeholder="Password"
name="password"
id="password"
t-attf-class="form-control #{'form-control-sm' if form_small else ''}"
required="required"
autocomplete="current-password"
t-att-autofocus="'autofocus' if login else None"
maxlength="4096"/>
</div>
<p class="alert alert-danger"
t-if="error"
role="alert">
<t t-esc="error"/>
</p>
<p class="alert alert-success"
t-if="message" role="status">
<t t-esc="message"/>
</p>
<div t-attf-class="clearfix oe_login_buttons text-center gap-1 d-grid mb-1 {{'pt-2' if form_small else 'pt-3'}}">
<button type="submit"
class="btn btn-primary">
Log
in
</button>
<div class="o_login_auth"/>
</div>
<div class="justify-content-between mt-2 d-flex small">
<a href="/web/signup?">Don't
have an
account?
</a>
<a href="/web/reset_password?">
Reset
Password
</a>
</div>
<t t-set="redirect_url"
t-value="'/web/login?redirect=/shop/checkout' if redirect_to_sign_in else '/shop/checkout?express=1'"/>
<input type="hidden" name="redirect"
t-att-value="redirect_url"/>
</form>
</div>
</div>
</div>
</t>
</t>
<div t-attf-class="position-relative #{_form_send_navigation and 'd-flex d-lg-none' or 'd-flex'} w-100 justify-content-center align-items-center my-2 opacity-75">
<hr class="w-100"/>
<span class="px-3">or</span>
<hr class="w-100"/>
</div>
<a t-att-href="step_specific_values['back_button_href']"
class="text-center">
<i class="fa fa-angle-left me-2 fw-light"/>
<t t-out="step_specific_values['back_button']"/>
</a>
</div>
</t>
<!-- If not then move to checkout page -->
<t t-else="">
<t t-set="step_specific_values"
t-value="website._get_checkout_steps(xmlid)"/>
<div t-attf-class="#{_container_classes} d-flex #{_form_send_navigation and 'flex-column flex-lg-row align-items-lg-center' or 'flex-column'} pt-4">
<t t-if="website_sale_order and website_sale_order.website_order_line">
<t t-if="xmlid == 'website_sale.payment'">
<div t-if="not website_sale_order.amount_total"
name="o_website_sale_free_cart">
<form name="o_wsale_confirm_order"
class="d-flex flex-column"
target="_self"
action="/shop/payment/validate"
method="post">
<input type="hidden"
name="csrf_token"
t-att-value="request.csrf_token()"
t-nocache="The csrf token must always be up to date."/>
<t t-call="payment.submit_button">
<t t-set="submit_button_label">Confirm
Order
</t>
</t>
</form>
</div>
<t t-else="" t-call="payment.submit_button"/>
</t>
<t t-else="">
<a role="button" name="website_sale_main_button"
t-attf-class="#{_cta_classes} btn btn-primary #{not website_sale_order._is_cart_ready() and 'disabled'} #{_form_send_navigation and 'order-lg-3 w-100 w-lg-auto ms-lg-auto' or 'w-100'}"
t-att-href="step_specific_values['main_button_href']">
<t t-out="step_specific_values['main_button']"/>
<i class="fa fa-angle-right ms-2 fw-light"/>
</a>
</t>
</t>
<div t-attf-class="position-relative #{_form_send_navigation and 'd-flex d-lg-none' or 'd-flex'} w-100 justify-content-center align-items-center my-2 opacity-75">
<hr class="w-100"/>
<span class="px-3">or</span>
<hr class="w-100"/>
</div>
<a t-att-href="step_specific_values['back_button_href']"
class="text-center">
<i class="fa fa-angle-left me-2 fw-light"/>
<t t-out="step_specific_values['back_button']"/>
</a>
</div>
</t>
</xpath>
</template>
</odoo>