Does anyone know how to configure sub total in cart/checkout in this way, I need the sum of net price of items and the net cost of shipping?
This is how Opencart now display this info now:
But I need it displayed this way:
Thanks, just tryed but this not work, Shipping ex VAT is still not added to Subtotal ex VAT:JAY6390 wrote:Place your shipping above the subtotal. Go to your EXTENSIONS > TOTALS in the admin and change the sort order of "Shipping" and "Subtotal" so the Shipping has a lower sort order value than the Subtotal
OK, this is more of a hack than a proper solution, but will make the subtotal correct
Open
Find this line
change it to
Save that, then open
Find this line
After it on a new line put
And save. This is totally untested but should work in theory
Open
Code: Select all
/catalog/model/total/shipping.php
Code: Select all
$total += $this->session->data['shipping_method']['cost'];
Code: Select all
// $total += $this->session->data['shipping_method']['cost'];
Code: Select all
/catalog/model/total/subtotal.php
Code: Select all
$sub_total = $this->cart->getSubTotal();
Code: Select all
$subtotal += $this->session->data['shipping_method']['cost'];
Great, it works!
Line to add in /catalog/model/total/subtotal.php must be:
Thank you!
Line to add in /catalog/model/total/subtotal.php must be:
Code: Select all
$sub_total += $this->session->data['shipping_method']['cost'];
I just noticed that this modification produces error on the top of the page:
Screenshot: http://screencast.com/t/uARZXc2a
This is how subtotal.php look:
Do you have any idea why this happening?
Code: Select all
Notice: Undefined index: shipping_method in C:\xampp\htdocs\open154\catalog\model\subtotal.php on line 7
This is how subtotal.php look:
Code: Select all
<?php
class ModelTotalSubTotal extends Model {
public function getTotal(&$total_data, &$total, &$taxes) {
$this->load->language('total/sub_total');
$sub_total = $this->cart->getSubTotal();
$sub_total += $this->session->data['shipping_method']['cost'];
if (isset($this->session->data['vouchers']) && $this->session->data['vouchers']) {
foreach ($this->session->data['vouchers'] as $voucher) {
$sub_total += $voucher['amount'];
}
}
$total_data[] = array(
'code' => 'sub_total',
'title' => $this->language->get('text_sub_total'),
'text' => $this->currency->format($sub_total),
'value' => $sub_total,
'sort_order' => $this->config->get('sub_total_sort_order')
);
$total += $sub_total;
}
}
?>
Ok, this work for sub_total.php:
After:
add:
After:
Code: Select all
$sub_total = $this->cart->getSubTotal();
Code: Select all
if ($this->cart->hasShipping() && isset($this->session->data['shipping_method'])) {
$sub_total += $this->session->data['shipping_method']['cost'];
}
Who is online
Users browsing this forum: Baidu [Spider] and 138 guests