uShop English (U.S.) for 179!

uStorekeeper English (U.S.) for 149!

 Tech Support
       Support Policy
       Knowledge Base
       Reference Sites
       Software Piracy
       Legal Notices
       Privacy Policy
       Reseller Info
       Contact Us
       Site Map
Shipping Charges Question

Knowledge Base Lobby : uShop Support Conference : Tax, Shipping, and Handling Questions
Aug-17-18 01:42 PM EST
Original Message
Shipping Charges Question
Author Bradley Edwards on 09-20-2000 at 06:58 (EST)

I would like to setup something similar to the "Subtotal Table" except I would like to use percentages instead of a dollar amount. Can this be done in the "Subtotal Table"?

I might be able to do figure it out in the script but the documentation is not real clear (for me). I can do some scripting but am by no means a wiz. Where exactly would I start the customization at?

Do I actually modify the script itself or would I enter the coding in the window where you select "Custom Script".

If I edit the script itself where exactly would I start the coding? - Right after all the variables?

This is what I'm looking to do:

$0.00 - $124.00 = $6
$125.00 - $399.00 = 4%
$400.00 - $699.00 = 3.5%
$700.00 - $999.00 = 3%
$1,000.00 and over = 2.5%

would this coding work?:

if ($totals_subtotal1 > 125 && < 399) {
$ret_value = ($totals_subtotal1 * .04);

} elseif ($totals_subtotal1 > 400 && < 699) {
$ret_value = ($totals_subtotal1 * .035);

} elseif ($totals_subtotal1 > 700 && < 999) {
$ret_value = ($totals_subtotal1 * .03);

} elseif ($totals_subtotal1 > 1000) {
$ret_value = ($totals_subtotal1 * .025);

} else {$ret_value = "6";}

Bradley Edwards

Table Of Contents
  RE: Shipping Charges Question Bill Weiner, 2000-09-20 13:46:59 (1)
            Shipping Modifier Bradley Edwards, 2000-09-21 06:14:31 (2)
                 RE: Shipping Modifier Bill Weiner, 2000-09-21 13:54:55 (3)
                      Shipping Modifier Bradley Edwards, 2000-09-21 23:07:26 (4)
                           Shipping Modifier Bradley Edwards, 2000-09-25 19:19:01 (5)
                                RE: Shipping Modifier Bill Weiner, 2000-09-26 12:17:57 (6)
                                     RE: Shipping Modifier Bradley Edwards, 2000-09-28 00:48:20 (7)
                                          RE: Shipping Modifier Bill Weiner, 2000-09-28 10:47:42 (8)
                                               RE: Shipping Modifier Bradley Edwards, 2000-09-29 14:42:33 (9)

Messages In This Discussion
         1. RE: Shipping Charges Question
        Author Bill Weiner on 09-20-2000 at 13:46 (EST)
I agree, our documentation concerning implementing custom shipping calculations could be a little more clearer.

To answer you question, yes, you actually do modify the script. (That is why we left all of the comments in that script... to help identify the customizable subroutines and variables).

To implement a custom shipping method you would:

1) Begin by using any text editor (such as WordPad) to open "" script.

2) Once that script is opened, do a search on the "sub custom_shipping" subroutine. (This is the subroutine that is called for all shipping methods that have the "Calculation Type" set to "CUSTOM").

3) Simply insert your custom Perl code into that subroutine.

4) Save the file (as text if your editor asks)... and try it out!

As for the actual Perl code that could implement percent table:

$0.00 - $124.00 = $6
$125.00 - $399.00 = 4%
$400.00 - $699.00 = 3.5%
$700.00 - $999.00 = 3%
$1,000.00 and over = 2.5%

Your code was pretty close....just a couple syntax changes.

For some reason, this forum is not letting me POST the code here ... but just send us an email at and I'll send you the code for the above table.
                 2. Shipping Modifier
                Author Bradley Edwards on 09-21-2000 at 06:14 (EST)
Bill, thanks for the syntax fixes! The script seems to work fine, although I do have another problem and not just with the custom scripting.

For the custom script I added:
$ret_value += $totals_shipping_modifier;
as suggested but the shipping_modifier fees are not being added to the "Shipping & Handling" total.

I also have a shipping selection setup with a "Subtotal Formula" and it's not coming through in there either.

From what I read, all I should have to do is set the charge in the applet. Correct? Or is there something else I need to set to get it to work.

Thanks Again.
Bradley Edwards
                         3. RE: Shipping Modifier
                        Author Bill Weiner on 09-21-2000 at 13:54 (EST)
The shipping modifier is calculated by summing the "shipping_modifier" of all items in the shopping cart. If the applets for any of the items in the shopping cart did not have the "shipping_modifer" parameter specified, then it will be assumed to have a shipping modifier value of $0.00 for those particular items.

With that in mind, for any of the standard shipping calculation methods (including the Subtotal Formula), the shipping total will first be computed via the specified calculation method and then the "shipping_modifier" (if any) will be added to the shipping total.

So in other words, providing you added some items to the shopping cart which did have a value specified for their "shipping_modifier" parameter.... then that shipping modifier should be added to the results of your shipping calculation.

So double-check that the items that you are ordering do indeed have the "shipping_modifier" set.... and that the "shipping_modifier" parameter is spelled/setup correctly... and see if you are still not seeing the modifier added to the calculated shipping costs.

If not, give me the URL and I will take a look at it.
                                 4. Shipping Modifier
                                Author Bradley Edwards on 09-21-2000 at 23:07 (EST)
HI Bill,

The coding for the applet was simply copied and pasted from the applet reference. But I did do a check on the spelling and it is correct.

The URL is, there is 2 applets on the page (the "Order Now" button) the one at the top is set with the "shipping_modifer" at $3.00 the one at the bottom is set to $0.00.

I have set a "TEST" shipping mode that does not add any shipping. You can use this to check it out. For me it does not add the "modifier". I tried it in both Explorer and Netscape, same thing.

Keep me posted. Thanks again!
Bradley Edwards
                                         5. Shipping Modifier
                                        Author Bradley Edwards on 09-25-2000 at 19:19 (EST)
Hello Bill,

Just wondering if anything regarding my previous post was discovered.

Thanks in advance.
Bradley Edwards
                                                 6. RE: Shipping Modifier
                                                Author Bill Weiner on 09-26-2000 at 12:17 (EST)
I took a look at your site... and could indeed verify that the "shipping_modifier" being posted to the uShop CGI script is still 0.0.... so the problem must be occuring on the Java-side. So then I took a look at your HTML... and everything does appear fine ... with the exception that you have two applets on that page with the exact same settings (ID, Name, Description, etc)... except one has a "shipping_modifier" set to "$3.00" ... and the other has a "shipping_modifier" set to "$0.00". In theory, this shouldn't cause a problem (even if the IDs are the same).... so there may indeed be something weird going on on the Java side. I will take a look at the Java code a little later today... and if necessary, we'll get any correction related to that in an applet release that is scheduled for later this week.

... will let you know...
                                                         7. RE: Shipping Modifier
                                                        Author Bradley Edwards on 09-28-2000 at 00:48 (EST)

Thanks a bunch!! I did intentionally do the appletts that way so that you could "experiment", one with & one without!

So keep me posted...

Thanks again,
Bradley Edwards
                                                                 8. RE: Shipping Modifier
                                                                Author Bill Weiner on 09-28-2000 at 10:47 (EST)
After further investigation here, we eventually did find the problem. A fix has been implemented and is currently being tested at:

(See test item 5)

So it should be in the next applet release - to which we are still doing some other tests on - but should be available early next week.
                                                                         9. RE: Shipping Modifier
                                                                        Author Bradley Edwards on 09-29-2000 at 14:42 (EST)
Thanks Bill, Looking forward to it!

Bradley Edwards

© 2003 Microburst Technologies, Inc.