Skip to Content

Welcome!

Share and discuss the best content and new marketing ideas, build your professional profile and become a better marketer together.

Sign up

You need to be registered to interact with the community.
This question has been flagged
1 Reply
49 Views

I'm interested in setting up the Odoo website/e-commerce system for various distributors' websites. This would require me to allow the products to be displayed with general information (ie. product pictures, description,etc.) without pricing to the general public (ie. those that are not logged in). I would then need to be able to provide a login for pre-approved accounts to allow wholesalers to login and see their own pricing according to their pricelist rules and allow them to add to cart/quote which would trigger a RFQ or sales order in Odoo v8.

Unfortunately there is not much information regarding the website/e-commerce module available currently due to the fact Odoo v8 is still in alpha.


I believe this would be extremely useful for distributors to be able to display their products without pricing unless a pre-approved account is setup for them to login. It is possible to do with Magento with various extensions such as the B2B Extension for Magento found here:


https://github.com/sitewards/B2BProfessional

or by editing the local.xml file in various theme packages in Magento by using the <customer_logged_in> and <customer_logged_out> tags to provide conditional logic based on those two situations.

I have been looking for a way to either connect Magento (CE 1.8/1.9) to Odoo (v8) by means of a connector (currently there is nothing available) or be able implement this with the current Odoo E-commerce/Website module (preferred). If anyone has any insight on this please comment below as I would appreciate any input on this

Avatar
Discard

You have to change the view that is responsible for displaying the price. To do that:

  • go to: Settings -> Technical -> User Interface -> Views (Technical Settings need to be enabled for your user)
  • Search for the "product_price" view (it has QWeb as view type)
  • add t-if="not user_id.partner_id.name == 'Public user'" to the first occuring div
    Result: 
    <div t-if="not user_id.partner_id.name == 'Public user'" itemprop="offers" itemscope="itemscope" itemtype="http://schema.org/Offer" class="product_price mt16">

​This stops displaying prices on the product page.

To not show prices for users who are not logged in on the page with the overview of the products:

  • open the start page of the shop
  • Go to the HTML-Editor via Customize
  • ​select the "Product item" view
  • again add t-if="not user_id.partner_id.name == 'Public user'" to the following element:
    <div itemprop="offers" itemscope="itemscope" itemtype="http://schema.org/Offer" class="product_price" ...

12

Luke Branch

 Author

@Martin Apitz, Thank you for the detailed explanation, i'll try your suggestions and post back with what I find.

Luke Branch

 Author

@Martin Aptitz, Thank you for your tutorial. This works great for my needs and can be applied to multiple other scenarios requiring hiding elements of the website from public view. This has been a huge help in creating a theme module that is suitable for B2B sales through the website frontend (ie. Distributor > Wholesaler). I have noticed in the Product Item view however that I cannot add two t-if's to a single element (ie. the

with the t-if="not user_id.partner_id.name == 'Public user'", however i'm curious as to whether this is best practice for this type of situation (ie. when multiple t-if statements need to be applied to a single element), or whether there is a way to add multiple t-if's to a single element.

Luke Branch

 Author

@Martin Apitz, Thanks for your reply, unfortunately it seems to have only come through by email so i'm posting it back here for the benefit of others in the forum: Hi Luke, you can have more then one condition in one t-if statement by combining them with "and". Like so: t-if="[first condition] and [second condition]" thanks for all your help with this question.

Avatar
Discard

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!