Simple PHP Code for Magento
- or -
Post a project like this4025
$15
- Posted:
- Proposals: 2
- Remote
- #236226
- Awarded
Description
Experience Level: Entry
Hello,
I need a simple job to be done in php for a magento website.
I need that you transform this first code with the features in the layout of the second code.
<?php
function getNumParcelas($total, $maxParcelas, $valor_minimo)
{
$nParcelas = $maxParcelas;
//verifica o valor mínimo permitido para cada parcela
if (!empty($valor_minimo) && is_numeric($valor_minimo)) {
$parcPossiveis = floor($total / $valor_minimo);
if ($parcPossiveis < $nParcelas) {
$nParcelas = $parcPossiveis;
}
}
return $nParcelas;
}
function getValorParcela($total, $parcela, $taxa) {
if(!is_numeric($total) || $total <= 0){
return(false);
}
if((int)$parcela != $parcela){
return(false);
}
if(!is_numeric($taxa) || $taxa 1){
for($i=1; $i
getFinalPrice();
$numParcelas = getNumParcelas($capital, $maxParcelas, $valorMinimo);
for($i=1; $i < $numParcelas; $i++){
$valorParcela = getValorParcela($capital, $i+1, $taxa);
echo($i % 2 ? '' : '');
echo(''.($i+1).' parcelas de R$ '.number_format($valorParcela,2,',','.').'* ');
echo($i % 2 ? '' : '
-------------
Second: Code
getId() );
$vezes = '10';
echo 'getFinalPrice()/$vezes, true, false ).'
---------------
I need that the first php code shows in the frontpage like:
Em até 10x Sem Juros de R$53,00 (with features from the first code, like $valorMinimo = 10;
and not like this
2 parcelas de R$ 265,00* 3 parcelas de R$ 176,67*
4 parcelas de R$ 132,50* 5 parcelas de R$ 106,00*
6 parcelas de R$ 88,33*
I hope you can do the job.
Thanks!
I need a simple job to be done in php for a magento website.
I need that you transform this first code with the features in the layout of the second code.
<?php
function getNumParcelas($total, $maxParcelas, $valor_minimo)
{
$nParcelas = $maxParcelas;
//verifica o valor mínimo permitido para cada parcela
if (!empty($valor_minimo) && is_numeric($valor_minimo)) {
$parcPossiveis = floor($total / $valor_minimo);
if ($parcPossiveis < $nParcelas) {
$nParcelas = $parcPossiveis;
}
}
return $nParcelas;
}
function getValorParcela($total, $parcela, $taxa) {
if(!is_numeric($total) || $total <= 0){
return(false);
}
if((int)$parcela != $parcela){
return(false);
}
if(!is_numeric($taxa) || $taxa 1){
for($i=1; $i
getFinalPrice();
$numParcelas = getNumParcelas($capital, $maxParcelas, $valorMinimo);
for($i=1; $i < $numParcelas; $i++){
$valorParcela = getValorParcela($capital, $i+1, $taxa);
echo($i % 2 ? '' : '');
echo(''.($i+1).' parcelas de R$ '.number_format($valorParcela,2,',','.').'* ');
echo($i % 2 ? '' : '
-------------
Second: Code
getId() );
$vezes = '10';
echo 'getFinalPrice()/$vezes, true, false ).'
---------------
I need that the first php code shows in the frontpage like:
Em até 10x Sem Juros de R$53,00 (with features from the first code, like $valorMinimo = 10;
and not like this
2 parcelas de R$ 265,00* 3 parcelas de R$ 176,67*
4 parcelas de R$ 132,50* 5 parcelas de R$ 106,00*
6 parcelas de R$ 88,33*
I hope you can do the job.
Thanks!
Victor C.
0% (0)Projects Completed
1
Freelancers worked with
1
Projects awarded
50%
Last project
11 Apr 2013
Brazil
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
There are no clarification messages.
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies