Conflict with WooCommerce Attribute Swatches by Iconic
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 pleaseIf 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.
Quote from Faisal on October 4, 2020, 12:11Hi,
We identified a conflict with WOOCS and WooCommerce Attribute Swatches by Iconic
We know for sure the issue is due to it because:
- Disabling Iconic plugin or WOOCS solves the issue
- Commenting out a line of code on Iconic plugin solves the issue
The issue is:
- When adding products to cart that have an Iconic Attribute variation
- The product price increases by 319% on the cart and checkout
Example here:
https://staging-antm2019us.kinsta.cloud/product/canary-yellow-iphone-x-xs-case/
Price of product: RM 209.65
Adding it to cart: RM 879.06
Screenshot: https://imgur.com/a/umgFizL
Note: the issue might only be happening when the currency must be converted (ex: for MYR geo location, not sure for USD)
Identified the issue is happening on inc/class-fees.php function calculate_totals
Commenting out the returning of the cart details with price partially solves it
The price then is no longer 319% more, however the cart uses currency conversion on the price instead of using the product price we set in the admin panel for MYR
Thank you
Hi,
We identified a conflict with WOOCS and WooCommerce Attribute Swatches by Iconic
We know for sure the issue is due to it because:
- Disabling Iconic plugin or WOOCS solves the issue
- Commenting out a line of code on Iconic plugin solves the issue
The issue is:
- When adding products to cart that have an Iconic Attribute variation
- The product price increases by 319% on the cart and checkout
Example here:
https://staging-antm2019us.kinsta.cloud/product/canary-yellow-iphone-x-xs-case/
Price of product: RM 209.65
Adding it to cart: RM 879.06
Screenshot: https://imgur.com/a/umgFizL
Note: the issue might only be happening when the currency must be converted (ex: for MYR geo location, not sure for USD)
Identified the issue is happening on inc/class-fees.php function calculate_totals
Commenting out the returning of the cart details with price partially solves it
The price then is no longer 319% more, however the cart uses currency conversion on the price instead of using the product price we set in the admin panel for MYR
Thank you
Quote from Faisal on October 4, 2020, 12:55"
Commenting out the returning of the cart details with price partially solves it
The price then is no longer 319% more, however the cart uses currency conversion on the price instead of using the product price we set in the admin panel for MYR"
Found out that this is due to another conflict with this plugin:
WooCommerce Gravity Forms Product Add-Ons
Again even though we are not using an add-on price on the form, with this plugin activate -- WOOCS converts the product price instead of using the fixed price rule we gave it
At this point I am not sure which part of this plugin is causing the conflict, commenting out the only ->set_price doesn't fix it
"
Commenting out the returning of the cart details with price partially solves it
The price then is no longer 319% more, however the cart uses currency conversion on the price instead of using the product price we set in the admin panel for MYR"
Found out that this is due to another conflict with this plugin:
WooCommerce Gravity Forms Product Add-Ons
Again even though we are not using an add-on price on the form, with this plugin activate -- WOOCS converts the product price instead of using the fixed price rule we gave it
At this point I am not sure which part of this plugin is causing the conflict, commenting out the only ->set_price doesn't fix it
Quote from Pablo Borysenco on October 5, 2020, 11:39Hello
Read this please - https://currency-switcher.com/woocs-labs/
Hello
Read this please - https://currency-switcher.com/woocs-labs/
Quote from Faisal on October 7, 2020, 10:30Hi Pablo,
Thanks for sharing and yes we read it before since we submitted bugs here before
Please let me know if I missed anything in my post
We are in touch with both ICONIC and Gravity Forms Products Addon plugin authors about this conflict
ICONIC is still looking into it
Gravity Forms addon replied:
Currency conversion happens outside of the extension. Gravity Forms Product addons simply adjusts the cart item price using the following code. This is the same method that any extension which adjusts a cart item price would use, since it's a core WooCommerce API call.$total = apply_filters( 'woocommerce_gforms_get_cart_item_total', $total, $cart_item ); if ( apply_filters( 'woocommerce_gforms_product_price_context', 'edit', $cart_item, $gravity_form_data, $lead ) == 'view' ) { $price = $cart_item['data']->get_price(); } else { //Don't filter the price by default. $price = $cart_item['data']->get_price( 'edit' ); } $price += (float) $total; $cart_item['data']->set_price( $price );You might need to ask the currency conversion team if they can convert the Gravity Forms total that is being added to the cart using the woocommerce_gforms_get_cart_item_total filter you can see in that function. Another test you could run is to add the broken forms to a regular post or page and submit some entries. Validation that you are receive the correct prices in the entries in each of the different currencies / languages you have configured.Please help us look into itClearly there is an issue with set_price because both plugins that are using it are causing this issueWe need your help here because this online store is live and its causing issues for usI have put login details in the private sectionThank you
Hi Pablo,
Thanks for sharing and yes we read it before since we submitted bugs here before
Please let me know if I missed anything in my post
We are in touch with both ICONIC and Gravity Forms Products Addon plugin authors about this conflict
ICONIC is still looking into it
Gravity Forms addon replied:
Currency conversion happens outside of the extension. Gravity Forms Product addons simply adjusts the cart item price using the following code. This is the same method that any extension which adjusts a cart item price would use, since it's a core WooCommerce API call.
$total = apply_filters( 'woocommerce_gforms_get_cart_item_total', $total, $cart_item ); if ( apply_filters( 'woocommerce_gforms_product_price_context', 'edit', $cart_item, $gravity_form_data, $lead ) == 'view' ) { $price = $cart_item['data']->get_price(); } else { //Don't filter the price by default. $price = $cart_item['data']->get_price( 'edit' ); } $price += (float) $total; $cart_item['data']->set_price( $price );You might need to ask the currency conversion team if they can convert the Gravity Forms total that is being added to the cart using the woocommerce_gforms_get_cart_item_total filter you can see in that function. Another test you could run is to add the broken forms to a regular post or page and submit some entries. Validation that you are receive the correct prices in the entries in each of the different currencies / languages you have configured.
Quote from Pablo Borysenco on October 7, 2020, 12:40Hello
To test please delete this code - https://c2n.me/49lEv5p.png
https://c2n.me/49lEDcv.png - this function can call a re-conversion. During price changes and during display in the cart
Hello
To test please delete this code - https://c2n.me/49lEv5p.png
https://c2n.me/49lEDcv.png - this function can call a re-conversion. During price changes and during display in the cart
Quote from Faisal on October 7, 2020, 12:47Hi Pablo,
Thanks for sharing
How about the issue with ICONIC plugin?
"
Identified the issue is happening on inc/class-fees.php function calculate_totals, line with set_price
Commenting out the returning of the cart details with price partially solves it"
We can't comment that line out permanately because its needed, what can we do about it?
Hi Pablo,
Thanks for sharing
How about the issue with ICONIC plugin?
"
Identified the issue is happening on inc/class-fees.php function calculate_totals, line with set_price
Commenting out the returning of the cart details with price partially solves it"
We can't comment that line out permanately because its needed, what can we do about it?
Quote from Faisal on October 7, 2020, 13:06BTW I want to share that we had all 3 plugins (WOOCS, ICONIC and gravity forms addons) for a long time now and there were never any issues
We are not sure which update caused the issues recently
Thanks
BTW I want to share that we had all 3 plugins (WOOCS, ICONIC and gravity forms addons) for a long time now and there were never any issues
We are not sure which update caused the issues recently
Thanks
Quote from Faisal on October 8, 2020, 07:32Good news -- ICONIC plugin author fixed their plugin conflict with WOOCS
Now waiting for response from Gravity Forms based on your comment
THanks
Good news -- ICONIC plugin author fixed their plugin conflict with WOOCS
Now waiting for response from Gravity Forms based on your comment
THanks
Quote from Faisal on October 8, 2020, 09:28@Pablo
Gravity forms replied to your comment:
"That is incorrect. Calling $product->get_price('edit') does not call any pricing filters, that is why we go out of our way in that particular section of code to be sure to do that unless the user uses the filter to force the price to be filtered first. "
What can we do about it?
Thanks
@Pablo
Gravity forms replied to your comment:
"That is incorrect. Calling $product->get_price('edit') does not call any pricing filters, that is why we go out of our way in that particular section of code to be sure to do that unless the user uses the filter to force the price to be filtered first. "
What can we do about it?
Thanks
Quote from Pablo Borysenco on October 8, 2020, 11:10Hello
Add in functions.php
add_filter( 'woocommerce_gforms_product_price_context', function($edit, $cart_item, $gravity_form_data, $lead){ return 'edit'; },99,4);
Hello
Add in functions.php
add_filter( 'woocommerce_gforms_product_price_context', function($edit, $cart_item, $gravity_form_data, $lead){
return 'edit';
},99,4);Quote from Faisal on October 8, 2020, 11:57With this code the add to cart stops working, doesn't add a product to cart
With this code the add to cart stops working, doesn't add a product to cart
Quote from Faisal on October 8, 2020, 12:01Not sure if this helps but check these out, showing the issue coming from Gravity Forms code adjusting the price
https://secure.webmedic.com/LHxzlK
https://secure.webmedic.com/LoprZQ
Notice the highlighted item in screenshot 1 and the price in cart in screenshot 2 vs actual product price in screenshot 1
Thanks
Not sure if this helps but check these out, showing the issue coming from Gravity Forms code adjusting the price
https://secure.webmedic.com/LHxzlK
https://secure.webmedic.com/LoprZQ
Notice the highlighted item in screenshot 1 and the price in cart in screenshot 2 vs actual product price in screenshot 1
Thanks
Quote from Pablo Borysenco on October 9, 2020, 12:00Hello
With this code the add to cart stops working, doesn't add a product to cart - install error log monitor - https://wordpress.org/plugins/error-log-monitor/ and check PHP errors
Hello
With this code the add to cart stops working, doesn't add a product to cart - install error log monitor - https://wordpress.org/plugins/error-log-monitor/ and check PHP errors
Quote from Faisal on October 9, 2020, 13:00Hi Pablo,
Great, we found this error:
Fatal error: Uncaught Error: Call to undefined function gravity_form_enqueue_scripts() in /www/antm2019us_774/public/wp-content/plugins/woocommerce-gravityforms-product-addons/gravityforms-product-addons-main.php:321
Shared it with the plugin author and will update you on it
Thank you
Hi Pablo,
Great, we found this error:
Fatal error: Uncaught Error: Call to undefined function gravity_form_enqueue_scripts() in /www/antm2019us_774/public/wp-content/plugins/woocommerce-gravityforms-product-addons/gravityforms-product-addons-main.php:321
Shared it with the plugin author and will update you on it
Thank you
Quote from Pablo Borysenco on October 12, 2020, 10:16Hello
This error only applies to a third party plugin
Hello
This error only applies to a third party plugin