Skip to Content
Menu
This question has been flagged
2 Replies
4693 Views

Hello,

I'm using odoo 13.0. I want to remove the  Product Price and the add to cart buttons from my recently viewed carousel in the website module. How can i do this ? 

Thanks in advance!


Avatar
Discard

Have you found any solution?

Author Best Answer

You can set the style="visibility:hidden; for that block.

Avatar
Discard

Hello, Snippets are load from JS and XML and i want to hide price for public user

Best Answer

Hi,

You have to change the xmlDependencies option in js where the template is defined and also need to extend the qweb template.

In your .js file :

odoo.define('module_name.recently_viewed', function (require) {
var publicWidget = require('web.public.widget');
publicWidget.registry.productsRecentlyViewedSnippet.include({
xmlDependencies: (publicWidget.registry.productsRecentlyViewedSnippet.prototype.xmlDependencies || []).concat(
['/module_name/static/src/xml/website_sale_recently_viewed.xml']
),
});
});

in qweb xml file:

<?xml version="1.0" encoding="UTF-8"?>
<templates xml:space="preserve">
<t t-extend="website_sale.productsRecentlyViewed">
<t t-jquery="div.d-block" t-operation="replace"></t>
<t t-jquery="button.js_add_cart" t-operation="replace"></t>
</t>
</templates>

Hope it helps

Avatar
Discard

I am trying this, but stuck on it ... somehow the changes on my template are not applied ..
I made an isolated test module:

https://github.com/jwaes/jt_webeditor_extras