Results 1 to 2 of 2
  1. #1
    Newbie
    Join Date
    January 18th, 2005
    Posts
    2
    I have a perl program that I changed and it is working wrong. I don't where the problem is in the script. Here is the unchanged one:

    #######################################################################
    # Sub Site Store Shipping Custom #
    #######################################################################

    sub site_store_shipping_custom {

    $custom_shipping_method_name = "Standard";
    $ship_calc_total = "$final_form_display_order_subtotal";
    $ship_total_quantity = "$form_display_total_quantity";
    $ship_total_weight = "$form_display_total_weight";

    if ($ship_calc_total >= "0" && $ship_calc_total <= "9.99") {

    $temp_shipping_total = "2.50";

    } elsif ($ship_calc_total > "9.99" && $ship_calc_total <= "15.99") {

    $temp_shipping_total = "3.95";

    } elsif ($ship_calc_total > "15.99" && $ship_calc_total <= "49.99") {

    $temp_shipping_total = "5.00";

    } else {

    $temp_shipping_total = "0.00";

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

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

    print <<ENDOFTEXT;

    <INPUT TYPE="HIDDEN" NAME="trship" VALUE="$custom_shipping_method_name\:\:$shipping_total">

    ENDOFTEXT

    if ($shipping_total ne "0.00") {

    print <<ENDOFTEXT;

    There is currently one available shipping option. The cost to ship your order is $currency_symbol$shipping_total.<BR><BR>

    ENDOFTEXT

    } else {

    $display_amount = "50.00";

    print <<ENDOFTEXT;

    There is currently one available shipping option. Because your order exceeds $currency_symbol$display_amount, your shipping is FREE.<BR><BR>

    ENDOFTEXT

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

    }

    #######################################################################
    # Return True Value For End Of File #
    #######################################################################

    1;


    and now here is the one that I had changed:

    #######################################################################
    # Sub Site Store Shipping Custom #
    #######################################################################

    sub site_store_shipping_custom {

    $custom_shipping_method_name = "Standard";
    $ship_calc_total = "$final_form_display_order_subtotal";
    $ship_total_quantity = "$form_display_total_quantity";
    $ship_total_weight = "$form_display_total_weight";

    if ($ship_calc_total >= "0" && $ship_calc_total <= "14.99") {

    $temp_shipping_total = "4.25";

    } elsif ($ship_calc_total > "15.00" && $ship_calc_total <= "19.99") {

    $temp_shipping_total = "4.55";

    } elsif ($ship_calc_total > "20.00" && $ship_calc_total <= "24.99") {

    $temp_shipping_total = "4.85";

    } elsif ($ship_calc_total > "25.00" && $ship_calc_total <= "29.99") {

    $temp_shipping_total = "5.75";

    } elsif ($ship_calc_total > "30.00" && $ship_calc_total <= "34.99") {

    $temp_shipping_total = "6.35";

    } elsif ($ship_calc_total > "35.00" && $ship_calc_total <= "39.99") {

    $temp_shipping_total = "7.35";

    } elsif ($ship_calc_total > "40.00" && $ship_calc_total <= "44.99") {

    $temp_shipping_total = "8.20";

    } elsif ($ship_calc_total > "45.00" && $ship_calc_total <= "49.99") {

    $temp_shipping_total = "9.00";

    } elsif ($ship_calc_total > "50.00" && $ship_calc_total <= "64.99") {

    $temp_shipping_total = "9.95";

    } elsif ($ship_calc_total > "65.00" && $ship_calc_total <= "74.99") {

    $temp_shipping_total = "10.95";

    } else {

    $temp_shipping_total = "0.00";

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

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

    print <<ENDOFTEXT;

    <INPUT TYPE="HIDDEN" NAME="trship" VALUE="$custom_shipping_method_name\:\:$shipping_total">

    ENDOFTEXT

    if ($shipping_total ne "0.00") {

    print <<ENDOFTEXT;

    The cost to ship your order is $currency_symbol$shipping_total.<BR><BR>

    ENDOFTEXT

    } else {

    $display_amount = "75.00";

    print <<ENDOFTEXT;

    Because your order exceeds $currency_symbol$display_amount, your shipping is FREE.<BR><BR>

    ENDOFTEXT

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

    }

    #######################################################################
    # Return True Value For End Of File #
    #######################################################################

    1;


    Can someone please help me with this?


    Charles
    perlhelp2002@yahoo.com

  2. #2
    Newbie
    Join Date
    January 18th, 2005
    Posts
    2
    I finally figured out what was wrong with the code. That is what I get for not knowing Perl much.

    <BLOCKQUOTE class="ip-ubbcode-quote"><font size="-1">quote:</font><HR>Originally posted by Charles25:
    I have a perl program that I changed and it is working wrong. I don't where the problem is in the script. Here is the unchanged one:

    #######################################################################
    # Sub Site Store Shipping Custom #
    #######################################################################

    sub site_store_shipping_custom {

    $custom_shipping_method_name = "Standard";
    $ship_calc_total = "$final_form_display_order_subtotal";
    $ship_total_quantity = "$form_display_total_quantity";
    $ship_total_weight = "$form_display_total_weight";

    if ($ship_calc_total &gt;= "0" && $ship_calc_total &lt;= "9.99") {

    $temp_shipping_total = "2.50";

    } elsif ($ship_calc_total &gt; "9.99" && $ship_calc_total &lt;= "15.99") {

    $temp_shipping_total = "3.95";

    } elsif ($ship_calc_total &gt; "15.99" && $ship_calc_total &lt;= "49.99") {

    $temp_shipping_total = "5.00";

    } else {

    $temp_shipping_total = "0.00";

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

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

    print &lt;&lt;ENDOFTEXT;

    &lt;INPUT TYPE="HIDDEN" NAME="trship" VALUE="$custom_shipping_method_name\:\:$shipping_total"&gt;

    ENDOFTEXT

    if ($shipping_total ne "0.00") {

    print &lt;&lt;ENDOFTEXT;

    There is currently one available shipping option. The cost to ship your order is $currency_symbol$shipping_total.&lt;BR&gt;&lt;BR&gt;

    ENDOFTEXT

    } else {

    $display_amount = "50.00";

    print &lt;&lt;ENDOFTEXT;

    There is currently one available shipping option. Because your order exceeds $currency_symbol$display_amount, your shipping is FREE.&lt;BR&gt;&lt;BR&gt;

    ENDOFTEXT

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

    }

    #######################################################################
    # Return True Value For End Of File #
    #######################################################################

    1;


    and now here is the one that I had changed:

    #######################################################################
    # Sub Site Store Shipping Custom #
    #######################################################################

    sub site_store_shipping_custom {

    $custom_shipping_method_name = "Standard";
    $ship_calc_total = "$final_form_display_order_subtotal";
    $ship_total_quantity = "$form_display_total_quantity";
    $ship_total_weight = "$form_display_total_weight";

    if ($ship_calc_total &gt;= "0" && $ship_calc_total &lt;= "14.99") {

    $temp_shipping_total = "4.25";

    } elsif ($ship_calc_total &gt; "15.00" && $ship_calc_total &lt;= "19.99") {

    $temp_shipping_total = "4.55";

    } elsif ($ship_calc_total &gt; "20.00" && $ship_calc_total &lt;= "24.99") {

    $temp_shipping_total = "4.85";

    } elsif ($ship_calc_total &gt; "25.00" && $ship_calc_total &lt;= "29.99") {

    $temp_shipping_total = "5.75";

    } elsif ($ship_calc_total &gt; "30.00" && $ship_calc_total &lt;= "34.99") {

    $temp_shipping_total = "6.35";

    } elsif ($ship_calc_total &gt; "35.00" && $ship_calc_total &lt;= "39.99") {

    $temp_shipping_total = "7.35";

    } elsif ($ship_calc_total &gt; "40.00" && $ship_calc_total &lt;= "44.99") {

    $temp_shipping_total = "8.20";

    } elsif ($ship_calc_total &gt; "45.00" && $ship_calc_total &lt;= "49.99") {

    $temp_shipping_total = "9.00";

    } elsif ($ship_calc_total &gt; "50.00" && $ship_calc_total &lt;= "64.99") {

    $temp_shipping_total = "9.95";

    } elsif ($ship_calc_total &gt; "65.00" && $ship_calc_total &lt;= "74.99") {

    $temp_shipping_total = "10.95";

    } else {

    $temp_shipping_total = "0.00";

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

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

    print &lt;&lt;ENDOFTEXT;

    &lt;INPUT TYPE="HIDDEN" NAME="trship" VALUE="$custom_shipping_method_name\:\:$shipping_total"&gt;

    ENDOFTEXT

    if ($shipping_total ne "0.00") {

    print &lt;&lt;ENDOFTEXT;

    The cost to ship your order is $currency_symbol$shipping_total.&lt;BR&gt;&lt;BR&gt;

    ENDOFTEXT

    } else {

    $display_amount = "75.00";

    print &lt;&lt;ENDOFTEXT;

    Because your order exceeds $currency_symbol$display_amount, your shipping is FREE.&lt;BR&gt;&lt;BR&gt;

    ENDOFTEXT

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

    }

    #######################################################################
    # Return True Value For End Of File #
    #######################################################################

    1;


    Can someone please help me with this?


    Charles
    perlhelp2002@yahoo.com<HR></BLOCKQUOTE>

  3. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. Allposters Perl
    By reaper in forum Cusimano.com Scripts
    Replies: 5
    Last Post: May 31st, 2005, 12:51 AM
  2. need some perl code...
    By SBTC in forum Programming / Datafeeds / Tools
    Replies: 14
    Last Post: July 30th, 2003, 06:27 AM
  3. Perl Help...
    By eggerda in forum Programming / Datafeeds / Tools
    Replies: 7
    Last Post: July 22nd, 2003, 05:40 AM
  4. Perl help.
    By mewmew in forum Programming / Datafeeds / Tools
    Replies: 2
    Last Post: October 10th, 2002, 03:41 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •