<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ZZZZZZZZZ &#187; zen-cart</title>
	<atom:link href="http://zzzzzzzzz.net/tag/zen-cart/feed" rel="self" type="application/rss+xml" />
	<link>http://zzzzzzzzz.net</link>
	<description>The internet and other bits</description>
	<lastBuildDate>Sat, 17 Apr 2010 00:44:02 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Add a percentage based fee to the shipping total in Zen-Cart&#8217;s UPS shipping module</title>
		<link>http://zzzzzzzzz.net/add-a-percentage-based-fee-to-the-shipping-total-in-zen-carts-ups-shipping-module</link>
		<comments>http://zzzzzzzzz.net/add-a-percentage-based-fee-to-the-shipping-total-in-zen-carts-ups-shipping-module#comments</comments>
		<pubDate>Wed, 15 Apr 2009 19:20:40 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
				<category><![CDATA[e-commerc]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[zen-cart]]></category>

		<guid isPermaLink="false">http://zzzzzzzzz.net/?p=18</guid>
		<description><![CDATA[The default UPS shipping module for zen-cart allows the store owner to add a flat rate "shipping and handling fee" to orders.  I wanted to add a percentage to the shipping total instead of a flat rate for every order.
Here is a short snippet which worked worked for me.
Edit includes/modules/shipping/ups.php
Find the line

  // EOF: [...]]]></description>
			<content:encoded><![CDATA[<p>The default UPS shipping module for zen-cart allows the store owner to add a flat rate "shipping and handling fee" to orders.  I wanted to add a percentage to the shipping total instead of a flat rate for every order.</p>
<p>Here is a short snippet which worked worked for me.</p>
<p>Edit includes/modules/shipping/ups.php</p>
<p>Find the line</p>
<pre name="code" class="php">
  // EOF: UPS USPS
    $methods[] = array('id' => $type,
                           'title' => $this->types[$type],
                           'cost' => ($cost + MODULE_SHIPPING_UPS_HANDLING) * $shipping_num_boxes)
</pre>
<p>and replace it with:</p>
<pre name="code" class="php">
  // EOF: UPS USPS
  // calculate order total less free shipping
        $order_total_amount = $_SESSION['cart']->show_total() - $_SESSION['cart']->free_shipping_prices() ;
        $percentage_added = $cost * .15;

        $methods[] = array('id' => $type,
                           'title' => $this->types[$type],
                           'cost' => (($cost + MODULE_SHIPPING_UPS_HANDLING) * $shipping_num_boxes) + $percentage_added );
</pre>
<p>Update the percentage to whatever you need in this case I'm using 15%, see the .15</p>
<p>This should also be applicable to other shipping modules.</p>
]]></content:encoded>
			<wfw:commentRss>http://zzzzzzzzz.net/add-a-percentage-based-fee-to-the-shipping-total-in-zen-carts-ups-shipping-module/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
