Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Support for WCML
This topic contains 7 replies, has 2 voices, and was last updated by Jie 6 years, 3 months ago.
- AuthorPosts
- June 14, 2017 at 10:29 pm #13593
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
Attachments:
You must be logged in to view attached files.June 15, 2017 at 9:10 am #13603Hi,
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’
Best,
Can you please check that?
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
June 15, 2017 at 9:14 am #13604Thank you.
Now it should be accessible.
Regards
Jie
June 15, 2017 at 10:27 am #13610Thank you!
Can you please also check the FTP, I just tried to log-in, but I can only see an empty folder.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
June 15, 2017 at 10:47 am #13613You cannot access this content.June 15, 2017 at 7:13 pm #13623Thank you.
It works fine.
June 15, 2017 at 7:58 pm #13624Hi!
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
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
June 15, 2017 at 8:03 pm #13625add_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; }
- AuthorPosts
You must be logged in to reply to this topic.