Round Price

Hi,

i want to ask about round that work on price

can i make the price's round to below?

example :

product A have price 8,5 then it will be shown as 8

product B have price 9.8 then it will be shown as 9

Thanks

Hi,

i want to ask about round that work on price

can i make the price's round to below?

example :

product A have price 8,5 then it will be shown as 8

product B have price 9.8 then it will be shown as 9

Thanks

I am afraid, additional code modifications are required to do it. It is not possible to enable this feature on the clean installation

I am afraid, additional code modifications are required to do it. It is not possible to enable this feature on the clean installation

well i've been think to use php int type casting, but i don't know if php type casting work on smarty template

FYI, you can change the amount of digits after the decimal sign in the currency settings:

http://prntscr.com/bcwx73

Hope it can help you.

FYI, you can change the amount of digits after the decimal sign in the currency settings:

http://prntscr.com/bcwx73

Hope it can help you.

well right now i use that method, but it only make normal round, which make 0,5 or higher will be 1

actually i found php function that can solve this (floor function), but is this function can work on cs cart?

well right now i use that method, but it only make normal round, which make 0,5 or higher will be 1

actually i found php function that can solve this (floor function), but is this function can work on cs cart?

A lot of functions are used to calculate different prices/ discounts/ taxes. So it should be tested carefully

A lot of functions are used to calculate different prices/ discounts/ taxes. So it should be tested carefully

hmm, what if i only want to change on "Grand Total" value and not on other value ? is this possible ?

Yes, please check the fn_calculate_cart_content function in the app/functions/fn.cart.php file

You should round the $cart['total'] parameter. It is better to use hooks in this function

Yes, please check the fn_calculate_cart_content function in the app/functions/fn.cart.php file

You should round the $cart['total'] parameter. It is better to use hooks in this function

Thanks, it works !!!

But if you use Paypal express or some other payment methods, they will fail because the order total doesn't sum up to the items + shipping.

As Ecom suggested, very careful testing is required if you're just going to modify it in templates or after business rule calculations.

You could just change the type of 'price' in the cscart_product_prices and cscart_ult_product_prices tables to be an INT. But again, very careful testing would be required and may fall apart after option modifiers or other things like discounts that affect price.

Just curious, what is the reason to round down (floor)?

But if you use Paypal express or some other payment methods, they will fail because the order total doesn't sum up to the items + shipping.

As Ecom suggested, very careful testing is required if you're just going to modify it in templates or after business rule calculations.

You could just change the type of 'price' in the cscart_product_prices and cscart_ult_product_prices tables to be an INT. But again, very careful testing would be required and may fall apart after option modifiers or other things like discounts that affect price.

Just curious, what is the reason to round down (floor)?

Hi,

just as your statement, after i implement this on my online store, paypal is reject payment of all order

i need to round down just for grand total because my offline store use this method

so i just need to floor grand total price and not for per item price

can i use other method?

i've been thinking about using "global discount" to substract this, but i'm not sure for this one

Thanks

Sorry, I don't have any suggestions for you. You might try using a 'product_prices' hook or other means to round down. But again, unless you store the prices as the values you actually want to use then you're going to run into issues. And you won't get them to be integers if you use any discounts or otherwise adjust by percentage.

Hi,

just as your statement, after i implement this on my online store, paypal is reject payment of all order

i need to round down just for grand total because my offline store use this method

so i just need to floor grand total price and not for per item price

can i use other method?

i've been thinking about using "global discount" to substract this, but i'm not sure for this one

Thanks

The global discount is a good idea, but there is no ability to achieve it in default CS-Cart. If this functionality is critical for you, we can develop this modification. Please write us in "Quote request" form of our website.

Thank you.

The global discount is a good idea, but there is no ability to achieve it in default CS-Cart. If this functionality is critical for you, we can develop this modification. Please write us in "Quote request" form of our website.

Thank you.

Hi,

Thanks for your information, after i discuss this with my team, looks like my offline store will use same format as cs cart

so it price is not rounded

Thanks