Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

How to make Installments on product page get Final (or SpecialPrice) instead of GrandTotal? 
 
redlights
Jr. Member
 
Total Posts:  15
Joined:  2011-03-02
 

Maybe someone can help me on this one. I want to insert a dropdown installments on product page, and must show the price numbers with 2 decimals, for example: R$ 300,00 instead of R$ 300,0000. Thank you!
This is the code that i have and tried to modify it but with no success:

<?php
$standad 
Mage::getSingleton('moip/standard');
$api Mage::getSingleton('moip/api');
?> 

<link rel="stylesheet" type="text/css" href="<?php echo $this->getSkinUrl('o2ti_moip/css/formulario.css'); ?> "media="all">  

<?php
$_product 
$this->getProduct( );
$_coreHelper $this->helper('core');
?> 
            <?php 
if ($standad->getConfigData('parcelamento')): ?>
            
<label id="dadoscartaoopc">Parcelamento no Cartão de Crédito:</label>
            <
select name="payment[credito_parcelamento]" id="credito_parcelamentoproduto" >
                                
<?php
                                    $parcelamento 
$api->getParcelamento($_product->getFinalPrice());
    
                                    foreach (
$parcelamento as $k => $v): ?>
                                        
<option value="<?php echo $k ?>"><?php echo $k "x R$ " $v['valor'" | Total: R$ " .$v['total']."" ?></option
                                
<?php endforeach; ?>
                                    
</select>
            
<?php endif; ?>
            
<div id="addparcelas">
                                            
<?php
                                            $standard 
Mage::getSingleton('moip/standard');
                                            
$parcelamento $standard->getInfoParcelamento();
                                            if (
$parcelamento['juros1'== 0)
                                            
{
                                            
echo "<div id=\"addparcelasdesc\"> Sem juros até ".$parcelamento['ate1']." parcelas,</div>";
                                            if (
$parcelamento['ate1'13)
                                            
{
                                            
echo "após juros de 1,99% ao mês.";
                                            
}
                                            }
                                            
if ($parcelamento['juros1'>= "1.99")
                                            
{
                                            
echo "Com juros de ".$parcelamento['juros1']." ao mês.";
                                            
}
                                            ?>
                                         
</div>

Image Attachments
parcelamento.jpg
 
Magento Community Magento Community
Magento Community
Magento Community
 
redlights
Jr. Member
 
Total Posts:  15
Joined:  2011-03-02
 

Solution:

<?php
$standad 
Mage::getSingleton('moip/standard');
$api Mage::getSingleton('moip/api');
?> 

<link rel="stylesheet" type="text/css" href="<?php echo $this->getSkinUrl('o2ti_moip/css/formulario.css'); ?> "media="all">  

<?php
$_product 
$this->getProduct( );
$_coreHelper $this->helper('core');
?> 
            <?php 
if ($standad->getConfigData('parcelamento')): ?>
            
<label id="parcelamentoproduto">PARCELAMENTO NO CARTÃO DE CRÉDITO:</label>
            <
select name="payment[credito_parcelamento]" id="credito_parcelamentoproduto" >
                                
<?php
                                    $parcelamento 
$api->getParcelamento($_product->getFinalPrice());
    
                                    foreach (
$parcelamento as $k => $v): ?>
                                        
<option value="<?php echo $k ?>"><?php echo $k "x R$ " number_format($v['valor'],2,',',' ') . " ---------- Total: R$ " .number_format($v['total'],2,',',' ')."" ?></option
                                
<?php endforeach; ?>
                                    
</select>
            
<?php endif; ?>
            
<div id="addparcelas">
                                            
<?php
                                            $standard 
Mage::getSingleton('moip/standard');
                                            
$parcelamento $standard->getInfoParcelamento();
                                            if (
$parcelamento['juros1'== 0)
                                            
{
                                            
echo "<div id=\"addparcelasdesc\"> Sem juros até ".$parcelamento['ate1']." parcelas,</div>";
                                            if (
$parcelamento['ate1'13)
                                            
{
                                            
echo "após juros de 1,99% ao mês.";
                                            
}
                                            }
                                            
if ($parcelamento['juros1'>= "1.99")
                                            
{
                                            
echo "Com juros de ".$parcelamento['juros1']." ao mês.";
                                            
}
                                            ?>
                                         
</div>
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top