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

I am having issue with the display of the currency on cellphone

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.
12

Hello

Ok!  I disabled  this  plugin   - https://c2n.me/4is1a3V.png - Please  do a test

And it looks like you are using a custom price display template

Hi Pablo. I will try disabling that plugin.

As for the price we are not using a custom price display template but only a small code for the display of variation to be only showing the small price.

Here the code we have added below. Do you think something in  that code could create the issue?

Thanks

 

add_filter( 'woocommerce_get_price_html', 'cssigniter_change_variable_price_display', 10, 2 );
function cssigniter_change_variable_price_display( $price, $product_obj ) {
global $product;

if ( 'variable' !== $product->get_type() || 'product_variation' === $product_obj->post_type ) {
return $price;
}

$prices = array( $product->get_variation_price( 'min', true ), $product->get_variation_price( 'max', true ) );
// Translators: %s is the lowest variation price.
$price = $prices[0] !== $prices[1] ? sprintf( __( '%s', 'your-text-domain' ), wc_price( $prices[0] ) ) : wc_price( $prices[0] );

return $price;
}

 

Hello

Do you think something in  that code could create the issue? - Yes.  To work correctly with the cache, prices must have such template - https://share.pluginus.net/image/i20230505101425.png

add_filter( 'woocommerce_get_price_html', 'cssigniter_change_variable_price_display', 10, 2 );
function cssigniter_change_variable_price_display( $price, $product_obj ) {
global $product;

if ( 'variable' !== $product->get_type() || 'product_variation' === $product_obj->post_type ) {
return $price;
}

$prices = array( $product->get_variation_price( 'min', true ), $product->get_variation_price( 'max', true ) );
// Translators: %s is the lowest variation price.
$price = $prices[0] !== $prices[1] ? sprintf( __( '%s', 'your-text-domain' ), wc_price( $prices[0] ) ) : wc_price( $prices[0] );

if (class_exists('WOOCS')) {

global $WOOCS;

$classes ="woocs_price_code";
if ($WOOCS->shop_is_cached AND $WOOCS->shop_is_cached_preloader) {
$classes .=" woocs_preloader_ajax";
}

$price = '<span class="' . $classes . '" data-currency="" data-redraw-id="' . uniqid() . '" data-product-id="' . $product_obj->get_id() . '">' . $price . '</span>';

}

return $price;
}

 

Attention, this is sample code, I have not tested it.

Thanks, Seems to be working well. Thanks so much!

Hello

Great!  Welcome;)

12