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 09-07-2004 11:01:46

docflash
Member
Registered: 03-09-2004
Posts: 4

Need Help With Shipping Cost

I need help with custom shipping script, i need one that says $0.00 - 25.00 is $6.50  and all orders over $25.00 is figured at 10%   

Offline

 

#2 09-07-2004 14:29:41

docflash
Member
Registered: 03-09-2004
Posts: 4

Re: Need Help With Shipping Cost

Made one that works for those that might need one.



#########
######### This script bases price on the the cart subtotal
######### multiplied by a percentage.
#########
######### 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 $percentage = "10.500";
my $limit = "25.00";
my $flat_fee = "6.50";
my $ship_total = "0.00";
my $ship_display = "";

#########
######### Figure out what the shipping charge will be...
#########

if ($tracking_subtotal >= "$limit") {

$percentage = ($percentage / 100);

$ship_total = ($tracking_subtotal * $percentage);

} else {

$ship_total = "$flat_fee";
}

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

 

Board footer