PluginUs.Net - Business Tools for WooCommerce and WordPress

[realize your idea - make your dreams come true]

Support Forum

You need to log-in to create request (topic) to the support

fixed variation price at ajax search

The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday. If you have problems with registration ask help on contact us page please
If you not got email within 24~36 business hours, firstly check your spam box, and if no any email from the support there - back to the forum and read answer here. DO NOT ANSWER ON EMAILS [noreply@pluginus.net] FROM THE FORUM!! Emails are just for your info, all answers should be published only here.
The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday.

I've got ajax search in theme that is using the following code. All currencies have fixed rate of 1, and products/variations have fixed prices per currency. What happens here is that $_product->get_price() always returns min variation price in base currency. At catalog page it's working properly, as well as at product page. I've checked that $WOOCS->current_currency is correct inside this ajax handler. How can I fix this?

 

$_product = wc_get_product( $post );
$ids .= $_product->get_id() . ',';

$output['suggestions'] .= '<div class="cell product-search-result">
<a href="'.$_product->get_permalink().'">
<div class="product-search-img">
'.wp_get_attachment_image($_product->get_image_id(), 'woocommerce_thumbnail').'
</div>
<div class="product-search-info">
<span class="product-search-title">'.$_product->get_name().'</span><br/>'
.wc_price($_product->get_price()) .'
</div>
</a>
</div>';

Hello

Please try  to  use

$_product->get_price_html();   - instead of  -    wc_price($_product->get_price())

seems to work, thanks!

Welcome;)