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

Some small snippet issues

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.

Hi,

I bought the pro version of the plugin. Hopefully you can help me out with some (small) issues:

1. I'm using this snippet to round the prices to 99 cents
Source: https://currency-switcher.com/how-to-round-price-to-99-cents/

However I get an error: Parse error: syntax error, unexpected identifier"–", expecting";" in your code on line 3

The snippet:
<?php
add_filter('woocs_raw_woocommerce_price', function($price) {
return round($price + 0.01) – 0.01;
});
?>

You can see it also and validate it on https://phpcodechecker.com You'll get the same error. Here my website in another language and currency: https://adrianysus.com/pl/ (Poland / Polish) where it is not working. How to fix this small issue?

 

2. I'm using another snipper to remove all currency symbols, but it stopped working after installing your plugin.

This is the snippet I'm using to remove all currency symbols
// Remove all currency symbols
function sww_remove_wc_currency_symbols( $currency_symbol, $currency ) {
$currency_symbol = '';
return $currency_symbol;
}
add_filter('woocommerce_currency_symbol', 'sww_remove_wc_currency_symbols', 10, 2);

Source: https://jilt.com/blog/pricing-remove-currency-symbol/#change-or-remove-woocommerce-currency

Any idea how to fix and let it work again?

 

3. A third small snippet I'm using is the Small font for decimal prices, it also stopped working aster installing yours plugin

add_filter( 'formatted_woocommerce_price', 'ts_woo_decimal_price', 10, 5 );
function ts_woo_decimal_price( $formatted_price, $price, $decimal_places, $decimal_separator, $thousand_separator ) {
$unit = number_format( intval( $price ), 0, $decimal_separator, $thousand_separator );
$decimal = sprintf( '%02d', ( $price - intval( $price ) ) * 100 );
return $unit . '<small>' . $decimal_separator. $decimal . '</small>';
}

Source: https://ecommtrics.com/style-the-decimal-values-in-prices-in-woocommerce
Any idea how to fix and let it work again?

Hello

1 Please  try  this  code:

add_filter('woocs_raw_woocommerce_price', function($price) {
return round($price + 0.01) - 0.01;
});

2 /3Try increasing the filter priority

add_filter('woocommerce_currency_symbol', 'sww_remove_wc_currency_symbols', 10, 99999);

add_filter( 'formatted_woocommerce_price', 'ts_woo_decimal_price', 10, 99999 );

 

 

It seems there i something strange happening. I've editet the snippets, initially it seems to work, loads and after 1 or 2 seconds the price seems to blink and the snippets are not working.

 

Here the original page in Dutch: https://adrianysus.com/

A translated page in other languages for eg. in Bulgarian https://adrianysus.com/bg/ or Polish https://adrianysus.com/pl/

Hello

This is a redraw in Ajax of cached prices.

Looks like these hooks don't work in ajax mode

Hint  to remove all currency symbols:

Add a space to this field - https://share.pluginus.net/image/i20220621090823.png and  use it - https://share.pluginus.net/image/i20220621090931.png

Great the currency symbols is fixed now. Any idea how to fix the ajax cache ? I've posted the backend login in the private data of this topic.

Hello
woocommerce_get_price_html - please try this hook for your price customization.