I need to add the subtotal to odoo e-commerce payment view. Which is visible after continuing payment in the shopping cart? Need suggestions to add that. I am not fluent in JavaScript.
You should look into the views in odoo (In debug mode: Settings > Technical > User Interface > Views). I think you're looking for 'website_sale.total' view which will be visible at the /shop/payment page.
<t t-name="website_sale.total">
<div id="cart_total" t-att-class="extra_class or ''" t-if="website_sale_order and website_sale_order.website_order_line">
<table class="table">
<tr id="empty">
<t t-if="not no_rowspan"><td rowspan="10" class="border-0"/></t>
<td class="col-md-2 col-3 border-0"/>
<td class="col-md-2 col-3 border-0"/>
</tr>
<tr id="order_total_untaxed">
<td class="text-right border-0">Subtotal:</td>
<td class="text-xl-right border-0">
<span t-field="website_sale_order.amount_untaxed" class="monetary_field" style="white-space: nowrap;" t-options="{'widget': 'monetary', 'display_currency': website_sale_order.currency_id}"/>
</td>
</tr>
<tr id="order_total_taxes">
<td class="text-right border-0">Taxes:</td>
<td class="text-xl-right border-0">
<span t-field="website_sale_order.amount_tax" class="monetary_field" style="white-space: nowrap;" t-options="{'widget': 'monetary', 'display_currency': website_sale_order.currency_id}"/>
</td>
</tr>
<tr id="order_total">
<td class="text-right"><strong>Total:</strong></td>
<td class="text-xl-right">
<strong t-field="website_sale_order.amount_total" class="monetary_field" t-options="{"widget": "monetary", "display_currency": website_sale_order.pricelist_id.currency_id}"/>
</td>
</tr>
</table>
</div>
</t>
You can inherit this view in a custom module and modify it as needed. https://doc.odoo.com/6.0/developer/2_6_views_events/views/view_inheritence/ https://www.odoo.com/forum/help-1/how-to-inherit-view-in-existing-module-94801
Or you can add this view to another section by calling this view.
<t t-call="website_sale.total">
<t t-set="redirect" t-value="redirect or '/shop/payment'"/>
</t>