This thread is resolved. Here is a description of the problem and solution.
Problem:
If you're experiencing an issue where your shopping cart works fine when WPML is deactivated, but you encounter an error with WooCommerce Multilingual activated, it might be due to a compatibility problem with the OnSale Page for WooCommerce plugin.
Solution:
The error occurs in the
pre_get_posts
method within the OnSale Page for WooCommerce plugin. The plugin is passing a NULL value because it expects a non-NULL return which WPML does not provide. To fix this, you can modify the plugin's code as follows:
public function pre_get_posts( $q ) {<br />if(!$q->query)<br />return;<br />$onsale_page_id = $this->get_main_wpml_id(wc_get_page_id( 'onsale' ));<br />if($onsale_page_id != -1 && $onsale_page_id != NULL){
This is a temporary workaround. Since the plugin is not compatible with WPML, you can suggest that the plugin's authors join our Go Global Program to achieve compatibility. Alternatively, you can contact the plugin's support for a permanent solution.
If this solution doesn't seem relevant to your issue, please open a new support ticket in our support forum.
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 15 replies, has 2 voices.
Last updated by 1 year, 5 months ago.
Assisted by: Bruno Kos.