summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorJorge Pinna Puissant <jpp@odoo.com>2019-08-29 12:53:58 +0000
committerChristophe Simonis <chs@odoo.com>2019-09-04 19:40:17 +0200
commitdc5a8b1b309b7a8b30d3bad2c01c0d62f1633d10 (patch)
tree9041f9dfa638a4d03c4017bad411af578fd760a0 /addons
parent9570151cb5f9935dbf3d59e60415c47398f17fd8 (diff)
[FIX] website_sale_coupon: promotion program image
Before this commit, when using a promotion program ('I have a promo code') in the shopping cart in the e-commerce, the image of the promotion product is only shown if the user is connected. opw-2056968 closes odoo/enterprise#5343 X-port/Cherry-pick of odoo/enterprise@88e1ab31d261404c8dc25c203f9dd2667453d414 Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Diffstat (limited to 'addons')
-rw-r--r--addons/website_sale_coupon/views/website_sale_templates.xml22
1 files changed, 22 insertions, 0 deletions
diff --git a/addons/website_sale_coupon/views/website_sale_templates.xml b/addons/website_sale_coupon/views/website_sale_templates.xml
index b7f90dac918..cebbbe3074c 100644
--- a/addons/website_sale_coupon/views/website_sale_templates.xml
+++ b/addons/website_sale_coupon/views/website_sale_templates.xml
@@ -7,6 +7,16 @@
</xpath>
</template>
<template id="website_sale_coupon_cart_hide_qty" inherit_id="website_sale.cart_lines" active="True">
+ <xpath expr="//td[hasclass('td-img')]/span" position="replace">
+ <t t-if="line.is_reward_line and line.sudo().product_id.image_small">
+ <span>
+ <img t-att-src="image_data_uri(line.sudo().product_id.image_small)" class="img img-fluid rounded" t-att-alt="line.name_short"/>
+ </span>
+ </t>
+ <t t-else="">
+ <t>$0</t>
+ </t>
+ </xpath>
<xpath expr="//td[hasclass('td-qty')]/div" position="attributes">
<attribute name="t-att-style">line.is_reward_line and "display:none;"</attribute>
</xpath>
@@ -24,6 +34,18 @@
<attribute name="t-if">not line.is_reward_line</attribute>
</xpath>
</template>
+<template id="cart_popover" inherit_id="website_sale.cart_popover" name="Cart Popover">
+ <xpath expr="//div[hasclass('cart_line')]/div[1]/span" position="replace">
+ <t t-if="line.is_reward_line and line.sudo().product_id.image_small">
+ <span>
+ <img t-att-src="image_data_uri(line.sudo().product_id.image_small)" class="img img-fluid rounded" t-att-alt="line.name_short"/>
+ </span>
+ </t>
+ <t t-else="">
+ <t>$0</t>
+ </t>
+ </xpath>
+</template>
<template id="sale_coupon_result" inherit_id="website_sale.coupon_form">
<xpath expr="//form[@name='coupon_code']" position="after">
<t t-if="website_sale_order and website_sale_order.applied_coupon_ids">