[Solved] Price for product variations with same price not displayed with Add to Cart Form

Hi there,

Problem: when all product variations have the same price, the price is not displayed using the add to cart form element (screenshot 1).

Setup: I’m using a WC Single Layout. Everything else – simple product, product variations with different prices – works. I noticed that on a vanilla Woocommerce install the price for variations (when they all have the same price) is outputted differently, namely at the top (screenshot 2)

Unfortunately I’m working on a local environment so screenshot will have to do for now.

Posible solution: If there’s a way to conditionally show the element ‘product price’ only when all product variation prices are the same, that would solve my problem. But as far as I know, that’s not possible.

Many thanks in advance!

Screenshot 1

Screenshot 2

Hi @Dagaloni,

It will be very difficult to recognize the problem you are having, as it can’t be replicated in my local environment. I would suggest you upload the files to a server and please provide login credentials for your site in a secure note to examine it further, including:

– WordPress Site URL & Login URL
– WordPress Admin username/password

To create a secure note, click the key icon underneath any of your posts.

Thanks

Thanks for the reply!

Are you sure you have the correct setup? I tested it on three different sites and it’s working on none of them.

Steps to reproduce:

  1. Make a variable product
  2. Create variations and give each variation the same price
  3. Create a WC Single layout using the add to cart form element
  4. View frontend and select a variation. There’s no price.

I have ported it to a live site.

Hi @Dagaloni,

Thanks for explaining the steps here, and I am able to replicate it in my local environment by following those. I suspect this could be a bug on the latest version theme and have reported it to the developers for further investigation.

Thanks

Thank you! I’m glad you could replicate the issue. I’m looking forward to a fix.

Do you have a quick fix in the mean time?

Hello @Dagaloni,

Regretfully there is no quick fix at the moment, we have already reported the issue and the issue is in our issue tracker for our development team. There is no ETA at the moment so I would request you, please stay tuned for succeeding theme updates.

Thanks for understanding

Hi @Dagaloni,

After adding this to our issue tracker, I have investigated it more and found that is a normal way of showing the Price of the variable product. I would suggest you use the default layout with the Pro and use any other default theme like TwentyTwenty and will find the same. It shows the price just under the Product Title, I would suggest you use {{dc:woocommerce:product_price_html}} to get the price for the variable products.

With different prices:

Screenshot 2021-12-15 201826

With the same prices:

V-Neck T-Shirt (Copy) _ Pro

Hope it helps.
Thanks

Thank you very much!

That makes sense. I did a little experimenting and I found one case were you can’t replicate the original Woocommerce design. When you have a page calling {{dc:woocommerce:product_price_html}} and the product is variable with different prices, you’ll end up with the price range shown by the DC and the price shown by the add to cart form element.

Not shocking, but I though I would let you know so maybe you can use this feedback to further polish the elements.

Thank you for investigating and the explanation!

Cheers

Hi @Dagaloni,

Glad that we are able to help you.

Thanks

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.