- Posts: 14116
 - Thank you received: 1639
 
SOLVED - Hot VM Scroller discounted price with tax
- 
        ivan.milic
Support Staff - 
            
				
                                 - Moderator
 - 
            
         
        Less
        More
        
            
    
        
            
        
                12 years 5 months ago                #29908
        by ivan.milic
    
    
            
            
            
            
            
                                
    
                                                
    
        Replied by ivan.milic on topic SOLVED - Hot VM Scroller discounted price with tax            
    
        so put temporally:
var_dump($pr->prices);
that will output whole object as string so you can see which price do you need.
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.
- 
        Stryjewski
Inactive member - 
            
				
                                 - New Member
 - 
            
         
        Less
        More
        
            
    
        - Posts: 7
 - Thank you received: 0
 
            
        
                12 years 5 months ago         -  12 years 5 months ago        #29909
        by Stryjewski
    
    
    
            
            
            
            
                                
    
                                                
    
        Replied by Stryjewski on topic SOLVED - Hot VM Scroller discounted price with tax            
    
        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
i don't have currency (why?).
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: 12 years 5 months ago  by Stryjewski.            
            Please Log in to join the conversation.
- 
        ivan.milic
Support Staff - 
            
				
                                 - Moderator
 - 
            
         
        Less
        More
        
            
    
        - Posts: 14116
 - Thank you received: 1639
 
            
        
                12 years 5 months ago                #29911
        by ivan.milic
    
    
            
            
            
            
            
                                
    
                                                
    
        Replied by ivan.milic on topic SOLVED - Hot VM Scroller discounted price with tax            
    
        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.
- 
        Stryjewski
Inactive member - 
            
				
                                 - New Member
 - 
            
         
        Less
        More
        
            
    
        - Posts: 7
 - Thank you received: 0
 
            
        
                12 years 5 months ago                #29917
        by Stryjewski
    
    
            
            
            
            
            
                                
    
                                                
    
        Replied by Stryjewski on topic SOLVED - Hot VM Scroller discounted price with tax            
    
        Thank you Ivan
Now I have this code:
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
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.
- 
        ivan.milic
Support Staff - 
            
				
                                 - Moderator
 - 
            
         
        Less
        More
        
            
    
        - Posts: 14116
 - Thank you received: 1639
 
            
        
                12 years 5 months ago                #29919
        by ivan.milic
    
    
            
            
            
            
            
                                
    
                                                
    
        Replied by ivan.milic on topic SOLVED - Hot VM Scroller discounted price with tax            
    
        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
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.
- 
        mminatta
Inactive member - 
            
				
                                 - New Member
 - 
            
         
        Less
        More
        
            
    
        - Posts: 2
 - Thank you received: 0
 
            
        
                12 years 3 months ago                #30957
        by mminatta
    
    
            
            
            
            
            
                                
    
                                                
    
        Replied by mminatta on topic Hot VM Scroller discounted price with tax            
    
        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.
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.194 seconds