Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
935 Tampilan

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
Buang
Jawaban Terbai

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
Buang
Penulis

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

Post Terkait Replies Tampilan Aktivitas
2
Jul 25
477
2
Jun 25
991
2
Mei 25
592
0
Apr 25
620
1
Apr 25
785