This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Support for WCML

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #13593
    JieJie
    Participant

    Hello,

    it seems the plugin is not compatible with WCML.

    I go to the advanced option and add the {titlefield} – {_price} to the title field. But I want it to show the multi prices in different languages (it only shows the price in original currency).

    Could you please make it possible? Or it does nothing to me.

    Thank you

    Jie

    #13603
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi,

    Thank you for the information!

    I’m not able to view the site, I’m getting an error page: “Your access to this site has been limited’
    Can you please check that?

    #13604
    JieJie
    Participant

    Thank you.

    Now it should be accessible.

    Regards

    Jie

    #13610
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Thank you!

    Can you please also check the FTP, I just tried to log-in, but I can only see an empty folder.

    #13613
    JieJie
    Participant

    You cannot access this content.

    #13623
    JieJie
    Participant

    Thank you.

    It works fine.

    #13624
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi!

    You are welcome. I’ve added a custom code to the functions.php file in your theme directory to make it work, please leave it there.I also had to modify the plugin code to recognize the current currency. I will make sure to add that modification to the upcoming release so you won’t have to worry about updates.

    For future reference, I leave the custom code here: https://gist.github.com/anag0/c26e263ab568fd4a790ce66ca522a384

    #13625
    JieJie
    Participant

    [code]add_filter(‘asp_results’, ‘asp_display_price_w_currency’, 10, 4);
    function asp_display_price_w_currency($results, $sid, $is_ajax, $args) {
    if ( empty($args[‘woo_currency’]) )
    return $results;
    global $woocommerce;
    global $sitepress;
    global $woocommerce_wpml;
    $currency = $args[‘woo_currency’]; // GET THIS FROM A PARAM

    foreach ($results as $k=>&$r) {
    if ( isset($r->post_type) &&
    in_array($r->post_type, array(‘product’, ‘product_variation’))
    ) {
    $p = wc_get_product( $r->id );
    $price = $woocommerce_wpml->multi_currency->prices->get_product_price_in_currency( $r->id, $currency );
    $r->title .= ‘ – ‘ . wc_price($price, array(‘currency’ => $currency));
    }
    }
    return $results;
    }[/code]

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