Overslaan naar inhoud
Odoo Menu
  • Aanmelden
  • Probeer het gratis
  • Apps
    Financiën
    • Boekhouding
    • Facturatie
    • Onkosten
    • Spreadsheet (BI)
    • Documenten
    • Ondertekenen
    Verkoop
    • CRM
    • Verkoop
    • Kassasysteem winkel
    • Kassasysteem Restaurant
    • Abonnementen
    • Verhuur
    Websites
    • Websitebouwer
    • E-commerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Bevoorradingsketen
    • Voorraad
    • Productie
    • PLM
    • Inkoop
    • Onderhoud
    • Kwaliteit
    Personeelsbeheer
    • Werknemers
    • Werving & Selectie
    • Verlof
    • Evaluaties
    • Aanbevelingen
    • Wagenpark
    Marketing
    • Social media Marketing
    • E-mailmarketing
    • SMS Marketing
    • Evenementen
    • Marketingautomatisering
    • Enquêtes
    Diensten
    • Project
    • Urenstaten
    • Buitendienst
    • Helpdesk
    • Planning
    • Afspraken
    Productiviteit
    • Chat
    • Goedkeuringen
    • IoT
    • VoIP
    • Kennis
    • WhatsApp
    Apps van derden Odoo Studio Odoo Cloud Platform
  • Bedrijfstakken
    Detailhandel
    • Boekhandel
    • kledingwinkel
    • Meubelzaak
    • Supermarkt
    • Bouwmarkt
    • Speelgoedwinkel
    Food & Hospitality
    • Bar en Pub
    • Restaurant
    • Fastfood
    • Gastenverblijf
    • Drankenhandelaar
    • Hotel
    Vastgoed
    • Makelaarskantoor
    • Architectenbureau
    • Bouw
    • Vastgoedbeheer
    • Tuinieren
    • Vereniging van eigenaren
    Consulting
    • Accountantskantoor
    • Odoo Partner
    • Marketingbureau
    • Advocatenkantoor
    • Talentenwerving
    • Audit & Certificering
    Productie
    • Textiel
    • Metaal
    • Meubels
    • Eten
    • Brewery
    • Relatiegeschenken
    Gezondheid & Fitness
    • Sportclub
    • Opticien
    • Fitnesscentrum
    • Wellness-medewerkers
    • Apotheek
    • Kapper
    Trades
    • Klusjesman
    • IT-hardware & support
    • Zonne-energiesystemen
    • Schoenmaker
    • Schoonmaakdiensten
    • HVAC-diensten
    Andere
    • Non-profitorganisatie
    • Milieuagentschap
    • Verhuur van Billboards
    • Fotograaf
    • Fietsleasing
    • Softwareverkoper
    Browse all Industries
  • Community
    Leren
    • Tutorials
    • Documentatie
    • Certificeringen
    • Training
    • Blog
    • Podcast
    Versterk het onderwijs
    • Onderwijs- programma
    • Scale Up! Business Game
    • Bezoek Odoo
    Download de Software
    • Downloaden
    • Vergelijk edities
    • Releases
    Werk samen
    • Github
    • Forum
    • Evenementen
    • Vertalingen
    • Word een Partner
    • Services for Partners
    • Registreer je accountantskantoor
    Diensten
    • Vind een partner
    • Vind een boekhouder
    • Een adviseur ontmoeten
    • Implementatiediensten
    • Klantreferenties
    • Ondersteuning
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Vraag een demo aan
  • Prijzen
  • Help

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Boekhouding
  • Voorraad
  • PoS
  • Project
  • MRP
All apps
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Help

How to disable "Add to Cart" button in E-commerce product page in Odoo 12?

Inschrijven

Ontvang een bericht wanneer er activiteit is op deze post

Deze vraag is gerapporteerd
ecommerceodoo12
5 Antwoorden
17009 Weergaven
Avatar
Ed Lo

Dear all,

I am trying to use the Odoo 12 E-commerce function as an online catalog so I would like to disable "Add to Cart" button while I cannot disable it in product page.

I tried to delete the line:
<a role="button" id="add_to_cart" class="btn btn-primary btn-lg mt8 js_check_product a-submit" href="#">Add to Cart</a>
 in XML Product, but it does not allow me to save, which showing this error: 

Server error

A server error occured. Please check you correctly signed in and that the file you are saving is correctly formatted.
[object Object] 

There are some modules for older versions but I cannot use them in version 12.

Thanks in advance.

0
Avatar
Annuleer
Avatar
Anisha Bahukhandi
Beste antwoord

Hello,

You can disable the "Add to Cart" button in E-commerce product page in Odoo 12V easily.

To configure it from frontend follow the following steps:

  1. Go to the Odoo Website Product Page then click on HTML/CSS Editor under the Customize Tab.
  2. You need to remove or comment the following HTML/CSS Code

<a id="add_to_cart" class="btn btn-primary btn-lg mt8 js_check_product a-submit" href="#">Add to Cart</a>

For more information refer to the screenshot,

You can also disable it from Odoo Backend; you need to follow the below-mentioned steps:

  1. Open the Odoo and click on the Settings menu. Here, click on Activate the Developer Mode. Even, one can also activate the developer mode by typing ‘debug=1’ after ‘web?’ in the URL.
  2. Go to the 'Views' menu under 'Technical settings'
  3. Now, search for the 'Product'. It is a QWeb template for the product page in website_sale module. For more information refer screenshot-2,
  4. Open the product template and comment or remove the same line mentioned above (<a id="add_to_cart" class="btn btn-primary btn-lg mt8 js_check_product a-submit" href="#">Add to Cart</a>)

Please Note: The Add to Cart will be disabled only till you do not update the Website Module.

If you want to make the changes permanently then you have to do the same changes in website_sale Module.

If you have any issues/queries then, please https://webkul.uvdesk.com/en/customer/create-ticket/

For any doubt contact us at support@webkul.com 

https://prnt.sc/qgfufx

https://prnt.sc/qgfz7u 

7
Avatar
Annuleer
Avatar
Adrian M. Padilla
Beste antwoord

@Ed can you please share the exact language you used please? im a beginner and im trying to do the same for my website. I would also like to eliminate showing the price, could you help me?

0
Avatar
Annuleer
Avatar
amelsalah27@gmail.com
Beste antwoord


add below code to your module :


    
   


user_id.partner_id.name == 'Public user'" id="add_to_cart" class="btn btn-primary btn-lg mt16 js_check_product a-submit d-block d-sm-inline-block" href="#">Add to Cart


0
Avatar
Annuleer
Avatar
Paresh Wagh
Beste antwoord

Hi Ed:

You can add a hidden attribute to the <a> tag like so to hide the button:

<a role="button" id="add_to_cart" class="btn btn-primary btn-lg mt8 js_check_product a-submit" hidden href="#">Add to Cart</a>

However, the way you are trying to do it is not the recommended way. You can lose your changes during an update if you do it this way. Odoo has a set of customization guidelines that need to be followed for enhancing the core functionality of the system. For example, in this case, you need to use View Inheritance to add the hidden attribute to the <a> tag. The following link explains the concepts involved:

View inheritance

0
Avatar
Annuleer
Avatar
Ed Lo
Auteur Beste antwoord

Hi Paresh,

Thank you very much for your help. I added  style="visibility:hidden;" in the <a> tag and the Add to Cart button is now hidden. I will look into the View inheritance later.

Best regards,
Ed

0
Avatar
Annuleer
Geniet je van het gesprek? Blijf niet alleen lezen, doe ook mee!

Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!

Aanmelden
Gerelateerde posts Antwoorden Weergaven Activiteit
when adding product to cart while accessing site with www I get catr is empty!
ecommerce odoo12
Avatar
0
jun. 20
3004
How to add a new Payment Acquirers in Odoo12 eCommerce Opgelost
ecommerce odoo12
Avatar
Avatar
5
mei 20
5149
What DB type to select for Odoo optimization?
xmlrpc ecommerce odoo12
Avatar
Avatar
1
nov. 25
4859
AttributeError: 'NoneType' object has no attribute '_get_first_possible_combination'
ecommerce cart odoo12
Avatar
0
okt. 22
659
My Cart menu doesn't show up
ecommerce cart odoo12
Avatar
0
okt. 22
379
Community
  • Tutorials
  • Documentatie
  • Forum
Open Source
  • Downloaden
  • Github
  • Runbot
  • Vertalingen
Diensten
  • Odoo.sh Hosting
  • Ondersteuning
  • Upgrade
  • Gepersonaliseerde ontwikkelingen
  • Onderwijs
  • Vind een boekhouder
  • Vind een partner
  • Word een Partner
Over ons
  • Ons bedrijf
  • Merkelementen
  • Neem contact met ons op
  • Vacatures
  • Evenementen
  • Podcast
  • Blog
  • Klanten
  • Juridisch • Privacy
  • Beveiliging
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo is een suite van open source zakelijke apps die aan al je bedrijfsbehoeften voldoet: CRM, E-commerce, boekhouding, inventaris, kassasysteem, projectbeheer, enz.

Odoo's unieke waardepropositie is om tegelijkertijd zeer gebruiksvriendelijk en volledig geïntegreerd te zijn.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now