Skip to Content
Menu
Dette spørgsmål er blevet anmeldt
1 Svar
920 Visninger

We are currently using Odoo 18.2 Online, or SaaS.


I know there are a lot of ready-made modules out there, but they are for the community version only.


I tried searching online, but I only saw this answer by Ray Carnes. The answer was for an old version of Odoo, and it is not working with the latest versions. 


Currently, I'm still trying to find a workaround in views, but I am having a hard time with inheriting these classes and tables:





Also having trouble finding the view and hiding the price of this.


I just want to hide the prices in guest or public viewing, that's all. Using the Prevent Sale of Zero Priced Product is not an option for us.

Avatar
Kassér
Bedste svar

Short & Working Solution (SaaS-compatible):
You can use custom CSS + user group class detection. Odoo adds o_connected_user class to the <body> tag when a user is logged in.

So you can hide prices only for guests (public users) with this CSS:
/* Hides prices ONLY for guest users (not logged in) */

body:not(.o_connected_user) .oe_price,

body:not(.o_connected_user) .product_price,

body:not(.o_connected_user) span[itemprop="price"],

body:not(.o_connected_user) .cart_total,

body:not(.o_connected_user) .text-right {

    display: none !important;

}

How to Apply It:
  1. Go to your Website > Click Edit (top right).
  2. Click the HTML/CSS editor (or “HTML Snippet” > “Custom Code”).
  3. Paste the CSS above.
  4. Save and publish.


i hope you will understand and it is helpfull

Avatar
Kassér
Forfatter

Sorry. Your answer is too vague. Please clarify or expound it properly.

Related Posts Besvarelser Visninger Aktivitet
2
jul. 25
469
2
jun. 25
983
2
maj 25
583
0
apr. 25
607
1
apr. 25
756