WPML

Overview of the Issue

When using YITH WooCommerce Dynamic Pricing & Discounts Premium with WPML and multi-currency enabled, AJAX actions may trigger incorrect behavior: gifts are not added to the cart in secondary currencies, and cart prices revert to the default currency.

Workaround

This issue is fixed. Updating to the latest version solves it on your site, so you only need this workaround if you can’t update yet.

Please, make sure of having a full site backup of your site before proceeding.

  • Add the following code to your theme’s functions.php file.
    // WPML Workaround for compsupp-8147 
    add_filter( 'wcml_load_multi_currency_in_ajax', 'add_action_to_multi_currency_ajax', 10, 1 );
    
    function add_action_to_multi_currency_ajax( $ajax_actions ) {
        $ywdpd_actions = array(
            'ywdpd_add_gift_to_cart',
            'ywdpd_add_bogo_to_cart',
            'ywdpd_add_special_to_cart',
            'ywdpd_add_last_deals',
            'ywdpd_check_variable',
            'ywdpd_valid_rule_in_checkout',
            'ywdpd_update_cart_after_payment_method',
        );
    
        return array_values( array_unique( array_merge( (array) $ajax_actions, $ywdpd_actions ) ) );
    }

Still Seeing This Issue?

If updating doesn’t fix it, ask a support question and we’ll look into it with you.

Ask a support question

All known issues