Post by atulgupta11 » Tue Mar 08, 2016 4:15 pm

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?

Newbie

Posts

Joined
Tue Mar 08, 2016 12:23 am

Post by IP_CAM » Wed Mar 09, 2016 5:48 am

Just a Guess, probably this funny additional field is screwing up so badly.
Ernie
openshop.li

Attachments

golden_oak.jpg

screwed up subtotal amount - golden_oak.jpg (40.1 KiB) Viewed 1615 times


Ernie's OpenCart v.1.5.6.5 LIGHT + OpenShop Admin v.1.75 Test Sites
http://www.ebikes.li - http://www.evelo.li - http://www.openshop.li
Image


User avatar
Guru Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by atulgupta11 » Wed Mar 09, 2016 8:30 am

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.

Newbie

Posts

Joined
Tue Mar 08, 2016 12:23 am

Post by IP_CAM » Wed Mar 09, 2016 11:12 am

The problems must come from something, and the only non-default thing, I can see, is this additional Field.
Ernie

Ernie's OpenCart v.1.5.6.5 LIGHT + OpenShop Admin v.1.75 Test Sites
http://www.ebikes.li - http://www.evelo.li - http://www.openshop.li
Image


User avatar
Guru Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by atulgupta11 » Wed Mar 09, 2016 11:24 am

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>

Newbie

Posts

Joined
Tue Mar 08, 2016 12:23 am

Post by IP_CAM » Wed Mar 09, 2016 12:36 pm

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 ! :D
Good Luck ! ;)
Ernie

Ernie's OpenCart v.1.5.6.5 LIGHT + OpenShop Admin v.1.75 Test Sites
http://www.ebikes.li - http://www.evelo.li - http://www.openshop.li
Image


User avatar
Guru Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland
Who is online

Users browsing this forum: No registered users and 4 guests