forked from alaguraj/odoo-testing-addons
Customize checkout and address forms by removing company/VAT fields, renaming zip to postal code, simplifying address titles, hiding shipping options, and renaming the shipping wizard step.
This commit is contained in:
parent
7d20d000f3
commit
c744485423
@ -1,7 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<!-- Custom Address Form - Remove Company/VAT and Rename Zip to Postal Code -->
|
||||
<!-- Increased priority to 99 to ensure it overrides other theme or base overrides -->
|
||||
<!-- Custom Address Form - Remove Company/VAT and Rename Zip to Postal Code -->
|
||||
<!-- Increased priority to 99 to ensure it overrides other theme or base overrides -->
|
||||
<template id="chennora_address_custom" inherit_id="website_sale.address" name="Chennora Address Custom" priority="99">
|
||||
@ -15,15 +13,58 @@
|
||||
<!-- 3. Remove VAT Warning Message if it exists -->
|
||||
<xpath expr="//small[contains(text(), 'VAT number is not allowed')]/.." position="replace"/>
|
||||
|
||||
<!-- 4. Rename Zip Code Label to Postal Code -->
|
||||
<!-- Targeting by 'for' attribute and by text content to be absolutely sure -->
|
||||
<xpath expr="//label[@for='zip'] | //label[contains(text(), 'Zip')]" position="replace">
|
||||
<label class="col-form-label fw-normal" for="zip">Postal Code</label>
|
||||
<!-- 4. Rename Zip Code Label to Postal Code (First instance) -->
|
||||
<xpath expr="//label[@for='zip']" position="replace">
|
||||
<label class="col-form-label label-optional" for="zip">Postal Code</label>
|
||||
</xpath>
|
||||
|
||||
<!-- 5. Rename Zip Code Label to Postal Code (Second instance if it exists) -->
|
||||
<xpath expr="//label[@for='zip']" position="replace">
|
||||
<label class="col-form-label label-optional" for="zip">Postal Code</label>
|
||||
</xpath>
|
||||
|
||||
<!-- 5. Update Placeholder for Zip Input -->
|
||||
<!-- 6. Update Placeholder for Zip Input -->
|
||||
<xpath expr="//input[@name='zip']" position="attributes">
|
||||
<attribute name="placeholder">Postal Code</attribute>
|
||||
</xpath>
|
||||
|
||||
<!-- 7. Hide "Ship to the same address" switch -->
|
||||
<xpath expr="//input[@id='shipping_use_same']/ancestor::div[contains(@class, 'form-check')]" position="attributes">
|
||||
<attribute name="class" add="d-none" separator=" "/>
|
||||
</xpath>
|
||||
|
||||
<!-- 8. Change "Shipping address" / "Billing address" title to just "Address Details" -->
|
||||
<xpath expr="//h3[contains(., 'address')]" position="replace">
|
||||
<h3 class="mb-3">Address Details</h3>
|
||||
</xpath>
|
||||
|
||||
<!-- 9. Remove the "Be aware!" warning box -->
|
||||
<xpath expr="//div[contains(@class, 'alert-warning')][.//h4[contains(., 'Be aware')]]" position="replace"/>
|
||||
</template>
|
||||
|
||||
<!-- Custom Checkout Page - Remove Shipping Section entirely -->
|
||||
<template id="chennora_checkout_custom" inherit_id="website_sale.checkout" name="Chennora Checkout Custom" priority="99">
|
||||
<!-- 1. Remove the "Billing" sub-header -->
|
||||
<xpath expr="//h4[contains(., 'Billing')]" position="replace"/>
|
||||
|
||||
<!-- 2. Rename the "Shipping Address" header if it exists -->
|
||||
<xpath expr="//h4[contains(., 'Shipping')]" position="replace">
|
||||
<h4 class="mb-0">Address Details</h4>
|
||||
</xpath>
|
||||
|
||||
<!-- 3. Completely remove the "Shipping" section block -->
|
||||
<xpath expr="//t[@groups='account.group_delivery_invoice_address']" position="replace"/>
|
||||
</template>
|
||||
|
||||
<!-- Custom Wizard - Rename Shipping step to Address -->
|
||||
<template id="chennora_wizard_checkout_custom" inherit_id="website_sale.wizard_checkout" name="Chennora Wizard Custom" priority="99">
|
||||
<xpath expr="//*[@t-call='website.step_wizard']" position="before">
|
||||
<t t-foreach="wizard_step" t-as="step">
|
||||
<t t-if="step[1].get('name') == 'Shipping'">
|
||||
<t t-set="dummy" t-value="step[1].update({'name': 'Address'})"/>
|
||||
</t>
|
||||
</t>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
</odoo>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user