• Resolved pstidsen

    (@pstidsen)


    Hi there,

    I have multiple currencies on my Woocommerce store. The different currencies are provided through WPML.

    However, at the translated pages the price and currency is mixed up. The price is converted to another currency, but the currency value is still the default shop value.

    Can I apply a filter in order to change the currency value for the translated pages?

    Best Regards,
    Peter

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter pstidsen

    (@pstidsen)

    I found your dev docs and saw it was pretty easy. Solution below.

    function product_callback($product){	
    if (is_norwegian_translation()){
    $product['offers']['priceCurrency'] = 'NOK';
    }

    return $product;
    }
    add_filter('saswp_modify_product_schema_output', 'product_callback');

    function is_norwegian_translation(){
    $current_language = apply_filters('wpml_current_language', NULL);

    if ($current_language == 'no'){
    return true;
    } else{
    return false;
    }
    }
    Plugin Author Magazine3

    (@magazine3)

    Hi, thank you for reaching out to us. We’re glad to hear you found a solution to your concern. We’re marking this thread as closed for now, but let us know if you need any further assistance.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.