Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
873 Visualizzazioni

I have built a web store and among others I have a products in 3 packaging variants (1 pack, 2 packs and 3 packs). The item is "exposed" among others with 4 positions width. The product is shown also on homepage and it shows a price for 1 pack and that's OK or acceptable, if I click on product it will show 1 pack first and that's OK, but when i check all products in the store (all products category) it shows price for 3 pack and I will prefer that at least 1 pack version price would be displayed.

  1. Please visit https://www.zalinkoticek.si and SHINE BROWN product price is OK, is price for 1 pack.
  2. If I click on the products and visit product page https://www.zalinkoticek.si/shop/shine-brown-krema-za-porjavitev-290#attribute_values=22 on the bottom is a price for 1 pack... and that's OK.
  3. But if I visit a store page https://www.zalinkoticek.si/shop you can see SHINE BROWN extended, but the price is for 3 pack.

With all 3 above cases would be the best if I could display price like "from xx,xx€/pc", but if it is not possible a price for 1 pack in 3. case is just OK solution.


Many thanks in advance,

Matej

Avatar
Abbandona
Risposta migliore

Hi Matej,

What you are seeing is expected behavior in Odoo’s eCommerce: when a product has multiple variants, the web shop sometimes displays the price of the cheapest variant (on homepage, single product page) and other times it takes the price of the default or last variant (in the “All products” grid view). That’s why you see the 3-pack price in your store page.

You have a couple of options:

1. Force the price of a specific variant (e.g. 1 pack) to always be shown

  • In the backend, go to the product → variants tab.
  • Set the 1-pack variant as the “default” one (first in the list).
  • In website_sale, the template website_sale.products_item uses the default variant when building the grid, so this ensures consistency.

2. Show “From XX €” (minimum variant price)

  • You can inherit the template website_sale.products_item and replace the variant price logic with product.min_variant_price.
  • Example in QWeb:

    <t t-if="product.has_variants"> <span class="oe_price">From <t t-esc="product.min_variant_price"/> €</span> </t> <t t-else=""> <span class="oe_price"><t t-esc="product.price"/> €</span> </t>

    That way, customers always see the entry price (1 pack).

3. Custom label “From xx,xx €/pc”

  • Similar to option 2, but add your own suffix €/pc to make it clear.

So the best practice:

  • If you want transparency → go with “From XX €/pc”.
  • If you want consistency with your product pages → set the 1-pack as default and force that variant’s price in the shop view.

Hope this helps!

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
1
ago 25
545
2
lug 25
784
2
giu 25
1374
1
mag 25
1395
2
mag 25
2623