Community Forums

Minimum shipping amount

General discussion about OpenCart - Only post here if you can't place it on any other board.

Minimum shipping amount

Postby cirrussky » Fri May 25, 2012 7:38 am

Was wondering if there is a way to set a minimum shipping amount. Say if shipping is calculated at $2.50, but minimum is set to $5.00, it will change the shipping to $5.00 on the checkout. Is there a place to set this in OC, or is there an extension that will do this.

Thanks!
cirrussky
 
Posts: 21
Joined: Tue Feb 28, 2012 7:30 am

Re: Minimum shipping amount

Postby Johnathan » Fri May 25, 2012 2:18 pm

All of my shipping extensions (http://www.getclearthinking.com/shipping-methods) include a "Final Cost Min" field, which works as you describe. What type of shipping setup do you have? How do you calculate your rates?
Image
ImageImageImageImageImageImageImageImageImage
User avatar
Johnathan
Global Moderator
 
Posts: 2864
Joined: Thu Dec 17, 2009 7:08 pm

Re: Minimum shipping amount

Postby cirrussky » Fri May 25, 2012 4:27 pm

I only use USPS and UPS and the shipping is calculated from them.
cirrussky
 
Posts: 21
Joined: Tue Feb 28, 2012 7:30 am

Re: Minimum shipping amount

Postby Johnathan » Sat May 26, 2012 9:46 pm

In that case, you'll have to modify the actual USPS and UPS files. You can try making this code change, although I haven't tested it and can't guarantee it will work:

Code: Select all
IN:
/
catalog/model/shipping/usps.php
/catalog/model/shipping/ups.php

BEFORE ALL INSTANCES OF
:
$quote_data[

ADD:
if ($cost < 5.50) $cost = 5.50; 

Replace 5.50 with your minimum shipping amount.
Image
ImageImageImageImageImageImageImageImageImage
User avatar
Johnathan
Global Moderator
 
Posts: 2864
Joined: Thu Dec 17, 2009 7:08 pm

Re: Minimum shipping amount

Postby cirrussky » Sat Jun 02, 2012 9:45 am

Thanks, will give that a try and see if it works.
cirrussky
 
Posts: 21
Joined: Tue Feb 28, 2012 7:30 am

Re: Minimum shipping amount

Postby cirrussky » Sat Jun 02, 2012 10:04 am

I tried what you said and got this error on both of the files.

Parse error: syntax error, unexpected T_STRING in /home/pagancre/public_html/catalog/model/shipping/usps.php on line 1

any idea why it is doing that?
Thanks!
cirrussky
 
Posts: 21
Joined: Tue Feb 28, 2012 7:30 am

Re: Minimum shipping amount

Postby Johnathan » Sat Jun 02, 2012 1:18 pm

Did you place the code on its own line? It should be on its own line.

Other than that, I can only say make sure you copied and pasted it right. I haven't tested it, but it should work if placed correctly.
Image
ImageImageImageImageImageImageImageImageImage
User avatar
Johnathan
Global Moderator
 
Posts: 2864
Joined: Thu Dec 17, 2009 7:08 pm

Re: Minimum shipping amount

Postby cirrussky » Sat Jun 02, 2012 9:59 pm

yes, i put it on it's own seperate line. above the code you showed.

Was there suppose to only the code that you were showing, because there were other code behind the [ in the file. will give it another try, or can i send you the files and get you to put the code in. I am kinda new to this, so i may be doing something wrong.

thanks!!!
cirrussky
 
Posts: 21
Joined: Tue Feb 28, 2012 7:30 am

Re: Minimum shipping amount

Postby cirrussky » Sat Jun 02, 2012 10:02 pm

this is an one of the spots i entered it into.

Code: Select all
if ($this->config->get('ups_' strtolower($this->config->get('ups_origin')) . '_' $code)) {
    if (
$cost 5.50$cost 5.50;
    
$quote_data[$code] = array( 

is this how it should be?
thanks!!!!
Last edited by Johnathan on Sun Jun 03, 2012 1:13 pm, edited 1 time in total.
Reason: Added [code] tags for readability
cirrussky
 
Posts: 21
Joined: Tue Feb 28, 2012 7:30 am

Re: Minimum shipping amount

Postby Johnathan » Sun Jun 03, 2012 1:14 pm

Yes, that's right. I just tested it out, and it works fine for me.
Image
ImageImageImageImageImageImageImageImageImage
User avatar
Johnathan
Global Moderator
 
Posts: 2864
Joined: Thu Dec 17, 2009 7:08 pm

Re: Minimum shipping amount

Postby cirrussky » Mon Jun 04, 2012 6:20 am

hmmm, don't know what is going on.. tried it again and still getting the same errors. any ideas?? can you send me a copy of yours and let me try them?
cirrussky
 
Posts: 21
Joined: Tue Feb 28, 2012 7:30 am

Re: Minimum shipping amount

Postby Johnathan » Mon Jun 04, 2012 12:15 pm

Here's the 1.5.3 version of /catalog/model/shipping/ups.php. It literally only has the change I mentioned, so I'm not sure why it would work for me but not you. You should make sure you're not getting any other errors without the mod. Other than that I'm not sure what to tell you.
Attachments
ups.php
(12.42 KiB) Downloaded 24 times
Image
ImageImageImageImageImageImageImageImageImage
User avatar
Johnathan
Global Moderator
 
Posts: 2864
Joined: Thu Dec 17, 2009 7:08 pm

Re: Minimum shipping amount

Postby cirrussky » Tue Jun 05, 2012 6:47 am

will this work with 1.5.2.1, i will give it a try and see.
thanks!!
cirrussky
 
Posts: 21
Joined: Tue Feb 28, 2012 7:30 am

Re: Minimum shipping amount

Postby cirrussky » Tue Jun 05, 2012 6:25 pm

Hi,

tried the PHP file you posted on my site which i run 1.5.2.1. still didn't work was getting a different error in line 49 of the file. will keep playing with it and maybe i can eventually get it to work.
cirrussky
 
Posts: 21
Joined: Tue Feb 28, 2012 7:30 am


Return to General Discussion

Who is online

Users browsing this forum: adamkurniawan, deltaguns and 21 guests

Hosted by Arvixe Web Hosting