Ir al contenido
Menú
Se marcó esta pregunta
4 Respuestas
4646 Vistas

Hello Community,

I am trying to set up a webshop where it is possible for b2b customers to order stuff. 

So when nobody is logged in, the prices should be B2C. This part works :-).

But when a user logs in the prices should change to the prices on the pricelist for this user. 

So if a B2B-user logs he should see b2b-prices. 

I thought this would be an easy thing to do, but for some reason it is not working like I thought. 

I have the pricelists set up, so I have a B2B and B2C pricelist, but the website does not responds the way I expected. It is showing B2B prices to every user also to B2C-users.  I have been playing around with this for a while, but I can't get it to work.

Thank you for the help setting this up. 

Avatar
Descartar
Mejor respuesta

Hi Dries,

I stumbled on your question by chance. We are currently set up with B2C pricing in public and B2B pricing when users are logged in. 

We set up a separate price list for retail pricings.

We used this guide to help us navigate pricing behavior:  The almost complete guide to pricelist behavior | Odoo

Avatar
Descartar
Mejor respuesta

Can I follow up on this please?  Did you ever resolve this and how?  I also want to show B2C prices and B2B prices for different users.  Ideally, show B2C prices for non logged in, and B2B prices (usually lower as you mentioned) for select customers.  

Avatar
Descartar
Mejor respuesta

Check the Website configuration from your pricelists

Check also the pricelist from the "Sales & Purchase" Tab of your contacts.

Check the pricelist from the archived contact "public user" (This is the pricelist shown for everyone not logged in)

If you work with taxes included for B2C and excluded for B2B you can also set the Fiscal Position in the Sales & Purchase Tab of each contact, more informations you will find in: https://www.odoo.com/documentation/15.0/nl/applications/finance/accounting/taxation/taxes/B2B_B2C.html?highlight=b2b

A nice forum post about pricelist: https://www.odoo.com/forum/help-1/the-almost-complete-guide-to-pricelist-behavior-185877

And watch this very nice video about B2B website: https://www.youtube.com/watch?v=m4PyXEw95Tw

I hope it helps

BR

Ricardo

Avatar
Descartar
Autor

Hi Ricardo, Thank you for your answer, but this is not what I'm looking for. In my case the B2B customers have a totally different (lower) price than the B2C. So it is not a question of showing prices incl or excl vat.
So I have a pricelist with all the b2b prices listed and I want the webshop to show these b2b prices to all b2b customers when they are logged in.
Now for some reason odoo shows the prices to everyone.
Do you have any clues on how to do that?
Thanks!

Autor Mejor respuesta

For now I solved this by making two websites with shops. But I still hope someone comes up with an answer on how to do it properly. I still can't believe that it isn't posible to show the logged in users their own price on their pricelist on the webshop. This should be very easy in my opinion.

This is how I did it for now.
The products are showing on both the shops. The b2c shop uses the b2c pricelist and the b2b-shop the b2b pricelist.
I made a module that allows only logged in users on the B2B shop. So if a user switches to the b2b-site they automatically get redirected to the login page for every page of the webshop they try to access.

redirecting non-logged in users to the loginpage can be don by inheriting the controller of the webshop eg:

@http.route()
def shop(self, page=0, category=None, search='', min_price=0.0, max_price=0.0, ppg=False, **post):
"""
check if website requires login for users to see the shop.
If so, check if user is logged in.
If not, rederect to login page.
"""
if request.env['website'].get_current_website().need_login:
if request.env.user.id == request.env.ref('base.public_user').id:
return request.render('web.login', {})

return super(WebsiteSaleNeedLogin,self).shop(page, category, search, min_price, max_price, ppg, **post)

Where need_login is a setting I added on the website-settings page. There you can set this website specific.

If you have multiple databases running on one server you do need to adjust your dbfilter for this. You can find a way to do this in this message: https://www.odoo.com/nl_NL/forum/help-1/how-to-configure-dbfilter-for-multi-website-environnement-204368

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
4
dic 24
2091
3
oct 23
1973
0
ene 23
1465
0
sept 22
512
1
jun 22
3063