hyyan / woo-poly-integration

Looking for maintainers! - Wordpress WooCommerce Polylang Integration
https://wordpress.org/plugins-wp/woo-poly-integration/
MIT License
183 stars 66 forks source link

Fatal error: integration with Facebook and Gift Cards (?) #495

Closed MyjoyVera closed 4 years ago

MyjoyVera commented 4 years ago

Hi! Let's see if someone can help me, its the first time i write here and I have 0 idea of programing....

I'm using the PW Gift Card pluging in my store: myjoyvera.com But as you can try yourself, when you try to add some of the gift cards into your basket ( https://myjoyvera.es/producto/tarjetas-regalo/tarjeta-de-regalo/) It shows the following Fatal Error (see below), I contacted the PW Gift Card team but they said me that the problem is the "woo-poly-integration" pluging, so this is why I ask here.

This is the error:


Fatal error: Uncaught ArgumentCountError: Too few arguments to function WC_Facebookcommerce_EventsTracker::set_last_product_added_to_cart_upon_redirect(), 1 passed in /homepages/36/d818141585/htdocs/app818141610/wp-includes/class-wp-hook.php on line 287 and exactly 2 expected in /homepages/36/d818141585/htdocs/app818141610/wp-content/plugins/facebook-for-woocommerce/facebook-commerce-events-tracker.php:397 Stack trace: #0 /homepages/36/d818141585/htdocs/app818141610/wp-includes/class-wp-hook.php(287): WC_Facebookcommerce_EventsTracker->set_last_product_added_to_cart_upon_redirect('') #1 /homepages/36/d818141585/htdocs/app818141610/wp-includes/plugin.php(206): WP_Hook->apply_filters('', Array) #2 /homepages/36/d818141585/htdocs/app818141610/wp-content/plugins/woo-poly-integration/src/Hyyan/WPI/Cart.php(406): apply_filters('woocommerce_add...', '') #3 /homepages/36/d818141585/htdocs/app818141610/wp-includes/class-wp-hook.php(287): Hyyan\WPI\Cart->addToCartHandlerVariable('') #4 /homepages/36/d818141585/htdocs/app818141610/w in /homepages/36/d818141585/htdocs/app818141610/wp-content/plugins/facebook-for-woocommerce/facebook-commerce-events-tracker.php on line 397


I have no idea why, can you give me some solution? thanks

Jon007 commented 4 years ago

Hi, this plugin only provides a compatibility layer between the WooCommerce plugin itself and Polylang:

Also when raising an issue please provide all the information requested on the template.

However, looking at your error log there, I can confirm that I am about to remove the function where the error seems to be happening - Hyyan\WPI\Cart->addToCartHandlerVariable and have left some instructions for temporarily commenting it out on issue #502 please check that issue

Jon007 commented 4 years ago

noted that on https://wordpress.org/support/topic/error-when-i-add-the-product-to-the-cart-2/ additional information is provided showing that two arguments should now be passed to apply_filters( 'woocommerce_add_to_cart_redirect', $url, $adding_to_cart ) nonetheless removing the code may be an even better solution