PluginUs.Net - Business Tools for WooCommerce and WordPress

[realize your idea - make your dreams come true]

Support Forum

You need to log-in to create request (topic) to the support

Woocommerce Product Add-ons integration problem

The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday. If you have problems with registration ask help on contact us page please
If you not got email within 24~36 business hours, firstly check your spam box, and if no any email from the support there - back to the forum and read answer here. DO NOT ANSWER ON EMAILS [noreply@pluginus.net] FROM THE FORUM!! Emails are just for your info, all answers should be published only here.
The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday.

Hello,
I read your article"https://currency-switcher.com/woocommerce-product-add-ons" and implemented it. But I think this article belongs to an old"Wc. Add-ons" add-on. It doesn't work on the"Product" page and the"Order details" page. It only works on the"Cart" page.
What should I do?

Hello

In this case, you need to create a new adaptation request - https://currency-switcher.com/woocs-labs

Drop me  wp-admin+FTP  access  to your test site - https://share.pluginus.net/image/i20230222134241.png -> https://share.pluginus.net/image/i20230222134615.png

And I will add this third-party plugin to the adaptation queue

I followed the instructions at"https://currency-switcher.com/woocs-labs"

 

Thanks..

Hello

Great! I added the plugin to the adaptation queue

Thanks!

Hello

please  do a test

I added in  functions.php

add_filter( 'woocommerce_product_addons_option_price', function($price_html, $option, $i, $type){

if ($price_html && class_exists('WOOCS')) {
global $WOOCS;

$option_price = ! empty( $option['price'] ) ? $option['price'] : '';
$option_price_type = ! empty( $option['price_type'] ) ? $option['price_type'] : '';
$price_prefix = 0 < $option_price ? '+' : '';
$price_type = $option_price_type;
$price_raw = apply_filters( 'woocommerce_product_addons_option_price_raw', $option_price, $option );
$price_raw = $WOOCS->woocs_exchange_value($price_raw );
$price_html = '(' . $price_prefix . wc_price( WC_Product_Addons_Helper::get_product_addon_price_for_display( $price_raw ) ) . ')';

}

return $price_html;
}, 20, 4 );

Hello,
I ran a rough check and the problem seems to be resolved.

Have you applied any edits other than functions.php?

for example in the"woocommerce add-ons" resource files of the plugin.

I need to know this because if I update the problem will reappear.

Note;

When I have detailed control,
only the front-end side seems to have solved the problem.
The problem persists on the"wp-admin" side.

Ex. An additional piece costing $20 appears as $20 on the orders page.

 

 

Hello

Have you applied any edits other than functions.php? - No. Only this code and I did not touch the code from the article

. An additional piece costing $20 appears as $20 on the orders page - I  will check  it

Hello,
Are there any updates?

 

Thanks..

Hello

I will write to you as soon as there is a result

Hello,

Thank you for your response. I'm waiting.

Hello,
I just wanted to remind you that I'm still waiting on this issue. Probably many companies that have this plugin are encountering this problem.
Thanks. @pavlo_borysenco

Hello

Don't worry, we remember about your plugin, and we will write to you as soon as we solve the problem

I think the developer will do it today

please  do  a test

Hello,
Sorry for the delay. I have provided the checks and the problem seems to be completely resolved.

However, there is no change in the function file. I think you applied different regulations.

May I know what regulations you apply?

 

Thanks.. Regards.

Hello

In  file  - wp-content\plugins\woocommerce-product-addons\includes\class-wc-product-addons-cart.php  - add  code - https://c2n.me/4ilH77f.png

if (class_exists('WOOCS')) {
global $WOOCS;
$currrent = $WOOCS->current_currency;
if ($currrent != $WOOCS->default_currency AND $WOOCS->is_multiple_allowed) {
$currencies = $WOOCS->get_currencies();
$rate = $currencies[$currrent]['rate'];
$addon_price = $addon_price * $rate;
}
}

 

Hello,
I'm so sorry for getting back to you late.

Thank you very much for the solution!
I've almost done a lot of testing and there doesn't seem to be any other problems except for one problem.

The problem I identified is:
For a variant product for which no price has been entered, the product price is displayed as 0 units.

In fact, woocommerce does not allow the sale of products without a price entered. This is a good thing. But with this plugin, it looks like a unit of 0 TL, it can be added to the cart.
It looks just like a free product.

 

Hello

Please  read  this - https://currency-switcher.com/make-product-not-purchasable-avoid-free-price-text

Hello @pavlo_borysenco,
I looked at the solution you suggested. However, this is neither a professional solution nor a good solution to the problem.
We don't enter prices for some variations of products, but that doesn't mean it won't happen to all. We enter these prices according to stock status.

For example, let's assume that there are 6 variations of a product. Price entries may be made for 3 of these variations, the remaining 3 are left blank.

We need another solution to prevent the prices left blank from appearing as"0", that is,"free" at other exchange rates other than the main exchange rate.

Hello

Ok! I will pass it  to the developers