Skip to Content
Odoo Меню
  • Увійти
  • Спробуйте це безкоштовно
  • Додатки
    Фінанси
    • Бухоблік
    • Виставлення рахунку
    • Витрати
    • Електронні таблиці (BI)
    • Документи
    • Підпис
    Продажі
    • CRM
    • Продажі
    • POS Магазин
    • POS Ресторан
    • Підписки
    • Оренда
    Веб-сайти
    • Конструктор веб-сайту
    • Електронна комерція
    • Блог
    • Форум
    • Живий чат
    • Електронне навчання
    Ланцюг поставок
    • Склад
    • Виробництво
    • PLM
    • Купівлі
    • Технічне обслуговування
    • Якість
    Кадри
    • Співробітники
    • Рекрутинг
    • Відпустки
    • Оцінювання
    • Рекомендації
    • Автотранспорт
    Маркетинг
    • Маркетинг соцмереж
    • Email-маркетинг
    • SMS-маркетинг
    • Події
    • Автом. маркетингу
    • Опитування
    Послуги
    • Проект
    • Табелі
    • Виїзне обслуговування
    • Служба підтримки
    • Планування
    • Призначення
    Продуктивність
    • Обговорення
    • Схвалення
    • IoT
    • IP-телефонія
    • База знань
    • WhatsApp
    Сторонні модулі Odoo Studio Платформа Odoo Cloud
  • Сфери
    Роздрібна торгівля
    • Книжковий магазин
    • Магазин одягу
    • Магазин меблів
    • Продуктовий магазин
    • Магазин будівельних матеріалів
    • Магазин іграшок
    Food & Hospitality
    • Бар та паб
    • Ресторан
    • Фастфуд
    • Guest House
    • Дистриб'ютор напоїв
    • Hotel
    Нерухомість
    • Real Estate Agency
    • Архітектурна фірма
    • Будівництво
    • Управління нерухомістю
    • Садівництво
    • Асоціація власників нерухомості
    Консалтинг
    • Бухгалтерська компанія
    • Партнер Odoo
    • Агенція маркетингу
    • Юридична фірма
    • Придбання Талантів
    • Аудит та сертифікація
    Виробництво
    • Textile
    • Metal
    • Меблі
    • Їжа
    • Brewery
    • Корпоративні подарунки
    Здоров'я & Фітнес
    • Спортивний клуб
    • Оптика
    • Фітнес-центр
    • Практики здоров'я
    • Аптека
    • Салон краси
    Trades
    • Ремонтник
    • IT-обладнання та Підтримка
    • Системи сонячної енергії
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Інші
    • Nonprofit Organization
    • Екологічна агенція
    • Оренда білбордів
    • Фотографія
    • Лізинг велосипедів
    • Реселлер програмного забезпечення
    Browse all Industries
  • Спільнота
    Навчання
    • Навчальний посібник
    • Документація
    • Сертифікації
    • Тренування
    • Блог
    • Подкаст
    Сприяйте Освіті
    • Програма навчання
    • Бізнес гра Scale Up!
    • Відвідайте Odoo
    Отримайте програмне забезпечення
    • Завантаження
    • Порівняйте версії
    • Релізи
    Співпрацюйте
    • Github
    • Форум
    • Події
    • Переклади
    • Стати партнером
    • Services for Partners
    • Зареєструйте вашу бухгалтерську фірму
    Отримайте послуги
    • Знайдіть партнера
    • Знайдіть бухгалтера
    • Зустріньтеся з консультантом
    • Послуги з впровадження
    • Референси клієнтів
    • Підтримка
    • Оновлення
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Отримати демо
  • Ціни
  • Допомога

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

  • CRM
  • e-Commerce
  • Бухоблік
  • Склад
  • PoS
  • Проект
  • MRP
All apps
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
All Posts Люди Значки
Мітки (View all)
odoo accounting v14 pos v15
Про цей форум
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
All Posts Люди Значки
Мітки (View all)
odoo accounting v14 pos v15
Про цей форум
Допомога

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

Підписатися

Отримуйте сповіщення про активність щодо цієї публікації

Це запитання позначене
ecommerceodoo12
5 Відповіді
16984 Переглядів
Аватар
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
Аватар
Відмінити
Аватар
Anisha Bahukhandi
Найкраща відповідь

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
Аватар
Відмінити
Аватар
Adrian M. Padilla
Найкраща відповідь

@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
Аватар
Відмінити
Аватар
amelsalah27@gmail.com
Найкраща відповідь


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
Аватар
Відмінити
Аватар
Paresh Wagh
Найкраща відповідь

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
Аватар
Відмінити
Аватар
Ed Lo
Автор Найкраща відповідь

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
Аватар
Відмінити
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Реєстрація
Related Posts Відповіді Переглядів Дія
when adding product to cart while accessing site with www I get catr is empty!
ecommerce odoo12
Аватар
0
черв. 20
3002
How to add a new Payment Acquirers in Odoo12 eCommerce Вирішено
ecommerce odoo12
Аватар
Аватар
5
трав. 20
5140
What DB type to select for Odoo optimization?
xmlrpc ecommerce odoo12
Аватар
Аватар
1
лист. 25
4846
AttributeError: 'NoneType' object has no attribute '_get_first_possible_combination'
ecommerce cart odoo12
Аватар
0
жовт. 22
659
My Cart menu doesn't show up
ecommerce cart odoo12
Аватар
0
жовт. 22
379
Спільнота
  • Навчальний посібник
  • Документація
  • Форум
Open Source
  • Завантаження
  • Github
  • Runbot
  • Переклади
Послуги
  • Хостинг Odoo.sh
  • Підтримка
  • Оновлення
  • Кастомні доробки
  • Навчання
  • Знайдіть бухгалтера
  • Знайдіть партнера
  • Стати партнером
Про нас
  • Наша компанія
  • Торгові активи
  • Зв'яжіться з нами
  • Вакансії
  • Події
  • Подкаст
  • Блог
  • Клієнти
  • Юридичні документи • Конфіденційність
  • Безпека
الْعَرَبيّة 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 - це набір програм для роботи з відкритим кодом, які охоплюють всі ваші потреби компанії: CRM, електронна комерція, бухгалтерський облік, склад, точка продажу, управління проектами тощо.

Унікальна пропозиція Odoo - це одночасно дуже проста у використанні та повністю інтегрована.

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