Post by Pagan » Tue Mar 04, 2008 8:23 am

Hi, all

I am a novice at using Opencart so please use as simple terminology as possible for me when answering!

I have a client who had a shopping cart website built using Opencart about 3 months ago, and would now like a change made regarding shipping based on the total invoice amount.

eg. total invoice $100 but <$200 cost $10 etc.

Since I didn't design the system using opencart for him, I'm not really sure of how I might implement this?  Writing a custom module is out of the question (due to the client budget) so I'm ideally looking for a way to do this using the existing systems available through Opencart.

thanks in advance

Newbie

Posts

Joined
Wed Feb 06, 2008 3:55 pm

Post by dahoule » Tue Mar 04, 2008 10:13 am

I am looking for exactly the same thing so I'm looking forward to see the responses!

- Don

Newbie

Posts

Joined
Tue Mar 04, 2008 10:01 am


Post by bruce » Wed Mar 05, 2008 4:52 pm

If...
  • you are not using discounts
  • you are not using options
  • the "order total" used to calculate the shipping rate does not include tax
You can trick the zone based shipping module into doing this for you by setting the weight of each item equal to its price and setting the "weight" and shipping cost ranges accordingly

eg: 50.00:5.00,100.0:8.50,150.0:9.50

gives you

$5 for $0 to $50 in order total etc

Active Member

Posts

Joined
Wed Dec 12, 2007 2:26 pm

Post by dahoule » Wed Mar 05, 2008 11:12 pm

Thanks Bruce. I'm finding the shipping configuration for OpenCart to be rather confusing.
bruce wrote: eg: 50.00:5.00,100.0:8.50,150.0:9.50

gives you

$5 for $0 to $50 in order total etc
So, my understanding is that this would give us:
  • $5 for $0 to $50
  • $8.50 for $50.01 to $100 (?)
  • $9.50 for $100.01 to $150 (?)
I am using options (many of them for each product!), but this may give me an idea about how to tweak the code to acoomplish what I want.

Maybe I need to write a module for cart subtotal-based shipping?

Thanks again!

- Don

Newbie

Posts

Joined
Tue Mar 04, 2008 10:01 am


Post by bruce » Thu Mar 06, 2008 8:17 am

Yes, your interpretation is correct. Note that over $150, the shipping would be zero because that is what the zone module returns when it runs out of ranges. To set an upper limit, you would finish the range list with a really large order total value

eg: to set greater than $150 to a cap of $12

50.00:5.00,100.0:8.50,150.0:9.50,200000:12

I would recommend that you copy the zone module files, renaming as you go, to create a new subtotal-based shipping module. That way you will be able to include the effect of coupons, discounts and options.

Active Member

Posts

Joined
Wed Dec 12, 2007 2:26 pm

Post by Pagan » Sat Mar 08, 2008 10:39 am

Can someone post a quick run down of how to set this up?  Do I need to set up a new shipping extension?

Newbie

Posts

Joined
Wed Feb 06, 2008 3:55 pm

Post by bruce » Sun Mar 09, 2008 11:54 pm

The previous post was my quick run down on how to set this up as a new shipping extension.

Have a good look through the code for the zone based shipping module and you will see what I am talking about. You can compare what it is doing by looking at the (much simpler) COD shipping extension also. Between the two, there is enough to build on.

cheers

Active Member

Posts

Joined
Wed Dec 12, 2007 2:26 pm

Post by dahoule » Thu Apr 17, 2008 8:02 am

I got the subtotal-based shipping working. Once I had some time to sit down and really take a look at what was going on with the Zone shipping, this was a snap. I guess it's a tribute to the designer of opencart that these plugins are so easy to write.

Thank you to Bruce for pointing me in the right direction!

Newbie

Posts

Joined
Tue Mar 04, 2008 10:01 am


Post by interludedesign » Sat Apr 26, 2008 8:39 pm

Any chance you can share your code for others.


Posts

Joined
Mon Jan 07, 2008 8:14 am
Location - Essex

Post by jocroft » Sat Apr 26, 2008 11:45 pm

Code for this would be great for those of us still learning and not so confident.

Well done btw!

I know you think you understood what I said, but what you heard was not what I meant


New member

Posts

Joined
Thu Mar 13, 2008 9:03 pm
Location - England

Post by bruce » Sun Apr 27, 2008 12:14 pm

I think dahoule is reluctant to post his version because he knows I did the same thing for pagan as an urgent, paid contract. However, pagan has kindly offered to allow this to be released into the community. I have posted it as a contribution here. http://www.opencart.com/contribution/in ... tion_id/49

Active Member

Posts

Joined
Wed Dec 12, 2007 2:26 pm

Post by rwallin » Mon Jun 23, 2008 8:24 pm

Looks like a great mod but I am having issues in installing it. Once I've got it uploaded and permissions set properly I get the following message when I try to configure it.

Error: Template /.../admin/template/default/content/shipping_subtotal.tpl not found!

Newbie

Posts

Joined
Tue Jul 03, 2007 7:45 pm

Post by rwallin » Mon Jun 23, 2008 8:43 pm

Got it, template file in the zip has wrong directory structure.

It came across as admin\template\template\default\content so when i uploaded it created a new folder system in the template folder.

Moved it to proper place and it is working.
Thanks Bruce and Pagan!

Newbie

Posts

Joined
Tue Jul 03, 2007 7:45 pm
Who is online

Users browsing this forum: No registered users and 3 guests