I need Cake PHP programming help?

TorqV

New member
I have an online store where the users have a budget and if they checkout over their allowed budget they pay the rest by credit card. For some reason the function isn't subtracting the budget money and the whole amount is getting forwarded to the credit card, even if they have budget money
I have posted the current code. I really appreciate any help!


<?php
if ($user['company_id'] == 47 && $user['current_budget'] > 0) {
echo $form->labelTag('Order/ApplyBudget', 'Apply remaining balance ($'.number_format($user['current_budget'], 2).')');
echo $html->checkbox('Order/ApplyBudget');
if ($user['current_budget'] > $grand_total) {
echo "<p>Because your budget balance is greater than the order total, your credit card will not be billed if you apply your budget.</p>\n";
}
}
?>
<table border="0" cellpadding="4">
<tr>
<th align="left">Payment Options</th>
</tr>
<tr>
<td>
<?php
if ($payments['Company']['payment_invoice']) {
$options['invoice'] = 'Invoice';
$default = array('value' => 'invoice');
} else {
$default = array('value' => 'creditcard');
}
if ($payments['Company']['payment_cc']) {
$options['creditcard'] = 'Pay now with a credit card';
}

echo $html->radio('Order/PaymentMethod', $options, '<br>', $default);
?>
</td>
</tr>
<tr>
<td colspan="6" class="order_confirm"><input type="submit" value="Complete Order" class="submit_btn" /></td>
</tr>
</table>
<?php echo $html->input('Order/total', Array('type'=>'hidden', 'value'=> $grand_total + $tax + $shipping)); ?>
<?php echo $html->input('Order/tax', Array('type'=>'hidden', 'value'=> $tax)); ?>
<?php echo $html->input('Order/shipping', Array('type'=>'hidden', 'value'=> $shipping)); ?>
</form>
 
Back
Top