add order type toggle and customize address form fields in checkout

This commit is contained in:
Alaguraj0361 2026-04-06 20:42:34 +05:30
parent 67b2501fca
commit 67995fa0c0

View File

@ -367,16 +367,20 @@
<!-- Custom Checkout Page - Remove Shipping Section entirely --> <!-- Custom Checkout Page - Remove Shipping Section entirely -->
<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">
<!-- 1. Remove the "Billing" sub-header --> <!-- 1. Hide the "Billing" sub-header instead of removing (prevents JS errors) -->
<xpath expr="//h4[contains(., 'Billing')]" position="replace"/> <xpath expr="//h4[contains(., 'Billing')]" position="attributes">
<attribute name="class" add="d-none" separator=" "/>
</xpath>
<!-- 2. Rename the "Shipping Address" header if it exists --> <!-- 2. Rename the "Shipping Address" header if it exists -->
<xpath expr="//h4[contains(., 'Shipping')]" position="replace"> <xpath expr="//h4[contains(., 'Shipping')]" position="replace">
<h4 class="mb-0">Address Details</h4> <h4 class="mb-0">Address Details</h4>
</xpath> </xpath>
<!-- 3. Completely remove the "Shipping" section block --> <!-- 3. Hide the "Shipping" section block instead of removing -->
<xpath expr="//t[@groups='account.group_delivery_invoice_address']" position="replace"/> <xpath expr="//t[@groups='account.group_delivery_invoice_address']" position="attributes">
<attribute name="class" add="d-none" separator=" "/>
</xpath>
<!-- 4. UBER QUOTE RELOAD SCRIPT (Ensures fee is applied on page load) --> <!-- 4. UBER QUOTE RELOAD SCRIPT (Ensures fee is applied on page load) -->
<xpath expr="//h3" position="after"> <xpath expr="//h3" position="after">
@ -385,7 +389,10 @@
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
document.addEventListener("DOMContentLoaded", function() { document.addEventListener("DOMContentLoaded", function() {
const btn = document.querySelector('a[name="website_sale_main_button"]'); // Try different selectors for the main checkout button
const btn = document.querySelector('a[name="website_sale_main_button"]') ||
document.querySelector('.oe_cart .btn-primary') ||
document.querySelector('.btn-primary[href*="/payment"]');
const errorDiv = document.getElementById('uber_error'); const errorDiv = document.getElementById('uber_error');
// Helper to disable button // Helper to disable button