Add to Cart Form in Views Not Displaying Product Prices for Variations

Created on 13 July 2024, 4 months ago
Updated 5 August 2024, 4 months ago

I'm encountering a problem with the "Add to Cart" form formatter in Views when dealing with product attributes.

I have two product sizes: 250ML and 500ML. I've added the "Add to Cart" form to certain pages using Views, but the product price does not appear as it normally does on the standard product page. On the standard product page, it appears over the variation attribute and the price dynamically updates with Ajax when the user selects either the 250ML or 500ML option. However, this functionality seems to be missing when using the form added through Views.

Has anyone else experienced this issue? Is this a bug, or is it the intended behavior of the module?

💬 Support request
Status

Fixed

Version

2.39

Component

Developer experience

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @eit2103
  • Am I really the only person facing with this problem?

    If Add to cart form Formatter in views included price, I would not have any issues right now.

    <div class="product--variation-field--variation_price__13 field field--name-price field--type-commerce-price field--label-above">
        <div class="field__label">Fiyat</div>
                  <div class="field__item">₺6,00</div>
              </div>
  • Status changed to Fixed 4 months ago
  • 🇮🇱Israel jsacksick

    The variation field injection is performed by the ProductViewBuilder. In another words, this logic kicks in only when products are rendered (in any view mode).

    So, this can be triggered if you're rendering products in any view mode using Views. This is NOT triggered if you're rendering fields and simply rendering variations using the add to cart form formatter.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024