 |
Page 1 of 1
|
Author |
Message |
jim01
Newbie - One Blade
Joined: 18 May 2009
Posts: 14
Location: San Diego
|
 Custom Shipping Logic - Now You See It, Now I Don't
I'm trying to set up custom logic to calculate: Base-rate shipping cost + 2.50 flat rate handling fee, tax added after shipping.
Not using automatic calculations by UPS or USPS.
The base rate will be set on the cost of the product (by price range).
I had this configured and functioning but, apparently while modifying other items, I seem to have killed it.
Here's what I have:
Calculate_final_values loop: 2
Use custom shipping? yes
When to run custom? before
Measured by weight? no
Use live SBW? no
Allow shipments via: ups-no usps-no
Display product id? no
==============================
My custom logic:
@sc_shipping_logic =
(
"San Diego Delivery Zone 1|1-|||7.50",
"San Diego Delivery Zone 2|1-|||12.50",
"San Diego Delivery Zone 3|1-|||17.50",
"Shipping Total 0-10||2.01-9.99||8.50",
"Shipping Total 10-20||10.00-20.00||11.00",
"Shipping Total 20-30||20.01-30.00||13.00",
"Shipping Total 30-50||30.01-50.00||14.00",
"Shipping Total 50-80||50.01-80.00||16.00",
"Shipping Total 80-110||80.01-110.00||17.00",
"Shipping Total 110-||110.01-||18.00",
);
$shipping_price = &calculate_shipping($temp_total,
$total_quantity, $total_measured_quantity);
==============================
My page html (Offline-orderform.html):
<select name="Ecom_ShipTo_Method">
<option value=""> Select Shipping Method </option>
<OPTION value="Shipping Total 0-10">Product Total $2-$10</option>
<OPTION value="Shipping Total 10-20">Product Total $11-$20</option>
<OPTION value="Shipping Total 20-30">Product Total $21-$30</option>
<OPTION value="Shipping Total 30-50">Product Total $31-$50</option>
<OPTION value="Shipping Total 50-80">Product Total $51-$80</option>
<OPTION value="Shipping Total 80-110">Product Total $81-$110</option>
<OPTION value="Shipping Total 110-">Product Total $111+</option>
<OPTION value="San Diego Delivery Zone 1">San Diego Delivery Zone 1</option>
<OPTION value="San Diego Delivery Zone 2">San Diego Delivery Zone 2</option>
<OPTION value="San Diego Delivery Zone 3">San Diego Delivery Zone 3</option>
</select>
==============================
If it would be helpful to see it in development, you can check it here: http://www.thebasketcorner.com/cgi-bin/store52/agora.cgi
Thanks for the assistance!
_________________ ==============
Jim
|
Mon May 18, 09 9:03 am |
|
 |
scottcrew
Moderator
Joined: 13 Feb 2004
Posts: 7516
Location: The West Side of MI USA
|
Jim,
Your custom shipping logic has an extra comma...
custom logic should be:
Code:
@sc_shipping_logic = (
"San Diego Delivery Zone 1|1-|||7.50",
"San Diego Delivery Zone 2|1-|||12.50",
"San Diego Delivery Zone 3|1-|||17.50",
"Shipping Total 0-10||2.01-9.99||8.50",
"Shipping Total 10-20||10.00-20.00||11.00",
"Shipping Total 20-30||20.01-30.00||13.00",
"Shipping Total 30-50||30.01-50.00||14.00",
"Shipping Total 50-80||50.01-80.00||16.00",
"Shipping Total 80-110||80.01-110.00||17.00",
"Shipping Total 110-||110.01-||18.00");
$shipping_price = &calculate_shipping($temp_total,
$total_quantity, $total_measured_quantity);
Let me know how it goes!
_________________ God Bless!
Bonnie - AgoraCart Moderator
Get a Gold Membership
|
Mon May 18, 09 9:29 am |
 |
 |
jim01
Newbie - One Blade
Joined: 18 May 2009
Posts: 14
Location: San Diego
|
Thanks for the response - I've made the change you mentioned (wow, talk about unforgiving! ONE extra comma), but still no luck.
What else could I have done that would be influencing this? I have changed some of the HTML templates, but don't think they'd do this. It just seems to not be calculating ANY shipping at all. For what it's worth, when I "buy" a certain item (Executive Magazine Tote #00022), the shipping column shows blank, but when I "buy" a different item (Movie Nite #00014) with an option variable, it shows "0" for the shipping rather than blank. (The option, though, has nothing to do with shipping).
If it will help at all, here's the code from the shipping-selected portion of the agora_user_lib.pl file that it is generating (and no, I'm not editing this directly, only thru the GUI manager):
====================================
$sc_ship_thingy_p_id_indicator_enabled = "no";
$sc_calculate_shipping_loop = "2";
$sc_handling_charge = "2.50";
$sc_handling_charge_type = "Flat Rate";
$sc_add_handling_cost_if_shipping_is_zero = "no";
$sc_alt_origin_enabled = "no";
$sc_use_custom_shipping_logic = "yes";
$sc_location_custom_shipping_logic = "before";
$sc_use_SBW2 = "no";
$sc_custom_shipping_logic = qq`\# In this example shipping types are used from the defaults listed in the
\# Custom Shipping Methods section of the shipping manager setups, plus some extra samples that
\# are commented out with the pound sign (\#) so that they are not used.
\# Remember that the first match found is the one used. So use catchall or general logic at the end of the array.
\# Arrays start with the \@ symbol.
\#
\# general recipe for each shipping logic, which can be combined on everything but cost, is:
\# a|b|c|d|e
\# a = shipping method. Can be left blank but must match the name value of the shipping types on the order form used.
\# b = number of items. Can be blank or combined with c and d as conditions to be matched for more complex logic.
\# c = number of items. Can be blank or combined with b and d as conditions to be matched for more complex logic.
\# d = number of items. Can be blank or combined with b and c as conditions to be matched for more complex logic.
\# e = cost of shipping. Can be a fixed cost (3.99) or a percentage of total cost (10.5\%), but not both.
\#
\@sc_shipping_logic = (
\"San Diego Delivery Zone 1|1-|||7.50\",
\"San Diego Delivery Zone 2|1-|||12.50\",
\"San Diego Delivery Zone 3|1-|||17.50\",
\"Shipping Total 0-10||2.01-9.99||8.50\",
\"Shipping Total 10-20||10.00-20.00||11.00\",
\"Shipping Total 20-30||20.01-30.00||13.00\",
\"Shipping Total 30-50||30.01-50.00||14.00\",
\"Shipping Total 50-80||50.01-80.00||16.00\",
\"Shipping Total 80-110||80.01-110.00||17.00\",
\"Shipping Total 110-||110.01-||18.00\");
\$shipping_price = \&calculate_shipping(\$temp_total,
\$total_quantity, \$total_measured_quantity);
\#
===========================
Thanks.
_________________ ==============
Jim
|
Mon May 18, 09 9:52 am |
|
 |
scottcrew
Moderator
Joined: 13 Feb 2004
Posts: 7516
Location: The West Side of MI USA
|
Jim,
Yep, a comma can cause lots of problems...
I think you will need to turn on the SBW...
The shipping column in the cart display will NOT show a calculated shipping.
What it does show is what is set in the product's database line in the shipping price/weight field.
If you are not setting a shipping price/weight for products, you can remove the column in the Cart/Email Displays Manager.
_________________ God Bless!
Bonnie - AgoraCart Moderator
Get a Gold Membership
|
Mon May 18, 09 11:05 am |
 |
 |
jim01
Newbie - One Blade
Joined: 18 May 2009
Posts: 14
Location: San Diego
|
I turned on the SBW, no luck.
I've added a shipping cost to an item (All Occasion Favorite #00015, http://www.thebasketcorner.com/cgi-bin/store52/agora.cgi?cart_id=5606511.4062&product=All%20Occasion&user4=Congratulations) and that flat rate shows when I "buy" it.
When I select a shipping option, though, it does not change/modify/overwrite the flat rate defined AND it does not show in the "Order Totals" page of the check out page.
_________________ ==============
Jim
|
Mon May 18, 09 11:18 am |
|
 |
scottcrew
Moderator
Joined: 13 Feb 2004
Posts: 7516
Location: The West Side of MI USA
|
Email ( agora at scottcrewwebservices.com ) me your login credentials to the store and I will take a look at your settings...
Make sure that dimensional shipping and alternate origins are set to "no" in Shipping Settings Manager.
In the Tax Settings manager, make sure that non-taxable products is set to "no", as well.
_________________ God Bless!
Bonnie - AgoraCart Moderator
Get a Gold Membership
|
Mon May 18, 09 12:41 pm |
 |
 |
scottcrew
Moderator
Joined: 13 Feb 2004
Posts: 7516
Location: The West Side of MI USA
|
I think the spaces in your shipping options may be causing a problem...
Try setting them up like:
Code:@sc_shipping_logic = (
"SanDiegoDeliveryZone1|1-|||7.50",
"SanDiegoDeliveryZone2|1-|||12.50",
"SanDiegoDeliveryZone3|1-|||17.50",
"StandardShipping||2.01-9.99||8.50",
"StandardShipping||10.00-20.00||11.00",
"StandardShipping||20.01-30.00||13.00",
"StandardShipping||30.01-50.00||14.00",
"StandardShipping||50.01-80.00||16.00",
"StandardShipping||80.01-110.00||17.00",
"StandardShipping||110.01-||18.00");
$shipping_price = &calculate_shipping($temp_total,
$total_quantity, $total_measured_quantity);
Also, you are NOT supposed to directly edit the shipping method area on the order form.
The settings in the Shipping Settings manager will automatically input the shipping methods allowed that are specified in the Shipping Settings Manager.
You need to put back the original code that was in the order form for the shipping methods:
Code:<tr>
<td class="ac_checkout_left_col">Method:</td>
<td class="ac_checkout_right_col">
<select name="Ecom_ShipTo_Method">
<option value="$vform_Ecom_ShipTo_Method"><!--agorascript-pre
if ("$vform_Ecom_ShipTo_Method" eq "") {
return " Select Shipping Method ";
} else {
return "$vform_Ecom_ShipTo_Method";
}
--></option>
<!--agorascript-pre
{ return
qq|$sc_shiptomethod_4forms|;
} -->
</select>
</td>
</tr>
Now, in the Shipping Settings Manager, temporarily turn on UPS & USPS so that you can set all of the shipping methods under those 2 carriers to "no". Now, those will not show up in your shipping methods list.
Hit the Submit Button at the bottom.
Next, for the question "How Many Custom Shipping Methods Do You Need?" set it to 8.
Hit the submit button at the bottom.
Now we will set up your custom shipping methods for your list.
Code:
Method Name: | Name for Drop-down Lists:
-----------------------------------------------------------------------
ElectronicDelivery | Electronic Test Delivery
StandardShipping | Standard 7-10 day
RushShipping | Rush 2-5 day
SanDiegoDeliveryZone1 | San Diego Delivery Zone 1
SanDiegoDeliveryZone2 | San Diego Delivery Zone 2
SanDiegoDeliveryZone3 | San Diego Delivery Zone 3
Pickup | Pickup in Alpine, CA
Other | Other Special Arrangements
By using these fields, it will automatically create the list of shipping method options and put it in your order form, "automagically".... Which makes it easier to maintain the store from within the manager.
For your Standard & Rush shipping, the cart will automatically determine how much to charge based on the total dollar amount, then the customer can't select the wrong option.
_________________ God Bless!
Bonnie - AgoraCart Moderator
Get a Gold Membership
|
Mon May 18, 09 3:55 pm |
 |
 |
jim01
Newbie - One Blade
Joined: 18 May 2009
Posts: 14
Location: San Diego
|
Thanks SO much for all of your time. This has me so very much closer to where I want to be. Unfortunately, it's still not calculating the shipping. The drop-down custom selection was great (and I hope others can find this thread for an explanation). There's still something, though, that's keeping it from adding in the shipping. I've configured the system as we had discussed so that you can go in and check it out. Thanks.
_________________ ==============
Jim
|
Mon May 18, 09 8:51 pm |
|
 |
scottcrew
Moderator
Joined: 13 Feb 2004
Posts: 7516
Location: The West Side of MI USA
|
Jim,
Does your web host require that perl scripts be run from inside the cgi-bin?
_________________ God Bless!
Bonnie - AgoraCart Moderator
Get a Gold Membership
|
Tue May 19, 09 5:23 am |
 |
 |
scottcrew
Moderator
Joined: 13 Feb 2004
Posts: 7516
Location: The West Side of MI USA
|
ARGHHHH!!!! I could kick myself!!!!
The shipping logic fields were wrong!!!!
You had the total monetary amount of order field & the total number of items in order switched around...
The fields are as follows:
shippingMethod|totalDollarAmt|totalQty|weightMeasuredValue|shippingCost
So, the following logic is what will work:
Code:@sc_shipping_logic = (
"SanDiegoDeliveryZone1||1-||7.50",
"SanDiegoDeliveryZone2||1-||12.50",
"SanDiegoDeliveryZone3||1-||17.50",
"StandardShipping|2.01-9.99|||8.50",
"StandardShipping|10.00-20.00|||11.00",
"StandardShipping|20.01-30.00|||13.00",
"StandardShipping|30.01-50.00|||14.00",
"StandardShipping|50.01-80.00|||16.00",
"StandardShipping|80.01-110.00|||17.00",
"StandardShipping|110.01-|||18.00");
HTH!
_________________ God Bless!
Bonnie - AgoraCart Moderator
Get a Gold Membership
|
Tue May 19, 09 12:01 pm |
 |
 |
jim01
Newbie - One Blade
Joined: 18 May 2009
Posts: 14
Location: San Diego
|
So I now have the site re-configured at a new spot - and am refining/rebuilding the customizations.
http://www.thebasketcorner.com/gifts/agora.cgi
The shipping is still giving a bit of a hiccup - seems to default to "StandardShipping" when it should be " Select Shipping Method " for the default selection.
If you need to access, you should be able to use the same credentials as before.
_________________ ==============
Jim
|
Tue May 19, 09 3:52 pm |
|
 |
scottcrew
Moderator
Joined: 13 Feb 2004
Posts: 7516
Location: The West Side of MI USA
|
Jim,
If you already have been at the order form, it remembers your selection...
It will only default to "Select Shipping Method" the first time you enter the order form.
Once a shipping method was selected, it will remember that until the shopping cart is deleted.
_________________ God Bless!
Bonnie - AgoraCart Moderator
Get a Gold Membership
|
Tue May 19, 09 6:04 pm |
 |
 |
jim01
Newbie - One Blade
Joined: 18 May 2009
Posts: 14
Location: San Diego
|
Except that "StandardShipping" isn't one of the selection options, it's actually one of the selection variables that isn't supposed to show to the visitor. I tested on another PC and what I find is that it does retain the selection that you've made previously, BUT it displays the actual variable rather than the front-end text. If that makes sense.
In my newest test, I selected "Rush 2-5 Day" and when I returned it defaulted to "RushShipping" -- (the METHOD name).
Suggestions?
_________________ ==============
Jim
|
Tue May 19, 09 8:54 pm |
|
 |
scottcrew
Moderator
Joined: 13 Feb 2004
Posts: 7516
Location: The West Side of MI USA
|
Jim, Yes, that is the way it is supposed to be...
_________________ God Bless!
Bonnie - AgoraCart Moderator
Get a Gold Membership
|
Wed May 20, 09 4:40 am |
 |
 |
jim01
Newbie - One Blade
Joined: 18 May 2009
Posts: 14
Location: San Diego
|
Working well - thus far.
How do I define that I need to calculate shipping PER ITEM, rather than PER ORDER. I tried to order 10 of one item and the shipping was WAY too cheap.
_________________ ==============
Jim
|
Thu May 21, 09 3:43 pm |
|
 |
scottcrew
Moderator
Joined: 13 Feb 2004
Posts: 7516
Location: The West Side of MI USA
|
Jim,
Are you still wanting to use different shipping methods?
_________________ God Bless!
Bonnie - AgoraCart Moderator
Get a Gold Membership
|
Wed May 27, 09 2:58 pm |
 |
 |
jim01
Newbie - One Blade
Joined: 18 May 2009
Posts: 14
Location: San Diego
|
Yes, we have standard shipping, rush, 3 delivery options, etc. Assuming that the customer has to assign the same form of shipping to all items in their cart, would like to have it calculate each shipping cost per item.
_________________ ==============
Jim
|
Wed May 27, 09 3:01 pm |
|
 |
scottcrew
Moderator
Joined: 13 Feb 2004
Posts: 7516
Location: The West Side of MI USA
|
So what would your per item shipping logic look like?
_________________ God Bless!
Bonnie - AgoraCart Moderator
Get a Gold Membership
|
Wed May 27, 09 3:11 pm |
 |
 |
jim01
Newbie - One Blade
Joined: 18 May 2009
Posts: 14
Location: San Diego
|
Say I went with the base that you provided (above) (yes, I've changed it to a percentage for now, but I'd prefer this)
@sc_shipping_logic = (
"SanDiegoDeliveryZone1||1-||7.50",
"SanDiegoDeliveryZone2||1-||12.50",
"SanDiegoDeliveryZone3||1-||17.50",
"StandardShipping|2.01-9.99|||8.50",
"StandardShipping|10.00-20.00|||11.00",
"StandardShipping|20.01-30.00|||13.00",
"StandardShipping|30.01-50.00|||14.00",
"StandardShipping|50.01-80.00|||16.00",
"StandardShipping|80.01-110.00|||17.00",
"StandardShipping|110.01-|||18.00");
The problem, though, is that I don't know what the logic should look like. :(
_________________ ==============
Jim
|
Wed May 27, 09 3:15 pm |
|
 |
scottcrew
Moderator
Joined: 13 Feb 2004
Posts: 7516
Location: The West Side of MI USA
|
Jim,
Is that what you want to charge per item?
_________________ God Bless!
Bonnie - AgoraCart Moderator
Get a Gold Membership
|
Wed May 27, 09 3:40 pm |
 |
 |
jim01
Newbie - One Blade
Joined: 18 May 2009
Posts: 14
Location: San Diego
|
yes.
_________________ ==============
Jim
|
Wed May 27, 09 3:42 pm |
|
 |
scottcrew
Moderator
Joined: 13 Feb 2004
Posts: 7516
Location: The West Side of MI USA
|
Jim,
Try the following:
Code:@sc_shipping_logic = (
"SanDiegoDeliveryZone1||1-||7.50",
"SanDiegoDeliveryZone2||1-||12.50",
"SanDiegoDeliveryZone3||1-||17.50",
"StandardShipping|2.01-9.99|||8.50",
"StandardShipping|10.00-20.00|||11.00",
"StandardShipping|20.01-30.00|||13.00",
"StandardShipping|30.01-50.00|||14.00",
"StandardShipping|50.01-80.00|||16.00",
"StandardShipping|80.01-110.00|||17.00",
"StandardShipping|110.01-|||18.00");
$temp_shipping_price = &calculate_shipping($temp_total,
$total_quantity, $total_measured_quantity);
$shipping_price = $temp_shipping_price * $total_quantity;
_________________ God Bless!
Bonnie - AgoraCart Moderator
Get a Gold Membership
|
Wed May 27, 09 3:59 pm |
 |
 |
|
The time now is Sun Apr 27, 25 8:42 am | All times are GMT - 7 Hours
|
Page 1 of 1
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|