Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
1111 Zobrazení

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
Zrušit
Nejlepší odpověď

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
Zrušit
Autor

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

Related Posts Odpovědi Zobrazení Aktivita
2
čvc 25
597
2
čvn 25
1132
2
kvě 25
698
0
dub 25
690
1
dub 25
883