Quote from Marco on August 26, 2024, 23:45
Hello
Need your asistenace, and I don't find where create a Ticket and for that reason, I use this form.
We need to rount our price (cents), e.g.: If in the prices, the cents ar from $01 to $49 'round' the cents to $.50 and if the prices is from $.51 to $.98, then 'round' price to $.99
We try this:
// WOO WOOCS ROUND CENTS
"add_filter('woocs_raw_woocommerce_price', function ($price) {
global $WOOCS;
// Definir las monedas a las que se aplicará la lógica
$currencies = ['USD', 'CAD', 'MXN'];
if (in_array($WOOCS->current_currency, $currencies)) {
// Extraer la parte decimal del precio
$cents = fmod($price, 1);
if ($cents > 0.00 && $cents < 0.50) {
$price = floor($price) + 0.50;
} elseif ($cents > 0.50 && $cents < 0.99) {
$price = floor($price) + 0.99;
}
}
return $price;
});"
But doesn't work.
Can you help us with this?
Thank you a lot and God Bless you All
Hello
Need your asistenace, and I don't find where create a Ticket and for that reason, I use this form.
We need to rount our price (cents), e.g.: If in the prices, the cents ar from $01 to $49 'round' the cents to $.50 and if the prices is from $.51 to $.98, then 'round' price to $.99
We try this:
// WOO WOOCS ROUND CENTS
"add_filter('woocs_raw_woocommerce_price', function ($price) {
global $WOOCS;
// Definir las monedas a las que se aplicará la lógica
$currencies = ['USD', 'CAD', 'MXN'];
if (in_array($WOOCS->current_currency, $currencies)) {
// Extraer la parte decimal del precio
$cents = fmod($price, 1);
if ($cents > 0.00 && $cents < 0.50) {
$price = floor($price) + 0.50;
} elseif ($cents > 0.50 && $cents < 0.99) {
$price = floor($price) + 0.99;
}
}
return $price;
});"
But doesn't work.
Can you help us with this?
Thank you a lot and God Bless you All