Forums / Currencies & Sales Taxes, VAT, GST, etc. / How can sub-total include shipping??

How can sub-total include shipping??

Locked

Started by kitiarachan on 26 Jul 2007, 10:03 PM · Views: 2,299

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
26 Jul 2007, 10:03 PM
#1
kitiarachan avatar

kitiarachan

New Zenner

Join Date:
Jul 2007
Posts:
2
Plugin Contributions:
0

How can sub-total include shipping??

Hello,

Sorry to post this, but I've read through the forums and although the forum on setting up Canadian Tax classes may help, it doesn't quite fit my problem. So here goes:

I would like to charge PST and GST on shipping costs, but I don't want it to show up on different lines(ie, a GST line for products, and a GST line for shipping, a PST line for products, and a PST line for shipping). I had someone edit the code so PST and GST will show up separately, but it's not including the tax on the shipping. Currently my site outputs:

Your Total

Sub-Total: $3.49 CDN
Zone Rates (Shipping to CA): $2.10 CDN
6.0% GST: $0.21 CDN
7.0% PST: $0.24 CDN
Total: $6.04 CDN

I want it to say something like:

Merchandise: $3.49 CDN
Zone Rates (Shipping to CA): $2.10 CDN

Sub-Total: $5.59
6.0% GST: $0.31 CDN
7.0% PST: $0.39 CDN
Total: $6.29 CDN

The modification used to make GST and PST be on separate line was:

if(stripos($key, 'BC') !== false) // We're in BC, show PST & HST separately
{
	$pattern= '/([\d.]+)[%] ([A-Za-z]+)/';
	preg_match_all($pattern, $key, $matches);
	$num_tax_types = count($matches[0]);
	$total_percent = array_sum($matches[1]);
	for($tax_type = 0; $tax_type < $num_tax_types; $tax_type++)
	{
		$tax_val = $value * ($matches[1][$tax_type] / $total_percent);
		$tax_title = $matches[1][$tax_type].'% '.$matches[2][$tax_type];

		$this->output[] = array('title' => $tax_title . ':',
      	            'text' => $currencies->format($tax_val, true, $order->info['currency'], $order->info['currency_value']),
            	    'value' => $tax_val);
	}
}	
else
{

	$this->output[] = array('title' => $key . ':',
      	           'text' => $currencies->format($value, true, $order->info['currency'], $order->info['currency_value']),
            	   'value' => $value);
}
		/// END MODIFICATION

So basically to have a new order total module that I can install and activate which will include the Sub-Total + shipping, and then this will be called the new "sub-total" and be used as the basis to calculate tax. Since all my products are taxable it doesn't really matter if zencart checks each product included in sub-total for tax class, although for a good sub-total+shipping module it should. Potentially tax could still be calculated from the new Merchandise (the old sub-total) and then added to this could be the tax on the difference between Subtotal and merchandise, and all that summed in one line. Is there anything you can recommend? My site is already live so I'd like to fix this ASAP!

Thanks!

26 Jul 2007, 10:14 PM
#2
kitiarachan avatar

kitiarachan

New Zenner

Join Date:
Jul 2007
Posts:
2
Plugin Contributions:
0

Re: How can sub-total include shipping??

Ok, I changed the tax class in shipping and now the tax is worked out correctly:

Sub-Total: $3.49
Zone Rates (Shipping to CA): $2.10 CDN
6.0% GST: $0.33 CDN
7.0% PST: $0.39 CDN
Total: $6.31 CDN

But I'd still like to get that extra line with subtotal+shipping. Doesn't seem to need to be a module, maybe just an addition to this page's output?

26 Jul 2007, 11:24 PM
#3
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,747
Plugin Contributions:
56

Re: How can sub-total include shipping??

You can change the order of sort for these lines in admin->modules->order total. Put shipping above (a lower number) subtotal and see if you like that better.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

6 Nov 2007, 2:44 PM
#4
gregml avatar

gregml

New Zenner

Join Date:
Oct 2007
Posts:
9
Plugin Contributions:
0

Re: How can sub-total include shipping??

It doesn't work for me, maybe there are other settings that prevent it to happen?

If you want to visit my shop, a live example of Zen Cart check it out here:
http://www.ringsndiamonds.com
Not yet fully functional, but I'll appreciate your input.

6 Nov 2007, 2:48 PM
#5
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,747
Plugin Contributions:
56

Re: How can sub-total include shipping??

I had this mixed up with payment module sorting behavior; disregard my remarks.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.