Skip Navigation

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 68 replies, has 3 voices.

Last updated by Andreas W. 4 years ago.

Assisted by: Andreas W..

Author Posts
March 14, 2020 at 12:25 am #5683917

Andreas W.
Supporter

Languages: English (English ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

Our compatibility team for Gravity Form Multilingual is currently working on another issue that needs to be solved before they are able to check the issue with the conditional logic issue in your ticket.

Further, we are glad that you found a fix but our team will need to review this solution and test in somehow they can achieve a solution that might affect other plugins negatively.

For now, please proceed with the fix that you suggested and let us know if you run into further issues. I will keep you updated and ask you for some patience on this matter.

Kind regards
Andreas

March 16, 2020 at 4:25 pm #5695063

simoneP-19

Ok Andreas,
keep me posted.

March 17, 2020 at 3:34 am #5697801

Andreas W.
Supporter

Languages: English (English ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hi!

Until now I did not receive any further which I would kindly like to ask you for some patience.

As soon as I know more about the issue I will be in contact.

Kind regards
Andreas

March 24, 2020 at 4:00 pm #5752725

simoneP-19

Since my renewal is two day away, i would love to hear some news. Even for tangible proof that someone is working on this problem.

March 24, 2020 at 5:30 pm #5753303

Andreas W.
Supporter

Languages: English (English ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

I am sorry to hear that.

Are you considering not to use WPML due to this issue? I have contacted our compatibility team again and problem is that this issue relies on solving another issue that is still in progress.

This is why I would kindly like to ask you for some more patience. Our developers are very concerned about fixing this the fastest way possible.

In case I will receive a workaround, that we could apply as a temporary fix, I will be in contact.

Kind regards
Andreas

March 26, 2020 at 8:48 am #5766843

Igor

Dear Simone,

As a developer to whom the problem was escalated, I have found the fix. Please use the file by the link (hidden link) and put it into `/wp-content/mu-plugins` folder. Or, you can add content of the file (without opening `<?php` tag, to your theme's `functions.php` file).

We will add this fix to the next release of Gravity Forms Multilingual.

March 26, 2020 at 10:04 am #5767709

simoneP-19

adding it to the mu-folder or adding the code to the theme's functions create a critical error on the site.

March 26, 2020 at 11:19 am #5768527

Igor

Please share the error message from debug.log here.

Also, please make sure that you have installed and activated: WPML, String Translation, Translation Management, WooCommerce, WooCommerce Multilingual, Gravity Forms, WooCommerce Gravity Forms Product Add-Ons, Gravity Forms Multilingual.

I think problem is in that you don't have WooCommerce Multilingual installed. I have updated the file by the link to avoid fatal error in this case.

March 26, 2020 at 3:47 pm #5771467

simoneP-19

nope, i have all the plugin installed and activated. And even with the new versione i get critical error.

March 26, 2020 at 4:17 pm #5771813

Igor

To help, I have to see error message from the debug.log. Please let me know.

March 27, 2020 at 1:10 am #5774469

Andreas W.
Supporter

Languages: English (English ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

Our developers have provided a fix for the issue with Gravity Forms. It will be included in the next plugin update for Gravity Forms Multilingual.

In the meantime please add the following file into the folder:

wp-content/mu-plugins/

File source: hidden link

Alternatively, you can add the following code to your theme's functions.php file instead of using the fix.php file:

/**
 * @return bool
 */
function woocommerce_gforms_use_ajax_filter() {
	return true;
}

add_filter( 'woocommerce_gforms_use_ajax', 'woocommerce_gforms_use_ajax_filter' );


/**
 * @param string $price_to_filter
 * @param WC_Product $product_data
 *
 * @return bool|float
 */
function woocommerce_gform_price_filter( $price_to_filter, $product_data ) {
	global $woocommerce_wpml;

	$gform_total  = isset( $_POST['gform_total'] ) ? $_POST['gform_total'] : 0;

	$discount_price        = false;
	$gforms_discount_price = false;
	$base_price            = wc_get_price_to_display( $product_data, array( 'price' => $product_data->get_price( 'edit' ) ) );

	if ( class_exists( 'WC_Dynamic_Pricing' ) ) {
		$working_price   = $base_price;
		$dynamic_pricing = WC_Dynamic_Pricing::instance();
		foreach ( $dynamic_pricing->modules as $module ) {
			if ( $module->module_type == 'simple' ) {
				//Make sure we are using the price that was just discounted.
				$working_price = $discount_price ? $discount_price : $base_price;
				$working_price = $module->get_product_working_price( $working_price, $product_data );
				if ( floatval( $working_price ) ) {
					$discount_price = $module->get_discounted_price_for_shop( $product_data, $working_price );
				}
			}
		}

		$gforms_base_price    = $base_price + $gform_total;
		$gforms_working_price = $base_price + $gform_total;
		foreach ( $dynamic_pricing->modules as $module ) {
			if ( $module->module_type == 'simple' ) {
				//Make sure we are using the price that was just discounted.
				$gforms_working_price = $gforms_discount_price ? $gforms_discount_price : $gforms_base_price;
				$gforms_working_price = $module->get_product_working_price( $gforms_working_price, $product_data );
				if ( floatval( $gforms_working_price ) ) {
					$gforms_discount_price = $module->get_discounted_price_for_shop( $product_data, $gforms_working_price, $gform_total );
				}
			}
		}
	}

	$price             = $discount_price ? $discount_price : $base_price;
	$gform_final_total = $gforms_discount_price ? $gforms_discount_price : $price + $gform_total;

	switch ( current_filter() ) {
		case 'woocommerce_gform_base_price':
			$price_to_convert = $price;
			break;
		case 'woocommerce_gform_total_price':
			$price_to_convert = $gform_final_total;
			break;
		case 'woocommerce_gform_variation_total_price':
			$price_to_convert = $gform_total;
			break;
		default:
			return $price_to_filter;
	}

	return $woocommerce_wpml->multi_currency->prices->formatted_price(
		$price_to_convert, $woocommerce_wpml->multi_currency->get_client_currency()
	);
}

add_filter( 'woocommerce_gform_base_price', 'woocommerce_gform_price_filter', 10, 2 );
add_filter( 'woocommerce_gform_total_price', 'woocommerce_gform_price_filter', 10, 2 );
add_filter( 'woocommerce_gform_variation_total_price', 'woocommerce_gform_price_filter', 10, 2 );

Let me know if you need further assistance.

Kind regards,
Andreas

March 27, 2020 at 1:31 pm #5779955

simoneP-19

Sorry but this doesn't works for me.
i still get Notice: Undefined offset: 101 in C:\xampp\htdocs\fineartprinted\wp-content\plugins\gravityforms-multilingual\classes\class-gfml-conditional-logic.php on line 27
and still does not works.

March 27, 2020 at 1:59 pm #5780095

simoneP-19

i have the log file please enable the private post so i can upload it

March 28, 2020 at 2:28 am #5783435

Andreas W.
Supporter

Languages: English (English ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

My apologies for the dealy in answering.

I did sadly not find the time yesterday to test the provided fix but indeed I see the same issue on my test site.

The developer has been contacted and I will be in contact once I received more feedback.

Kind regards
Andreas

March 30, 2020 at 8:57 pm #5799161

Andreas W.
Supporter

Languages: English (English ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

I hope you are doing well?

Thank you very much for your patience while we have been looking into the issue with Gravity Forms Multilingual in regard to the use of conditional logic in Gravity Forms.

I have just left you a private message and need your assistance for a few minutes.

Kind regards
Andreas

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.