fbpx
Want To Add Extra Images Per Product Variation For Free? Download Now

Unit price gets replaced by default price

Dear support team,

after a recent update, the unit price of products with variations are getting replaced by the default price after the website has finished loading, as you can see on the first screenshot. This is only the case on product archive pages, while the output on single product works fine. Products without variations are also working fine on product archive pages. You can see the problem here: https://www.dietrex.de/shop/

I already tried to set the new option “Archive variation threshold” to 5, but then the unit price isn’t visible at all (means it maybe got initially replaced). Perhaps there is an incompatibility with “Woocommerce Germanized”, but it was working before updating the website for sure.

Please have a look at this, since showing prices without unit price is not legal in germany. If you need any more information, let me know.

Kind regards,
Johann

"wc-unit-price-replaced.jpeg""wc-unit-price-correct.jpeg"

Hakik Zaman

Hi Johann,

Thanks for reaching out to us. Please overwrite the template price-unit.php inside your child theme, here is the path:

woocommerce-germanized > templates > loop >price-unit.php

Change the following:

<p class="price price-unit smaller wc-gzd-additional-info wc-gzd-additional-info-loop"><?php echo wp_kses_post( wc_gzd_get_product( $product )->get_unit_price_html() ); ?></p>

Like this:

<p class="price-unit smaller wc-gzd-additional-info wc-gzd-additional-info-loop"><?php echo wp_kses_post( wc_gzd_get_product( $product )->get_unit_price_html() ); ?></p>

Basically, the class name is the same, and our plugin push variation price while you select variations on the archive page. We push variation prices for the .price class which is also used by the Gemanized for WooCommerce plugin.

I hope the above steps will help you to resolve this issue.

Thank You

Hi and thank you for your quick reply. The unit price is working again now, but the change results in another error:

Switching to another variation doesn’t change the unit price to the according unit price – it remains on the initial value, as you can see here: https://www.dietrex.de/shop/. It seems that Germanized changes the unit price based on the now missing class “price”?

Further, I’m not feeling comfortable overwriting template files of plugins if not really necessary, since I need to keep outdated files over a long time, which will result sooner or later in other conflicts.

Isn’t it possible to add a fix/option for Woocommerce Germanized users? It should be no problem to NOT select the first price child with Javascript, as I did hardcoded before I used your plugin.

Kind regards,
Johann

Hakik Zaman

Hi Johann,

I am not ensuring that an option will be added for the Germized for WooCommerce plugin. But, I can send this request to our development team.

Do you have a staging site with the same setup? If not, we can also give you a staging site.

Please let me know your thoughts.

Thank You

Hi Hakik,

thank you. This problem should be resolved, because the wrong unit price is as illegal as no unit price here in germany. I will wait until I need to renew the license. If there is no fix until then, I will go back to my hardcoded function. The reason I abandoned this was the same reason I have now with your plugin: I have to override template files. I was very happy to find a working plugin, but it seems that I was happy too soon.

I don’t have a staging site, but could set up one. What is that supposed to be good for?

Kind regards,
Johann

Hakik Zaman

Hi Johann,

It’s a staging site, please login here and reproduce your issue here.

https://wptestbox.com/germanized/wp-admin/

Username: admin

Password: demo

Please let me know after replicating the issue. For your convenience, I have added sample products and some necessary plugins for you.

Thank You

Hi Hakik,

thank you for providing the staging website. You can reproduce the bug on shop archive page for the product “Hoodie” now: https://wptestbox.com/germanized/shop/

Refresh the page and see how the unit price (15.00$ / 100 ml) gets replaced by the price range ($42.00 – $45.00) after the page has finished loading. As mentioned before, removing the price class from unit-price.php leads to a not updating unit price when switching to another variant.

I’m wondering why no one else has complained about this behavior. I’m pretty sure, that I am not the only one from Europe, who uses your plugin.

Kind regards,
Johann

Hi Hakik,

the problem still persists after updating to 2.0.20. I hoped that this update fixed this issue with Woocommerce Germanized. You could just check if Germanized is installed to select the right price child element, or add an option in settings for Germanized users.

My client complains almost every day why this is still not working after several updates. Please investigate this problem as soon as possible, since your workaround by editing files is not working anymore.

Kind regards,
Johann

Hakik Zaman

Hi Johann,

I have sent the request to our development team. They have looked into this but couldn’t find a solution which will work for all.

It should be no problem to NOT select the first price child with Javascript, as I did hardcoded before I used your plugin.

It is difficult for us to identify which plugin will keep the basic price at the first and which will keep it second. So, we need some time to think. Because before adding any feature or compatibility we have to think about all the other plugins as well.

Thank You

Thank you for your reply.

Woocommerce Germanized has about 100k installations as it is necessary in europe. It would be worth to add a checkbox like “Woocommerce Germanized” support, to satisfy a lot of those users. Like that, you don’t have to identify other plugins and can take your time to investigate other possible global solutions in the meantime.

I wouldn’t bother that much if your plugin never has worked in past in combination with Germanized, but as already mentioned, I was very happy to find a working plugin and willed to buy. I don’t know why or where the incompatibility started, but there should be a way “back”.

If not, I really would appreciate a “handmade” solution or a working hardcoded fix, but your fix some messages ago didn’t work anymore.

Kind regards,
Johann

Hakik Zaman

Hi Johann,

Please update to 2.0.21 and check whether it resolves your issue or not.

Looking forward to hearing from you soon.

Thank You

Johann Schuster

Hello Hakik,

Thank you very much for providing an update. I just updated to 2.0.21, but the unit price is still not changing after selecting another variant as you can see here on first two products: https://www.dietrex.de/shop/. Are there any new settings I have to adjust after update?

Kind regards,
Johann

Hakik Zaman

Hi Johann,

As far as I know, you have reported prices are changing also for the germanized price you displayed on the shop/archive page.

Is it not fixed? You can check it here: https://wptestbox.com/germanized/shop/

The staging site is still available to you. Is it still changing the Germanized price?

Thank You

Johann Schuster

That was the case in my inital post, which has been fixed. Please take a look at my comment number 358753:

Hi and thank you for your quick reply. The unit price is working again now, but the change results in another error:

Switching to another variation doesn’t change the unit price to the according unit price – it remains on the initial value, as you can see here: https://www.dietrex.de/shop/. It seems that Germanized changes the unit price based on the now missing class “price”?……

The unit price doesn’t update if you switch to another variant. For example, the unit price for “Bio Ahornsirup Grad A” 250ML has a unit price of 3,04€, while the 1000ML variant has a unit price of 2,70€. And this price remains the same after clicking a variant (marked red):

On your staging website, it didn’t change too and shows instead a range of unit prices (please have a look at the “Hoodie” product on archive page). I guess this has to do with the lack of a Germanized Pro feature on your staging.

Hakik Zaman

Hi Johann,

Unfortunately, we have no access to change/add anything from the Germanized plugin.

The unit price is changing based on a script from the Germanized plugin. If you check the scripts you can check a js file is loaded on the single product page: ‘wc-gzd-unit-price-observer-js’. Please check this screenshot: https://paste.pics/OCY7L

But on the archive page that file is not loaded: https://paste.pics/OCY8B

They have no codebase for the archive/shop page. They added support for the single product page only.

So, you should contact the Gemanized plugin to be compatible with us. I hope I could clear up your confusion.

Thank You