forked from alaguraj/odoo-testing-addons
customize checkout UI for Uber integration and update docker-compose service configuration
This commit is contained in:
parent
b4d292ac95
commit
da3c7a2bfa
@ -22,17 +22,22 @@
|
|||||||
|
|
||||||
<!-- Simplify Checkout: Show only Billing Address, Hide Shipping Address UI -->
|
<!-- Simplify Checkout: Show only Billing Address, Hide Shipping Address UI -->
|
||||||
<template id="chennora_checkout_custom" inherit_id="website_sale.checkout" name="Chennora Checkout Custom" priority="99">
|
<template id="chennora_checkout_custom" inherit_id="website_sale.checkout" name="Chennora Checkout Custom" priority="99">
|
||||||
<!-- Hide the Shipping column UI to simplify the page (avoids confusion) -->
|
<!-- 1. Hide the Shipping Address Block entirely using its unique t-group attribute -->
|
||||||
<xpath expr="//div[h4[contains(., 'Shipping')]]" position="attributes">
|
<xpath expr="//div[@t-groups='account.group_delivery_invoice_address']" position="attributes">
|
||||||
<attribute name="style">display: none !important;</attribute>
|
<attribute name="style">display: none !important;</attribute>
|
||||||
</xpath>
|
</xpath>
|
||||||
|
|
||||||
<!-- Rename Billing to just 'Address' -->
|
<!-- 2. Make the Billing Address section full-width since Shipping is hidden -->
|
||||||
|
<xpath expr="//div[h4[contains(., 'Billing')]]" position="attributes">
|
||||||
|
<attribute name="class" add="col-12" remove="col-md-6" separator=" "/>
|
||||||
|
</xpath>
|
||||||
|
|
||||||
|
<!-- 3. Rename Billing to just 'Address' or 'Delivery Address' -->
|
||||||
<xpath expr="//h4[contains(., 'Billing')]" position="replace">
|
<xpath expr="//h4[contains(., 'Billing')]" position="replace">
|
||||||
<h3 class="mb-4">Delivery Address</h3>
|
<h3 class="mb-4">Delivery Address</h3>
|
||||||
</xpath>
|
</xpath>
|
||||||
|
|
||||||
<!-- Script for Uber Quote using the primary partner address -->
|
<!-- Script for Uber Quote -->
|
||||||
<xpath expr="//h3" position="after">
|
<xpath expr="//h3" position="after">
|
||||||
<div id="uber_error" class="alert alert-danger d-none my-3" role="alert"></div>
|
<div id="uber_error" class="alert alert-danger d-none my-3" role="alert"></div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
@ -53,7 +58,6 @@
|
|||||||
btn.classList.remove('btn-primary');
|
btn.classList.remove('btn-primary');
|
||||||
btn.style.pointerEvents = 'none';
|
btn.style.pointerEvents = 'none';
|
||||||
};
|
};
|
||||||
|
|
||||||
const enableButton = () => {
|
const enableButton = () => {
|
||||||
btn.classList.remove('disabled', 'btn-secondary');
|
btn.classList.remove('disabled', 'btn-secondary');
|
||||||
btn.classList.add('btn-primary');
|
btn.classList.add('btn-primary');
|
||||||
@ -68,7 +72,6 @@
|
|||||||
|
|
||||||
disableButton();
|
disableButton();
|
||||||
|
|
||||||
// Use Billing Address (Invoice) for Uber Quote
|
|
||||||
const addressData = {
|
const addressData = {
|
||||||
street: "<t t-esc='order.partner_invoice_id.street'/>",
|
street: "<t t-esc='order.partner_invoice_id.street'/>",
|
||||||
city: "<t t-esc='order.partner_invoice_id.city'/>",
|
city: "<t t-esc='order.partner_invoice_id.city'/>",
|
||||||
@ -92,7 +95,7 @@
|
|||||||
} else {
|
} else {
|
||||||
disableButton();
|
disableButton();
|
||||||
if (errorDiv) {
|
if (errorDiv) {
|
||||||
errorDiv.innerText = (data.result && data.result.error) ? data.result.error : "Uber delivery is not available for this address.";
|
errorDiv.innerText = (data.result && data.result.error) ? data.result.error : "Uber delivery not available.";
|
||||||
errorDiv.classList.remove('d-none');
|
errorDiv.classList.remove('d-none');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user