SOLVED - Hot VM Scroller discounted price with tax

More
11 years 7 months ago #29908 by ivan.milic
so put temporally:

var_dump($pr->prices);

that will output whole object as string so you can see which price do you need.

Please Log in to join the conversation.

More
11 years 7 months ago - 11 years 7 months ago #29909 by Stryjewski
Thanks for your answer.

Prices are OK, but some are with two decimal places, with one decimal or no decimal places, and I want that all prices were to two decimal places.


and in my modifications
Code:
$price = $pr->prices['salesPrice']; $price = '<div class="productPrice">'.round($pr->prices['salesPrice'],2).'</div>';

i don't have currency (why?).
Last edit: 11 years 7 months ago by Stryjewski.

Please Log in to join the conversation.

More
11 years 7 months ago #29911 by ivan.milic
That value is just number but you can get currency symbol using SQL query you have above that code

Please Log in to join the conversation.

More
11 years 7 months ago #29917 by Stryjewski
Thank you Ivan

Now I have this code:
Code:
$price_object = $db->loadObject(); $currency = $db->loadObject(); $price = $pr->prices['salesPrice']; $price = '<div class="productPrice">'.round($pr->prices['salesPrice'],2) .$currency->C.zł.'</div>';

and the price looks like this: 123zł, 123.4zł, 123.45zł

but I don't know how to do that:
1) between the price and the currency symbol is an interval (123.45 zł)
2) replace in prices (.) to (,)
3) all prices have a format with two decimal places

Please Log in to join the conversation.

More
11 years 7 months ago #29919 by ivan.milic
check php format_number function:

php.net/manual/en/function.number-format.php

and to remove blank you can use str_replace :

php.net/manual/en/function.str-replace.php

Please Log in to join the conversation.

More
11 years 6 months ago #30957 by mminatta
Hola Adriano
tengo el mismo problema que tu y me estoy volviendo loca para resolverlo. ¿puedes pasarme el codigo como te ha quedado? Muchas gracias.
Mariela

Hello Adriano
I have the same problem as you and I'm going crazy to solve. Can you pass me the code as you have been? Thank you very much.

Please Log in to join the conversation.

Time to create page: 0.097 seconds
Powered by Kunena Forum