Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#1 06-09-2003 09:59:29

Guest
Guest

$3 shipping for 1st Item...$1 for additional?

I have a client who sells books online and his shipping method is to charge $3 for the first book and $1 for each additional book.

Is there a way to do this easily using the  custom shipping option?  My knowlege of  Perl is pretty limited.

Thanks,

Bob S.

 

#2 06-09-2003 18:03:25

BooBoo
Member
From: Anaheim, CA
Registered: 07-25-2003
Posts: 147
Website

Re: $3 shipping for 1st Item...$1 for additional?

In ste_shipcus_quan, replace all the code with this:

#########
######### This script bases price on the quantity of
######### items in the cart.  There is a charge per item.
#########
######### A listing of available variables:
#########
######### $ship_items_found     Count Of shippable items
#########
######### $ship_methods_found   Count of items with a
#########                       shipping method already
#########
######### $cart_items_found     Count of rows in the cart
#########
######### $cart_quantity_found  Total quantity of items
#########                       in the cart
#########
######### $tracking_subtotal    Subtotal of the prices for
#########                       all items in the cart
#########
######### $cart_total_weight    Total weight of all items
#########                       in the cart in pounds.
#########
######### Directly below, enter in the name for this
######### method to be displayed to the user.
#########

my $ship_meth_name = "Standard Carrier";
my $price_per_item = "1.00";
my $ship_total = "0.00";
my $ship_total1 = "0.00";
my $ship_display = "";
my $ship_quantity = "0";

#########
######### Figure out what the shipping charge will be by
######### multiplying the weight by the price per item.
#########

if ($cart_quantity_found = "1") {
$ship_total = "3.00";
} else {
$ship_quantity = (cart_quantity_found - 1);
$ship_total1 = ($ship_quantity * $price_per_item)
$ship_total = (ship_total1 + "3.00");
} ######### end of if statement

#########
######### Format the $ship_total as a price.
#########

$ship_total = sprintf("%.2f", $ship_total);

#########
######### Create the display based on the price.
#########

if ($ship_total > "0") {

$ship_display = "$ship_meth_name - $currency_symbol$ship_total";

} else {

$ship_display = "$ship_meth_name - FREE";

} ######### End of if statement.

#########
######### Print the HTML display for the shipping
######### charge.
#########

print <<ENDOFTEXT;

<CENTER>

<TABLE WIDTH="100%" CELLPADDING="10" CELLSPACING="3">

<TR BGCOLOR="$html_pri_tablerow_color">

<TD VALIGN="TOP"><FONT FACE="$html_small_font_face" SIZE="$html_small_font_size" COLOR="$html_small_font_color"><B>Shipping Method</B> <FONT COLOR="$html_notnull_font_color"><B>$html_notnull_character</B></FONT><BR><BR></FONT>

<INPUT TYPE="RADIO" NAME="shipinfo" VALUE="$ship_meth_name:$ship_total" CHECKED> <FONT FACE="$html_base_font_face" SIZE="$html_base_font_size" COLOR="$html_base_font_color">

$ship_display

</FONT></TD>

</TR>

</TABLE>

</CENTER>

<BR>

ENDOFTEXT

I am sure that others can/will trim this code down, but I am doing this on the fly.


--
Keith Roberts
IT Manager
Laptops For Less, Inc
keith@getadeal.com
<a href="http://www.laptopsforless.com">Your source for laptop batteries, pda batteries, digital camera batteries, cell phone batteries, and accessories</a>

Offline

 

#3 06-11-2003 10:03:42

Guest
Guest

Re: $3 shipping for 1st Item...$1 for additional?

I'm not sure why...but I can't get to work.

On the Manage Shipping page, I enabled Custom Method and Calculation on Total Order Quantity. What other settings do I need to make this work?

 

#4 06-17-2003 23:49:11

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19756
Website

Re: $3 shipping for 1st Item...$1 for additional?

The line:

$ship_quantity = (cart_quantity_found - 1);

Should be:

$ship_quantity = ($cart_quantity_found - 1);

___________________________

Nick Hendler
Webmaster, Kryptronic, Inc.


Nick Hendler

Offline

 

#5 07-13-2003 11:04:33

alfaxca
Member
Registered: 07-08-2003
Posts: 11

Re: $3 shipping for 1st Item...$1 for additional?

replace $cart_quantity_found = "1" with $cart_quantity_found eq "1"

Offline

 

#6 07-14-2003 19:03:33

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19756
Website

Re: $3 shipping for 1st Item...$1 for additional?

If fixed this via email today.  A couple of variable names were wrong. 

___________________________

Nick Hendler
Webmaster, Kryptronic, Inc.


Nick Hendler

Offline

 

Board footer