Support » Plugin: WooCommerce Multilingual - run WooCommerce with WPML » Related & Cross-sells not working in WooCommerce

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author David Garcia Watkins

    (@dgwatkins)

    I have tried this using WooCommerce 2.0.5 and the development version of WooCommerce multilingual and its working correctly.

    Can you check that you have the latest versions installed? If you want to try a development version, you can download it from the “developers” tab.

    Hi David.
    Thanks for helping out.
    That is weird!
    I am using WordPress 3.5.1, WooCOmmerce 2.0.5, WPML 2.7.1 and WooCommerce Multilingual 2.0. I have now tested it with WooCommerce Multilingual 2.1 as well. I still get no results. I have testet it with different themes and uninstalled all plugins except WooCommerce, WooCommerce Multilingual, and WPML.

    No luck.

    I have then tried to find where the problem was and I ended up in this function search_products() in woocommerce_wpml.class. This does not return the current language $sitepress->get_current_language(), so this runs on all found unset($found_products[$product_id]);

    Does this make any sense to you?

    Thanks
    Vayu

    Plugin Author David Garcia Watkins

    (@dgwatkins)

    Yes, I know. I’ve looked at $sitepress->get_current_language() and it works ok here.

    Do you also have Translation Management and String Translation enabled?

    Yes, they are both enabled and are running latest version. I wonder why $sitepress->get_current_language() returns nothing on this site…

    Would it be alright to remove the filter in my theme functions.php?
    remove_filter(‘woocommerce_json_search_found_products’, ‘search_products’);
    It works when I do that.

    What would the consequences of that be?

    Plugin Author David Garcia Watkins

    (@dgwatkins)

    You would get to choose from products in all languages.

    Can you try changing the priority to 12 on line 8 so it reads:
    add_action(‘plugins_loaded’, array($this, ‘init’), 12);

    I should try myself first, but its working here.

    Hi David.
    Thanks for your suggestion. I have actually already tried this and it doesn’t work.

    I give up and will just unhook the search_products filter. It’s better to have all rather not than not having any search results.

    I really appreciate your help and guess that it must be something on my setup, that is no interfering.

    Thanks
    Vayu

    This is how I unhooked the filter in my theme functions.php file:

    add_action( 'init', 'remove_search_products', 10 );
    function remove_search_products() {
    	remove_filter('woocommerce_json_search_found_products', array($GLOBALS['woocommerce_wpml'],'search_products'), 10);
    }
    Plugin Author David Garcia Watkins

    (@dgwatkins)

    Hi Vayu,

    Thanks for sharing your solution, if you want to investigate this issue further you can post a topic at wpml.org support forums. We can share login information and debug the issue further.

    Best,
    David

    Plugin Author David Garcia Watkins

    (@dgwatkins)

    I’m marking this topic as resolved because the problem was solved 8 months ago.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Related & Cross-sells not working in WooCommerce’ is closed to new replies.