İçereği Atla
Odoo Menü
  • Portal
  • Ücretsiz deneyin
  • Uygulamalar
    Finans
    • Muhasebe
    • Faturalama
    • Masraf Yönetimi
    • Elektronik Çizelge (BI)
    • Belgeler
    • İmza
    Satış
    • Müşteri İlişkileri Yönetimi (CRM)
    • Satış
    • Satış Noktası Mağaza
    • Satış Noktası Restoran
    • Abonelikler
    • Kiralama
    Web Sitesi
    • Web Sitesi Oluşturucu
    • eTicaret
    • Blog
    • Forum
    • Canlı Sohbet
    • eÖğrenme
    Tedarik Zinciri
    • Envanter
    • Üretim
    • Ürün Yaşam Döngüsü Yönetimi
    • Satın Alma
    • Bakım
    • Kalite
    İnsan Kaynakları
    • Çalışanlar
    • İşe Alım
    • İzin
    • Değerlendirme
    • Referans
    • Filo Yönetimi
    Pazarlama
    • Sosyal Medyada Pazarlama
    • E-posta ile Pazarlama
    • SMS ile Pazarlama
    • Etkinlikler
    • Pazarlama Otomasyonu
    • Anket
    Hizmetler
    • Proje Yönetimi
    • Çalışma Çizelgeleri
    • Saha Hizmeti
    • Yardım Masası
    • Planlama
    • Randevular
    Verimlilik
    • Sohbet
    • Onay
    • Nesnelerin İnterneti
    • VoIP
    • Bilgi Bankası
    • WhatsApp
    Üçüncü taraf uygulamalar Odoo Stüdyo Odoo Bulut Platformu
  • Sektörler
    Perakende satış
    • Kitapçı
    • Giyim Mağazası
    • Mobilya Mağazası
    • Gıda Marketi
    • Hırdavat Dükkanı
    • Oyuncak Dükkanı
    Gıda ve Konaklama
    • Bar ve Pub
    • Restoran
    • Fast Food Restoranı
    • Konuk Evi
    • İçecek Distribütörü
    • Otel
    Gayrimenkul
    • Emlak Acentesi
    • Mimarlık Firması
    • İnşaat
    • Emlak Yönetimi
    • Bahçe Tasarımı
    • Mülk Sahipleri Derneği
    Uzmanlık
    • Muhasebe Firması
    • Odoo Partner
    • Pazarlama Ajansı
    • Hukuk Firması
    • Yetenek Kazanımı
    • Denetim ve Belgelendirme
    Üretim
    • Tekstil
    • Metal
    • Mobilyalar
    • Gıda
    • Bira fabrikası
    • Kurumsal Hediye
    Sağlık ve Spor
    • Spor Kulübü
    • Optik Mağazası
    • Fitness Merkezi
    • Sağlıklı Yaşam Merkezi
    • Eczane
    • Kuaför Salonu
    Ticaret
    • Tamirci
    • BT Donanım & Destek
    • Güneş Enerjisi Sistemleri
    • Ayakkabı İmalatçısı
    • Temizlik Hizmetleri
    • HVAC Hizmetleri
    Diğerleri
    • Kar Amacı Gütmeyen Kuruluş
    • Çevre Ajansı
    • Reklam Panosu Kiralama
    • Fotoğrafçılık
    • Bisiklet Kiralama
    • Yazılım Bayisi
    Tüm Sektörlere Göz Atın
  • Topluluk
    Öğrenim
    • Eğitim Araçları
    • Dokümantasyon
    • Sertifikasyonlar
    • Eğitim Etkinlikleri
    • Blog
    • Podcast
    Eğitim ve Gelişim
    • Eğitim Programı
    • Scale Up! İşletme Oyunu
    • Odoo'yu Ziyaret Edin
    Yazılım
    • İndirin
    • Sürümleri Kıyaslayın
    • Sürümler
    İş Birliği
    • Github
    • Forum
    • Etkinlikler
    • Çeviriler
    • Partner Olun
    • Partnerler için Hizmetler
    • Muhasebe Firmanızı Kaydettirin
    Hizmetler
    • Partner Bulun
    • Muhasebeci Bulun
    • Bir danışmanla görüşün
    • Kurulum Hizmetleri
    • Müşteri Referansları
    • Destek
    • Sürüm Yükseltme
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Demo randevusu alın
  • Fiyatlandırma
  • Yardım

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

  • Müşteri İlişkileri Yönetimi
  • e-Commerce
  • Muhasebe
  • Envanter
  • PoS
  • Proje Yönetimi
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiketler (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiketler (View all)
odoo accounting v14 pos v15
About this forum
Yardım

How to get selected product variant object in product page (website)?

Abone Ol

Get notified when there's activity on this post

Bu soru işaretlendi
variantpagewebsitewebsite_saleQweb
2 Cevaplar
10698 Görünümler
Avatar
Tani Maria and Sons Co.

I have overriden the product.packagings table to move from product.template to product.product where it should be (check \Github issue #8237).

Now I want to display packaging info on the website for each variant (aka product.product).

I insert a very crude qweb to test:

<table>

    <tbody>

         <t t-foreach="product.product_variant_ids[0].packaging_ids" t-as="packaging_id">

               <tr>

                    <td>​<span t-field="packaging_id.ean"/></td>

                    <td>​<span t-field="packaging_id.qty"/></td>

               </tr>

         </t>

      </tbody>

</table>


It works but (as expected) fetches values for the first variant found. I want the table to change according to the variant selected from the combination of variant values.

The problem here is that I didn't find the selected variant_id as it is built dynamically in javascript (by evaluating attribute value selections).

  • Is there a way to get the variant_id (product_id in website_sale.js) exposed as a variable in qweb so that I can use:

<t t-foreach="variant_id.packaging_ids" t-as="packaging_id">

  • How can I auto-update the table when the variant changes?

 


Using Odoo Community V8 on OpenSuse 42.2

3
Avatar
Vazgeç
Pierre de Giorgio

I know this has been a long time, but I’m trying to do something similar and have asked the question but no one has answered. Were you ever able to solve this? If so could you share your solution with me?

Your help is greatly appreciated.

Avatar
Odonity - Smart Solutions for Smarter Business
En İyi Yanıt

https://apps.odoo.com/apps/modules/18.0/website_product_variant_dynamic_fields_odonity

0
Avatar
Vazgeç
Avatar
Natan
En İyi Yanıt

Remove the [0] from your loop to get information for all your variants.

If you only want to display information for the selected variant, there are two ways of doing so:


1) For beginning developers.

Use some jQuery to read the 'value' attribute from the input element '.product_id'. This updates automatically when the selection changes. 

Add 't-attf-class="{{packaging_id.id}}" ' to the table row. 

Hide all table rows, and then show the one which has the right class.

You do this both on page load, and on 'product_id' attribute change.


2) For more advanced developers.

Extend the product configurator script.

The product configurator fetches the combination when the selection changes and updates the DOM. Just include the table cells in the stuff that it updates.


P.S. I included a sample code for this earlier, but the forum is buggy so it didn't save.

0
Avatar
Vazgeç
Eric Mattingley

Kind sir, could you please return and reinstate your example code for method 1? (Also do you have to do anything to enable Jquery in the Qweb editor or is it enabled by default?)

Enjoying the discussion? Don't just read, join in!

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

Üye Ol
İlgili Gönderiler Cevaplar Görünümler Aktivite
Clean up Website Quotations Çözüldü
website website_sale
Avatar
Avatar
Avatar
2
Eyl 24
5145
Google Places Autocomplete
google website website_sale
Avatar
Avatar
Avatar
2
Eki 25
3820
Website Product Description
website website_sale odoo16EE
Avatar
Avatar
1
Ağu 25
1205
Can i remove the added extra price bubble for each variant in the ecommerce website?
variant ecommerce website
Avatar
Avatar
1
Kas 24
12888
Product Block on odoo website, hide the variant product
product variant website
Avatar
Avatar
2
Eki 24
1484
Topluluk
  • Eğitim Araçları
  • Dokümantasyon
  • Forum
Açık Kaynak
  • İndirin
  • Github
  • Runbot
  • Çeviriler
Hizmetler
  • Odoo.sh Hosting
  • Destek
  • Sürüm Yükseltme
  • Özel Geliştirmeler
  • Eğitim
  • Muhasebeci Bulun
  • Partner Bulun
  • Partner Olun
Hakkında
  • Şirketimiz
  • Pazarlama Gereçleri
  • İletişim
  • Kariyer
  • Etkinlikler
  • Podcast
  • Blog
  • Müşteriler
  • Hukuki • Gizlilik
  • Güvenlik
الْعَرَبيّة 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, müşteri ilişkileri yönetimi, eTicaret, muhasebe, envanter, satış noktası, proje yönetimi gibi şirketinizin tüm ihtiyaçlarını karşılayan bir açık kaynak işletme uygulamaları paketidir.

Odoo’nun eşsiz değer önermesi, aynı anda hem kullanımının çok kolay olup hem de tamamen entegre olmasıdır.

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