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.
We use the following custom script in a CCP4 cart and want to have the exact same shipping info appear in a CCP5.1 -- but I cannot figure out how to do it. PLEASE HELP!
The CCP4 custom script:
#######################################################################
# 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";
print <<ENDOFTEXT;
<table>
<tr><td colspan=1></td>
<td><input checked type=radio name=\"trship\" value=\"ground\:\:9.50\">Continental US Ground</td>
<td>(\$9.50)</td>
</tr>
<tr><td colspan=1></td>
<td><input type=radio name=\"trship\" value=\"2ndday\:\:19.50\">Continental US 2nd Day Air</td>
<td>(\$19.50)</td>
</tr>
<tr><td colspan=1></td>
<td><input type=radio name=\"trship\" value=\"hawaiialaska\:\:32.00\">Express Mail to Hawaii, Alaska, Puerto Rico</td>
<td>(We will contact you with exact shipping costs before sending your order)</td>
</tr>
<tr><td colspan=1></td>
<td><input type=radio name=\"trship\" value=\"canadamexico\:\:42.00\">Express Mail to Canada & Mexico</td>
<td>(We will contact you with exact shipping costs before sending your order)</td>
</tr>
<tr><td colspan=1></td>
<td><input type=radio name=\"trship\" value=\"expressother\:\:56.00\">Express Mail to all other countries</td>
<td>(We will contact you with exact shipping costs before sending your order)<br></td>
</tr>
</table>
ENDOFTEXT
}
#######################################################################
# Return True Value For End Of File #
#######################################################################
1;I don't kow Perl, I'm just trying to set up the shipping component of the shopping cart for a customer who was also completely stumped. What do I do, and where does it go?
Many thanks!
Offline
Hi Lee,
Don't panic! :-)
All these shipping options are fixed prices, right? That is, not dependent on cost of items ordered, number of items, or anything like that? It looks like it just gives the customer options to choose one of these shipping methods:
Ground US = $9.50
2nd Day Air Cont US = $19.50
Express Mail to Hawaii, Alaska, Puerto Rico = $32.00
Express Mail to Canada & Mexico = $42.00
Express Mail to all other countries = 56.00
If so, you can just use the script I posted below. Go into Admin > Shipping Settings > Manage Custom Shipping Methods and "Click here to insert a new item" Give it a reference name like "ste_shipcus_fixed" and a custom method name like "Fixed Shipping Costs", then cut/paste the script below into the Perl Scripting box and click submit. Then setup all the products to use Delivery Method "Custom Shipping" and Custom Shipping Script "Fixed Shipping Costs" (or whatever you named it) and you're good to go. Write if you get stuck or need more help.
Dave
my $ship_meth_name_1 = "Continental US Ground"; my $ship_meth_name_2 = "Continental US 2nd Day Air"; my $ship_meth_name_3 = "Express Mail to Hawaii, Alaska, Puerto Rico"; my $ship_meth_name_4 = "Express Mail to Canada & Mexico"; my $ship_meth_name_5 = "Express Mail to all other countries"; my $ship_meth_amt_1 = "9.50"; my $ship_meth_amt_2 = "19.50"; my $ship_meth_amt_3 = "32.00"; my $ship_meth_amt_4 = "43.00"; my $ship_meth_amt_5 = "56.00"; ## End of user variables - do not modify below this line $ship_display_1 = "$ship_meth_name_1 - $currency_symbol$ship_meth_amt_1"; $ship_display_2 = "$ship_meth_name_2 - $currency_symbol$ship_meth_amt_2"; $ship_display_3 = "$ship_meth_name_3 - $currency_symbol$ship_meth_amt_3"; $ship_display_4 = "$ship_meth_name_4 - $currency_symbol$ship_meth_amt_4"; $ship_display_5 = "$ship_meth_name_5 - $currency_symbol$ship_meth_amt_5"; $custom_code_result = ""; $custom_code_result .= <<ENDOFTEXT; <INPUT TYPE="RADIO" NAME="shipinfo-$shipid" VALUE="$ship_meth_name1:$ship_meth_amt_1" CHECKED> <FONT FACE="$html_base_font_face" SIZE="$html_base_font_size" COLOR="$html_base_font_color"> $ship_display_1<BR></FONT> <BR> <INPUT TYPE="RADIO" NAME="shipinfo-$shipid" VALUE="$ship_meth_name2:$ship_meth_amt_2"> <FONT FACE="$html_base_font_face" SIZE="$html_base_font_size" COLOR="$html_base_font_color"> $ship_display_2<BR></FONT> <BR> <INPUT TYPE="RADIO" NAME="shipinfo-$shipid" VALUE="$ship_meth_name3:$ship_meth_amt_3"> <FONT FACE="$html_base_font_face" SIZE="$html_base_font_size" COLOR="$html_base_font_color"> $ship_display_3<BR></FONT> <BR> <INPUT TYPE="RADIO" NAME="shipinfo-$shipid" VALUE="$ship_meth_name4:$ship_meth_amt_4"> <FONT FACE="$html_base_font_face" SIZE="$html_base_font_size" COLOR="$html_base_font_color"> $ship_display_4<BR></FONT> <BR> <INPUT TYPE="RADIO" NAME="shipinfo-$shipid" VALUE="$ship_meth_name5:$ship_meth_amt_5"> <FONT FACE="$html_base_font_face" SIZE="$html_base_font_size" COLOR="$html_base_font_color"> $ship_display_5<BR></FONT> ENDOFTEXT
Offline
Thanks so much for the help. I will let you know if this works!
Offline
It worked!! Many thanks!
Offline