Post by Geek » Wed May 21, 2008 2:45 pm

Hello,

I was wondering, is there a way of calculating the shipping and handling cost by taking the dollar amount total of an order and multiplying it by a percentage that is based upon a zone that uses the postal code to find the zone? I would also need to do this for multiple shipping possibilities. So, Ground would be one percentage and Rush would be another percentage that would show up on the checkout_shipping page so the customer would be able to chose which shipping method they would prefer. I have tried setting up different Zones, but I seem to get lost and confused when trying to set it up involving the postal codes. Any help would be great.

I am in the US for all those that would need to know

Example:

Say the total amount of the order is $623.75 and the zone for the postal code requires a 10% add on to the cost for shipping and handling for ground and 15% for Rush. So, we would take .10 x 623.75 = 62.375 and .15 x 623.75 = 155.9375 and then display it on the shipping page for the customer to choose.

I hope I explained this properly. Lol

~Simplygeek.net


New member

Posts

Joined
Sat May 17, 2008 1:00 pm
Location - Cyberspace, the final frontier...

Post by bruce » Wed May 21, 2008 5:43 pm

You appear to be describing "subtotal combined with zone" based shipping. I am happy to be contradicted but I think you will need to roll your own shipping extension based on code in the subtotal based shipping contribution and the zone based shipping module.

Active Member

Posts

Joined
Wed Dec 12, 2007 2:26 pm

Post by Geek » Fri May 23, 2008 3:39 am

Okay, well is there a way to edit the "Subtotal Shipping" module to include a percentage instead of a dollar amount?

I have been looking at it for hours and I think that I would change the file 'catalog\extension\shipping\subtotal.php' and I would change the code somewhere in here:

Code: Select all

$quote_data['subtotal'] = array(
                'id'    => 'subtotal_subtotal',
                'title' => $this->language->get('text_subtotal_description'),
                'cost'  => $cost,
                'text'  => $this->currency->format($this->tax->calculate($cost, $this->config->get('subtotal_tax_class_id'), $this->config->get('config_tax')))
              );

              $method_data = array(
                'id'           => 'subtotal',
                'title'        => $this->language->get('text_subtotal_title'),
                'quote'        => $quote_data,
                'tax_class_id' => $this->config->get('subtotal_tax_class_id'),
                'sort_order'   => $this->config->get('subtotal_sort_order'),
                'error'        => false
I am still new to PHP and any help would be great. Thanks. And I do apologize if I am a hassle or bother to anyone here.

~Simplygeek.net


New member

Posts

Joined
Sat May 17, 2008 1:00 pm
Location - Cyberspace, the final frontier...

Post by Luvz2drv » Fri May 23, 2008 9:26 am

You would not want to change the subtotal.php

you would want to extend or change the actual shipping module

hope this helps to point you in the right direction

Global Moderator

Posts

Joined
Fri Mar 21, 2008 10:58 am

Post by Luvz2drv » Fri May 23, 2008 9:55 am

Found this -- thought i seen this

http://www.opencart.com/contribution/in ... tion_id/49

subtotal shipping mod

Global Moderator

Posts

Joined
Fri Mar 21, 2008 10:58 am

Post by Geek » Fri May 23, 2008 11:30 pm

Luvz2drv wrote: You would not want to change the subtotal.php

you would want to extend or change the actual shipping module

hope this helps to point you in the right direction
Luvz2drv wrote: Found this -- thought i seen this

http://www.opencart.com/contribution/in ... tion_id/49

subtotal shipping mod
I am basing the changes on the "Subtotal Shipping" module.

The code that I posted is from the actual shipping module for the "Subtotal Shipping" module and all I am trying to do is add to it, the ability to use percentages in the shipping rates. I know that it is possible cause I have seen it in other modifications and modules on other CMS Cart systems. But, like I said before, I am fairly new to editing and writing modules in PHP, so any help would be wonderful.

~Simplygeek.net


New member

Posts

Joined
Sat May 17, 2008 1:00 pm
Location - Cyberspace, the final frontier...

Post by April » Fri Jul 18, 2008 2:55 am

I'm very interested in this as well. 

Does anyone have this PHP code of how to add shipping price based on percentage of order total in the cart and shipping option? 

I am new to open cart and a PHP scripting newblet and trying to wrap my head around this is making me craZY!  :o

Newbie

Posts

Joined
Fri Jul 18, 2008 2:42 am

Post by bruce » Fri Jul 18, 2008 7:54 am

Hi April,

You should write and provide a specification of what you want that shows the choices and results etc in detail.

Then someone could answer you better.

Active Member

Posts

Joined
Wed Dec 12, 2007 2:26 pm

Post by April » Fri Jul 18, 2008 8:09 am

Thank you Bruce.  I will try to explain better.

I need the shipping to be calculated in the cart.

I would like it to have two choices for shipping, Rush Delivery or Standard Ground.

Each shipping choice should apply a percentage to the total order in the cart (before tax) on a sliding scale.

For example, paypal allows me to put .01 to 100/10%, 100.01 to 300.00/12%, etc. 

I can't use the paypal shipping calculation in my account because it will apply to all my websites that are different, which is why I would like a shipping module to make the cart do this before being transfered to paypal for payment processing.

So if anyone has something like this I would appreciate a copy :)

Newbie

Posts

Joined
Fri Jul 18, 2008 2:42 am

Post by Geek » Thu Aug 14, 2008 1:07 pm

Anybody? Any help at all?

~Simplygeek.net


New member

Posts

Joined
Sat May 17, 2008 1:00 pm
Location - Cyberspace, the final frontier...

Post by Luvz2drv » Thu Aug 14, 2008 2:05 pm

yes i build a custom module for April - works just as she wanted...

if your interested feel free to pm me

Jonathon

Global Moderator

Posts

Joined
Fri Mar 21, 2008 10:58 am
Who is online

Users browsing this forum: No registered users and 7 guests