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.
 
 
 
 
 

25 lines
1.3 KiB

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="whatsapp_order" inherit_id="website_sale.product"
customize_show="True" name="Whatsapp Order">
<!--Inherited website_sale.product template to add Whatsapp order button-->
<xpath expr="//a[@id='add_to_cart']" position="after">
<div id="wp_msg" class="d-inline_i">
<t t-set="whatsapp_number"
t-value="request.env['ir.config_parameter'].sudo().get_param('integration_whatsapp_chat_live.mobile_phone_no')"/>
<t t-set="whatsapp_message"
t-value="request.env['ir.config_parameter'].sudo().get_param('integration_whatsapp_chat_live.custom_message')"/>
<t t-set="wp_product" t-value="product.name"/>
<t t-if="whatsapp_number and whatsapp_message">
<br/>
<a role="button" id="wp_msgs"
class="btn btn-success js_wp_mg"
t-attf-href="https://api.whatsapp.com/send?phone=#{whatsapp_number}&amp;text=#{whatsapp_message + ' ' + wp_product}">
<i class="fa fa-whatsapp mr-2"/>
Whatsapp Order
</a>
</t>
</div>
</xpath>
</template>
</odoo>