We have this site http://floors-4-you.co.uk/ when someone orders above GBP 1000, the order total rounds off to GBP 1. If the order total > 2000 it rounds off to 2. Could you please suggest where is the problem?
Just a Guess, probably this funny additional field is screwing up so badly.
Ernie
openshop.li
Ernie
openshop.li
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
Thank you Ernie for your reply but that is not the problem as the total is being divided by approx. 1000, sub-total takes only first digit after it goes above 1000.
The problems must come from something, and the only non-default thing, I can see, is this additional Field.
Ernie
Ernie
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
Could you possibly find any error in the following code.
<div class="cart-total">
<table id="total">
<?php
$productq=0;
$productprice=0;
foreach ($products as $product) {
$productq = $productq + $product['quantity'];
$proprice=$product['total'];
$propri=substr($proprice,2);
$productprice=$productprice+$propri;
}
$val=0;
?>
<?php foreach ($totals as $total) {
$title=$total['title'];
$vat= $productprice/5;
if($title=='Flat Shipping Rate')
{
$val=substr($total['text'],2);
}
if($title=='VAT (20%)')
{
$ttl=$productprice+$vat+$val;
}
?>
<tr>
<td class="right"><b><?php echo $title; ?>:</b></td>
<td class="right"><?php if($title=='Sub-Total'){ echo $this->currency->format($productprice); } else if($title=='VAT (20%)'){ echo $this->currency->format($vat); }else if($title=='Total'){ echo $this->currency->format($ttl);} else {echo $total['text']; }
?></td>
</tr>
<?php } ?>
</table>
</div>
<div class="cart-total">
<table id="total">
<?php
$productq=0;
$productprice=0;
foreach ($products as $product) {
$productq = $productq + $product['quantity'];
$proprice=$product['total'];
$propri=substr($proprice,2);
$productprice=$productprice+$propri;
}
$val=0;
?>
<?php foreach ($totals as $total) {
$title=$total['title'];
$vat= $productprice/5;
if($title=='Flat Shipping Rate')
{
$val=substr($total['text'],2);
}
if($title=='VAT (20%)')
{
$ttl=$productprice+$vat+$val;
}
?>
<tr>
<td class="right"><b><?php echo $title; ?>:</b></td>
<td class="right"><?php if($title=='Sub-Total'){ echo $this->currency->format($productprice); } else if($title=='VAT (20%)'){ echo $this->currency->format($vat); }else if($title=='Total'){ echo $this->currency->format($ttl);} else {echo $total['text']; }
?></td>
</tr>
<?php } ?>
</table>
</div>
Seems to be a V2, anyway! And as I see, you are trying to 'squeeze' the whole Coding into the theme template file, but I really have no clue, if or/and how this works in OC. More, many internal OC-THINGS are 'handled/supported' by JS/JSON Routines, so, you'll just have to get a Pro, probably familiar for Journal Themes as well, to get this sorted out.
I am really not a Coder, just an old Thief, with a fairly good sense of 'remembering' and 'combining' already existent 'Knowledge' into a working Whole !
Good Luck !
Ernie
I am really not a Coder, just an old Thief, with a fairly good sense of 'remembering' and 'combining' already existent 'Knowledge' into a working Whole !
Good Luck !
Ernie
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
Who is online
Users browsing this forum: No registered users and 1 guest