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 10-25-2004 15:58:09

21Cinteractive
Member
Registered: 08-20-2003
Posts: 9

Calculation On Total Order Weight

Need help with shipping script. Using Calculation On Total Order Weight BUT script does not appear to be doing that.

For instance.... 1 product ordered, it's fine. 2 of the same ordered, still fine. But 2 different products ordered it bases shipping on each product rather than total order weight.

#########
######### This script bases price on the cart weight.
######### There is a charge per pound.
#########
######### 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_pound = "1.00";
my $ship_total = "0.00";
my $ship_display = "";

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

$ship_total = ($price_per_pound * $cart_total_weight);

#########
######### 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 :-( 

Offline

 

#2 10-27-2004 09:58:31

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

Re: Calculation On Total Order Weight

Are you sure this custom script is being used for both products?


Nick Hendler

Offline

 

Board footer