in checkout/cart i have price 122.00 (100.00 and tax 22%)
but in checkout/confirm and in order i have 100.00 price
why???
Attachments
Confirm - confirm.jpg (5.74 KiB) Viewed 9426 times
Cart - cart.jpg (5.34 KiB) Viewed 9426 times
Find (line 412-413):
Code: Select all
'price' => $this->currency->format($product['price']),
'total' => $this->currency->format($product['total']),
Code: Select all
'price' => $this->currency->format($this->tax->calculate($product['price'], $product['tax_class_id'], $this->config->get('config_tax'))),
'total' => $this->currency->format($this->tax->calculate($product['total'], $product['tax_class_id'], $this->config->get('config_tax'))),
Update: I also changed "catalog/model/total/sub_total.php", where I replaced $this->cart->getSubTotal() with $this->cart->getTotal() in line 9 & 10.
Request Reviews v1.0 released.
I change too line 14 in sub_total model
Code: Select all
class ModelTotalSubTotal extends Model {
public function getTotal(&$total_data, &$total, &$taxes) {
if ($this->config->get('sub_total_status')) {
$this->load->language('total/sub_total');
$total_data[] = array(
'title' => $this->language->get('text_sub_total'),
'text' => $this->currency->format($this->cart->getTotal()),
'value' => $this->cart->getTotal(),
'sort_order' => $this->config->get('sub_total_sort_order')
);
$total += $this->cart->getTotal();
}
}
}
Does this change will be included in the next version?

Ahh I see. The product prices. Did you change the first thing I wrote?
Request Reviews v1.0 released.
yes, i change the first thing.
I changed the line 14 because the total amount was net of tax'price' => $this->currency->format($this->tax->calculate($product['price'], $product['tax_class_id'], $this->config->get('config_tax'))),
'total' => $this->currency->format($this->tax->calculate($product['total'], $product['tax_class_id'], $this->config->get('config_tax'))),
Line 405 to 415 should look like this:
Code: Select all
$this->data['products'][] = array(
'product_id' => $product['product_id'],
'name' => $product['name'],
'model' => $product['model'],
'option' => $option_data,
'quantity' => $product['quantity'],
'tax' => $this->tax->getRate($product['tax_class_id']),
'price' => $this->currency->format($this->tax->calculate($product['price'], $product['tax_class_id'], $this->config->get('config_tax'))),
'total' => $this->currency->format($this->tax->calculate($product['total'], $product['tax_class_id'], $this->config->get('config_tax'))),
'href' => $this->url->http('product/product&product_id=' . $product['product_id'])
);
Request Reviews v1.0 released.
in my checkout/confirm page do not see tax.
screen order_details.jpg shows the account/invoice
I did like you said and my checkout/confirm screen looks like the attached image
Attachments
my checkout/confirm - confirm.jpg (5.74 KiB) Viewed 9404 times
controller, view, sub_total model
account/invoice or the confirm page?screen order_details.jpg shows the account/invoice
The account/invoice.php file is abit harder to do it on, as it doesnt save the tax_class_id in your order_product table (database). I can help you with it, if you want...
Also, this might be a stupid question - are you sure you set a tax class for "Nokia 3110c"?
(Edit product -> Tab "Data" -> Tax Class)
Request Reviews v1.0 released.
look http://sandroplus.pl/sklep/
i make for you new account test@user.pl
pass: test
is only in Polish

for nokia 3110 price changed to 100.00 and added 22% tax
for payment method (metoda płatności) select "Przelew bankowy"
At around line 20, insert:
Code: Select all
// dbstr - Get Tax Class Id.
public function getProductTaxClassId($product_id) {
$query = $this->db->query("SELECT tax_class_id FROM " . DB_PREFIX . "product WHERE product_id = '" . (int)$product_id . "'");
return $query->row;
}
At around line 172, find:
Code: Select all
$this->data['products'][] = array(
'name' => $product['name'],
'model' => $product['model'],
'option' => $option_data,
'quantity' => $product['quantity'],
'price' => $this->currency->format($product['price'], $order_info['currency'], $order_info['value']),
'total' => $this->currency->format($product['total'], $order_info['currency'], $order_info['value'])
);
Code: Select all
// dbstr - Get Tax Class Id.
$tax_class_id = $this->model_account_order->getProductTaxClassId($product['product_id']);
$this->data['products'][] = array(
'name' => $product['name'],
'model' => $product['model'],
'option' => $option_data,
'quantity' => $product['quantity'],
//'price' => $this->currency->format($product['price'], $order_info['currency'], $order_info['value']),
'price' => $this->currency->format($this->tax->calculate($product['price'], $tax_class_id['tax_class_id'], $this->config->get('config_tax')), $order_info['currency'], $order_info['value']),
//'total' => $this->currency->format($product['total'], $order_info['currency'], $order_info['value'])
'total' => $this->currency->format($this->tax->calculate($product['total'], $tax_class_id['tax_class_id'], $this->config->get('config_tax')), $order_info['currency'], $order_info['value'])
);
Request Reviews v1.0 released.
Edit: admin/index.php
Find (line 97)
Code: Select all
// Currency
Registry::set('currency', new HelperCurrency());
Code: Select all
// Tax - dbstr
Registry::set('tax', new HelperTax());
Find (line 120)
Code: Select all
public function getOrderProducts($order_id) {
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "order_product WHERE order_id = '" . (int)$order_id . "'");
return $query->rows;
}
Code: Select all
// dbstr - Get Tax Class Id.
public function getProductTaxClassId($product_id) {
$query = $this->db->query("SELECT tax_class_id FROM " . DB_PREFIX . "product WHERE product_id = '" . (int)$product_id . "'");
return $query->row;
}
Find (line 577)
Code: Select all
$this->data['products'][] = array(
'name' => $product['name'],
'model' => $product['model'],
'option' => $option_data,
'quantity' => $product['quantity'],
'price' => $this->currency->format($product['price'], $order_info['currency'], $order_info['value']),
'total' => $this->currency->format($product['total'], $order_info['currency'], $order_info['value'])
);
Code: Select all
// dbstr - Tax...
$tax_class_id = $this->model_customer_order->getProductTaxClassId($product['product_id']);
$this->data['products'][] = array(
'name' => $product['name'],
'model' => $product['model'],
'option' => $option_data,
'quantity' => $product['quantity'],
//'price' => $this->currency->format($product['price'], $order_info['currency'], $order_info['value']),
'price' => $this->currency->format($this->tax->calculate($product['price'], $tax_class_id['tax_class_id'], $this->config->get('config_tax')), $order_info['currency'], $order_info['value']),
//'total' => $this->currency->format($product['total'], $order_info['currency'], $order_info['value'])
'total' => $this->currency->format($this->tax->calculate($product['total'], $tax_class_id['tax_class_id'], $this->config->get('config_tax')), $order_info['currency'], $order_info['value'])
);
(I don't know if I missed or forgot something, so just yell if it fails ;-))
Request Reviews v1.0 released.
I know the tax is being added in the "order total", but it still doesn't show the product prices with tax. Correct me if I'm wrong, please.. Would love to undo all the changes, if there is a better way to do it.
It's not your fault, it's just the way it is in some countries.
Request Reviews v1.0 released.
Who are you talking to?Qphoria wrote:Yea, I am not aware of any bugs with this. It just sounds like you had Display prices with tax set up and weren't logged in or something. Or were logged in from a zone outside of the tax zone.
I tested this for a few hours with different setups. I only got one zone and one tax rate. No matter what I did, it didn't display the product prices with tax in the confirm & invoice pages (which you have to be logged in to see). In the controller files it isn't adding the tax, so how can it have anything to do with not being logged in, or in the wrong zone?
As I wrote in my previous post, this might not be a problem for everyone - but for some countries, you would want to display all prices with the tax included. I don't know the laws or preferences of UK and US shops, but this it how it is here, and how I want it to be. If there is an easier solution, feel free to tell me and delete my "messing with the code"-posts.
This is not a bug as such, but some people will need it - others won't.
Edit:
For the admin side changes, I forgot this;
Add this line at line 11, in admin/index.php:
Code: Select all
require_once(DIR_SYSTEM . 'helper/tax.php');
Request Reviews v1.0 released.
There should be no bearing on country or zone.. its all the same system.Case 1:
Display Prices with Tax = YES
Results 1:
a) Logged Out: Price + the tax rate set on the product.
b) Logged In (same zone as product tax zone):
- All pages: Price+tax
- Confirm page: Price + tax already in price. Tax listed only as text to break it down, but does not recalculate main total.
c) Logged In (different zone than product tax zone):
- All pages: Price+taxPrice only
- Confirm page: Price only. No tax.
Case 2:
Display Prices with Tax = NO
Results 2:
a) Logged Out: Price only
b) Logged In (same zone as product tax zone):
- All pages: Price only.
- Confirm page: Price only in totals. Tax listed and deducted as a total. recalculates main total.
c) Logged In (different zone than product tax zone):
- All pages: Price only
- Confirm page: Price only. No tax.
I got 1 country, 1 zone, 1 tax rate. Display prices with vat set to yes.
A product with a price, let's say 80. Tax rate: 25%
What would it show in my confirm page, assuming I'm logged in, my address is set up with the only zone I got, and the product is set to my tax class? What unit price would it show?
I'm sorry if this sounds stupid, but I either misunderstood the basics of the tax calculation used, or we aren't understanding eachother and the purpose of my code-messing. I'm just looking for some clarification on this, not meaning to diss anyone or anything.
Request Reviews v1.0 released.
Users browsing this forum: No registered users and 5 guests