Skip ke Konten
Odoo Menu
  • Login
  • Uji coba gratis
  • Aplikasi
    Keuangan
    • Akuntansi
    • Faktur
    • Pengeluaran
    • Spreadsheet (BI)
    • Dokumen
    • Tanda Tangan
    Sales
    • CRM
    • Sales
    • POS Toko
    • POS Restoran
    • Langganan
    • Rental
    Website
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventaris
    • Manufaktur
    • PLM
    • Purchase
    • Maintenance
    • Kualitas
    Sumber Daya Manusia
    • Karyawan
    • Rekrutmen
    • Cuti
    • Appraisal
    • Referensi
    • Armada
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Acara
    • Otomatisasi Marketing
    • Survei
    Layanan
    • Project
    • Timesheet
    • Layanan Lapangan
    • Meja Bantuan
    • Planning
    • Appointment
    Produktivitas
    • Discuss
    • Kecerdasan Buatan
    • IoT
    • VoIP
    • Pengetahuan
    • WhatsApp
    Aplikasi pihak ketiga Odoo Studio Platform Odoo Cloud
  • Industri
    Retail
    • Toko Buku
    • Toko Baju
    • Toko Furnitur
    • Toko Kelontong
    • Toko Hardware
    • Toko Mainan
    Makanan & Hospitality
    • Bar dan Pub
    • Restoran
    • Fast Food
    • Rumah Tamu
    • Distributor Minuman
    • Hotel
    Real Estate
    • Agensi Real Estate
    • Firma Arsitektur
    • Konstruksi
    • Manajemen Properti
    • Perkebunan
    • Asosiasi Pemilik Properti
    Konsultansi
    • Firma Akuntansi
    • Mitra Odoo
    • Agensi Marketing
    • Firma huku
    • Talent Acquisition
    • Audit & Sertifikasi
    Manufaktur
    • Tekstil
    • Logam
    • Perabotan
    • Makanan
    • Brewery
    • Corporate Gift
    Kesehatan & Fitness
    • Sports Club
    • Toko Kacamata
    • Fitness Center
    • Wellness Practitioners
    • Farmasi
    • Salon Rambut
    Perdagangan
    • Handyman
    • IT Hardware & Support
    • Sistem-Sistem Energi Surya
    • Pembuat Sepatu
    • Cleaning Service
    • Layanan HVAC
    Lainnya
    • Organisasi Nirlaba
    • Agen Lingkungan
    • Rental Billboard
    • Fotografi
    • Penyewaan Sepeda
    • Reseller Software
    Browse semua Industri
  • Komunitas
    Belajar
    • Tutorial-tutorial
    • Dokumentasi
    • Sertifikasi
    • Pelatihan
    • Blog
    • Podcast
    Empower Education
    • Program Edukasi
    • Game Bisnis 'Scale Up!'
    • Kunjungi Odoo
    Dapatkan Softwarenya
    • Download
    • Bandingkan Edisi
    • Daftar Rilis
    Kolaborasi
    • Github
    • Forum
    • Acara
    • Terjemahan
    • Menjadi Partner
    • Layanan untuk Partner
    • Daftarkan perusahaan Akuntansi Anda.
    • Referral Program
    Dapatkan Layanan
    • Temukan Mitra
    • Temukan Akuntan
    • Konsultasi
    • Layanan Implementasi
    • Referensi Pelanggan
    • Bantuan
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dapatkan demo
  • Harga
  • Bantuan
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Help

How to Hide Product Variants in E-commerce and Sales

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
salesproductecommercewebsite
2 Replies
1844 Tampilan
Avatar
The Pet Depot, Christopher Chong

I have some products that do not have any stock in my inventory. Instead of having the unavailable product or product variant displayed online (without an add to cart button which confuses customers), I want to keep it hidden. How can I do that?

I also notice that depending on the arrangement of your variants -- which you have no control -- if the first variants is out of stock, the add to cart button on your shop disappears. What can I do to improve my website in hiding product variants if they have no stock. When I try unchecking the active box and keep the product published, I get server errors. And, if I unpublish a variant, the whole product -- along with its available variants -- are also unpublished. I don't want to delete the variants because they will be useful reference for future purchases. What can be done?

0
Avatar
Buang
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Jawaban Terbai
Hi,

To hide out-of-stock products or variants without deleting them, avoid unchecking Active or unpublishing variants, as this can cause errors or unpublish the entire product. Instead, enable the option in Website → Settings → Inventory to prevent selling out-of-stock items.

If you want products fully hidden when stock is zero, use an automated action or small customization to automatically unpublish products with no available quantity while keeping them active internally.

For variants, since Odoo loads the first variant by default (which may hide the Add to Cart button if out of stock), a minor customization is needed to either hide out-of-stock variants or prevent them from blocking the whole product page.

Related Module: https://apps.odoo.com/apps/modules/18.0/website_hide_variants

Solved Forum

1.  https://www.odoo.com/sl_SI/forum/pomoc-1/hide-out-of-stock-variants-on-ecommerce-179359

2. https://www.odoo.com/sl_SI/forum/pomoc-1/how-to-hidden-products-and-variants-in-website-shop-if-stock-product-is-0-218904




Hope it helps.

0
Avatar
Buang
Avatar
DTech (pvt) ltd, Abhishek Bandaranayaka
Jawaban Terbai

By default, Odoo eCommerce keeps products visible even if they are out of stock, which can indeed confuse customers.

There are two clean ways to handle this without deleting variants.

✅ 1. Automatically Hide Products When Out of Stock

Enable stock-based visibility:

  1. Go to Website → Configuration → Settings

  2. Under Shop, enable:

    • Inventory Availability

  3. Set Out-of-Stock behavior to:

    • “Show inventory below a threshold” or

    • Disable “Continue selling when out of stock”

Then on the product form:

  • Make sure Continue Selling is unchecked.

If a product has zero quantity and backorders are not allowed, Odoo will automatically remove the Add to Cart button and can prevent display depending on configuration.

✅ 2. Hide Out-of-Stock Variants (Recommended Approach)

The cleanest solution is to filter unavailable variants directly in the website template instead of archiving them.

Create a small custom module and inherit the product variant template to hide variants with zero stock.

Example override:

<template id="hide_out_of_stock_variants"

inherit_id="website_sale.product"

name="Hide Out of Stock Variants">


<xpath expr="//t[@t-foreach='combination_info.variant_values']"

position="attributes">

<attribute name="t-if">

combination_info.product_id.qty_available > 0

</attribute>

</xpath>


</template>

This ensures:

  • Variants with qty_available = 0 are not shown

  • The main product remains published

  • No server errors

  • Variants are preserved for future use

✅ 3. Fix “First Variant Out of Stock Removes Add to Cart”

This happens because Odoo selects the first variant by default.

To improve this behavior:

  • Reorder attribute values so an in-stock variant is first

    OR

  • Customize the JS logic to automatically select the first available variant instead of the first defined one.

The proper technical solution is to adjust the combination selection logic in website_sale so that it selects a variant where qty_available > 0.

❌ What Not to Do
  • Do not uncheck Active on variants (causes integrity issues).

  • Do not unpublish variants individually (unpublishes entire template).

  • Do not delete variants if you need them later.

✔ Best Practice

If you want full control and clean UX:

  • Keep products published

  • Disable “Continue Selling”

  • Hide unavailable variants via template override

This keeps your catalog clean while preserving historical data.

-2
Avatar
Buang
Menikmati diskusi? Jangan hanya membaca, ikuti!

Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!

Daftar
Post Terkait Replies Tampilan Aktivitas
Ecommerce sales with regular grouped payment by bank transfer on invoices only
sales ecommerce website
Avatar
0
Feb 25
2399
odoo 16 website eCommerce product image upload validations error
product ecommerce website
Avatar
Avatar
1
Okt 23
4151
Display Internal Reference on E-Commerce
product ecommerce website
Avatar
Avatar
Avatar
Avatar
Avatar
4
Okt 23
7688
Obsolete product replaced with new compatible product V14
sales product ecommerce
Avatar
Avatar
1
Sep 22
2481
Age control
sales ecommerce age website
Avatar
Avatar
Avatar
2
Apr 26
911
Komunitas
  • Tutorial-tutorial
  • Dokumentasi
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Terjemahan
Layanan
  • Odoo.sh Hosting
  • Bantuan
  • Peningkatan
  • Custom Development
  • Pendidikan
  • Temukan Akuntan
  • Temukan Mitra
  • Menjadi Partner
Tentang Kami
  • Perusahaan kami
  • Aset Merek
  • Hubungi kami
  • Karir
  • Acara
  • Podcast
  • Blog
  • Pelanggan
  • Hukum • Privasi
  • Keamanan
الْعَرَبيّة 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 Svenska ภาษาไทย Türkçe українська Tiếng Việt

Odoo adalah software terintegrasi dengan 70+ aplikasi seperti CRM, Akuntansi, Inventaris, Sales, eCommerce, Marketing, POS; plus fitur lokal Indonesia!

Mudah digunakan dan terintegrasi penuh pada saat yang sama adalah value proposition unik 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