1 Attachment(s)
Buy one get one free, tax calculation problem
Dear members,
I encounter a problem after installing the plugin 'Buy one get one free'
I installed it in a testversion of my online store and the problem is that the tax rate isn't calculating correctly.
When the products you want to sell f.e. buy 4 get 1 for free, the program calculates 4 times the price, then it substracts 1 time the price. Ok so far
But then comes the tax calculation. And here it calculates the tax on the subtotal ( 4 * price).
Attachment 16730
See this example.
Anyone knows how to adjust this?
Many thanks.
Koen
Re: Buy one get one free, tax calculation problem
I'm not familiar with the module you're using.
But it might be worth reading here: http://www.thatsoftwareguy.com/zenca...o_bonanza.html ... several of his Zen Cart plugins are also in the Zen Cart downloads area and have support threads here on these forums.
Re: Buy one get one free, tax calculation problem
if($_SESSION['cost_minimize_agg'] > 0){
$this->output[] = array('title' => $this->title . ':',
'text' => '-' . $currencies->format($_SESSION['cost_minimize_agg']+$order->info['tax'], true, $order->info['currency'], $order->info['currency_value']),
'value' => $_SESSION['cost_minimize_agg']);
This is what I have added in the code and here lies the solution for my problem I think.
Just that now the free articles are have the entire tax extra and not for just the amount of articles that are free.
Anyone knows a solution to that?
Re: Buy one get one free, tax calculation problem
Problem solved
Afterward you always would hit your one head.
'text' => '-' . $currencies->format($_SESSION['cost_minimize_agg']+($_SESSION['cost_minimize_agg']*0.06), true, $order->info['currency'], $order->info['currency_value']),
'value' => $_SESSION['cost_minimize_agg']);
In my case there is a tax rate off 6% for all my products (for now...)
So I have added this amount of tax 'manually'.
Re: Buy one get one free, tax calculation problem
On the surface that appears to address what is seen, but when charged, is the correct amount "taken"? I'm also not familiar with the plugin, but the above code change appears to only address one output characteristic and wouldn't want you to be surprised to be charged more than displayed.
Re: Buy one get one free, tax calculation problem
Tax is usually done by using zen_add_tax() and passing the relevant tax rates, and then passing that result to the currency->format().
Looks like this particular BOGO module wasn't written with tax in mind?
Re: Buy one get one free, tax calculation problem
Dear DrByte,
It's seem that this module isn't write with tax in mind indeed. But for now it works fine the way I have changed the program code.
It looks like this:
function process() {
global $order, $currencies;
$order->info['total'] = $order->info['total'] - $_SESSION['cost_minimize_agg']-($_SESSION['cost_minimize_agg']*0.06);
if($_SESSION['cost_minimize_agg'] > 0){
$this->output[] = array('title' => $this->title . ':',
'text' => '-' . $currencies->format($_SESSION['cost_minimize_agg']+($_SESSION['cost_minimize_agg']*0.06), true, $order->info['currency'], $order->info['currency_value']),
'value' => $_SESSION['cost_minimize_agg']);