The Official Website of AgoraCart and Agora.cgi
AgoraCart.com Demos Download AgoraCart User Manuals & Wiki Gold Members Forum Go Gold Now! Gold Version Memberships

AgoraCart.com

About
Features
Download
Payment Gateways
Send a Donation
Founders Club
BLOG: News & Updates

Showcases & Demos

AgoraCart Demos
Shop Live Stores

Downloads & Add-ons

Gold Version Downloads
DBwizz Database Mgr.
AgoraCart.com Store

Help & Support

User Manuals
Gold Version Users Forum
Gold Version Chat
Tech Support
Certified Agora Pros
Certified Designers
Hire a Freelancer

Gold Version Members

Member Benefits
Join Today!
Gold Members Home
Gold Version Users Forum
Gold Version Chat Rooms
Gold Version Downloads

For Store Owners

Merchant Accounts
Cool Resources
Advertise Here
"Powered by" Logos
Web Hosting Search

Misc.

Contact Us
MEET's Talking Guide
The Ancient Greek Agora






AgoraCart Free User Forums

This is the official FAQ and Cool Tips guide For the AgoraCart shopping Cart software


Official Sponsors of the AgoraCart Project:

       


RegisterSearchFAQLog in
Reply to topic Page 1 of 1
Shipping Calculation Problems
Author Message
Reply with quote
Post Shipping Calculation Problems 
Hi,
Still have some shipping calculation problems. I am trying to have the calculation by quantity.

Here is the code:
if ($ship_method eq "Pickup")
{ # set a default value
$shipping_price = 0;
}

if ($eform_Ecom_ShipTo_Postal_CountryCode eq 'France') {
@sc_shipping_logic = ( "||1||9.00",
"||2||10.00",
"||3||12.00",
"||4||20.00",
"||5||22.00",
"||6-11||27.00",
"|11-|||");
} else {
@sc_shipping_logic = ( "||1||24.00",
"||2||26",
"||3||28",
"||4||30",
"||5||32",
"||6||34",
"||7-12||45",
"|13-|||");
}
#
$shipping_price = &calculate_shipping($temp_total,
$total_quantity, $total_measured_quantity);
$shipping_logic_done = "yes";

I have the setting on BEFORE.

So it gets to page STEP ONE and it has no idea what shipping method I have or where I live, so it puts in 24 Euros.
If I go to STEP TWO it continues with the 24 Euros even though I have added FRANCE (should be 9 Euros once it knows I am mailing from France) .
If I hit to "MAKE CHANGES" and it returns to STEP ONE, this page now shows 9 Euros (which is correct). However, STEP TWO never recalculates the price and the page continues with 24 Euros as shown below.

STEP TWO
Total TTC
Total Partiel : 7.00 €
Expédition 24.00

Total TTC 31.00 €

I am not doing something right! Also why is the Method of delivery in the second box? Can I move it up to the top box with out problems? It should always be noted, even if the address to ship is the same as the address to bill.

Then other times it does not work at all?
No charge comes up for shipping! Oh dear I am lost, I have tried for several days
Thanks again,
Sue

View user's profile Send private message
Reply with quote
Post  
Hi,
Still not working, but found one error. The last line of the code is wrong and I have corrected it with the pipe in the right place(in both the "if" and "else" -new code below).
HOWEVER, it continues to pick up the wrong price in STEP TWO.

When I put in an order- 1 bottle- it picks up the price of 24 euros. OK so far since I have not put in an address of France. I then complete the address with France, and hit the button to go to STEP TWO. STEP TWO carries over the 24 euros (even though the address states France). If I hit the Make Changes button (Modifier) it returns to STEP ONE and it shows 9 euors (yeah). HOWEVER, complete the command and go to STEP TWO again and it still has 24.00 euros, which carries through. I can not get the correct shipping to show on STEP TWO.

WHAT AM I DOING WRONG!
Version 5 http://www.vinsbourgogne.com/agora/agora.cgi

Thanks....
Sue see code below

if ($ship_method eq "Pickup")
{ # set a default value
$shipping_price = 0;
}

if ($eform_Ecom_ShipTo_Postal_CountryCode eq 'France') {
@sc_shipping_logic = ( "||1||9.00",
"||2||10.00",
"||3||12.00",
"||4||20.00",
"||5||22.00",
"||6-23||27.00",
"||24-35||32"),
"||36-||36.00";
} else {
@sc_shipping_logic = ( "||1||24.00",
"||2||26.00",
"||3||28.00",
"||4||30.00",
"||5||32.00",
"||6-11||34.00",
"||12-23||45.00",
"||24-||50".00);
}
#
$shipping_price = &calculate_shipping($temp_total,
$total_quantity, $total_measured_quantity);
$shipping_logic_done = "yes";

View user's profile Send private message
Reply with quote
Post  
Try this:
Code:
$ship_country = $eform_Ecom_ShipTo_Postal_CountryCode;

if ($ship_country eq 'France') {
@sc_shipping_logic = ( "Pickup||||0.00",
"||1||9.00",
"||2||10.00",
"||3||12.00",
"||4||20.00",
"||5||22.00",
"||6-23||27.00",
"||24-35||32.00"),
"||36-||36.00";
} else {
@sc_shipping_logic = ( "||1||24.00",
"||2||26.00",
"||3||28.00",
"||4||30.00",
"||5||32.00",
"||6-11||34.00",
"||12-23||45.00",
"||24-||50.00");
}
#
$shipping_price = &calculate_shipping($temp_total,
$total_quantity, $total_measured_quantity);
$shipping_logic_done = "yes";


You had the last line incorrect. Also, moved the picup option to be part of France's shipping logic and set up a different way of handling the location of the order being dshipped to. This should prevent the shipping charge from showing before the order form is completed.

Let me know how it goes.
HTH!


_________________
God Bless!
Bonnie - AgoraCart Moderator

Get a Gold Membership
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger ICQ Number
Reply with quote
Post  
Hi,
No change at all.
The shipping charge still shows up before the STEP ONE form is completed.

Also, the same as before, it will correct itself on STEP ONE (after going to STEP TWO and then returning), but STEP TWO never picks up the charge under FRANCE. It hangs on to the 24 euros per bottle for shipping.

Back to Shipping settings(could these have something to do with anything)
I have the following:
In what LOOP. 3 I have 3 (since there are no taxes I could probably use 1,2 or 3)
Handling Charge 0 and NO
Which User Field Blank
Custom Shipping YES
When to run custom shipping logic BEFORE
Measured by Weight NO
2 Methods set
(Standard Delivery equals Livrason and Pickup equals Collecte) see code below

I don't know if that helps!

Thanks for looking at this though. I am really getting to see double because I have looked at it so many times!

Sue
<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>
<OPTION VALUE="Standard Delivery">
Livrason</option>
<OPTION VALUE="Pickup">
Collecte </option>
</SELECT>

View user's profile Send private message
Reply with quote
Post  
Okay, so the Pickup option is not working and we're still having the problem with the shipping charge showing up from the beginning. Found another error in the logic, too... It can be the little things....
Try this:
In the order form, put the following:
Code:

<input type="hidden" NAME="Ecom_Ship" value="go">


Edit the custom shipping logic as follows:
Code:

$ship_country = $eform_Ecom_ShipTo_Postal_CountryCode;

if ($ship_go eq "go") {

if ($ship_country eq 'France') {
@sc_shipping_logic = ("Pickup||1-||0.00",
"||1||9.00",
"||2||10.00",
"||3||12.00",
"||4||20.00",
"||5||22.00",
"||6-23||27.00",
"||24-35||32.00",
"||36-||36.00");
} else {
@sc_shipping_logic = ("||1||24.00",
"||2||26.00",
"||3||28.00",
"||4||30.00",
"||5||32.00",
"||6-11||34.00",
"||12-23||45.00",
"||24-||50.00");
}
#
$shipping_price = &calculate_shipping($temp_total,
$total_quantity, $total_measured_quantity);
$shipping_logic_done = "yes";
}


HTH!


_________________
God Bless!
Bonnie - AgoraCart Moderator

Get a Gold Membership
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger ICQ Number
Reply with quote
Post  
Hi,
No it isn't working. There is no shipping chage now?

You said to put the following in the order-Form
<input type="hidden" NAME="Ecom_Ship" value="go">

Any special place? I tried several places, but maybe not the right place?

Thanks
Sue

View user's profile Send private message
Reply with quote
Post  
Oh... I know what happened...
I forgot to define that new variable in the logic...
DUH!!!

Try this:
Code:
$ship_country = $form_data{Ecom_ShipTo_Postal_CountryCode};
$ship_go = $form_data{'Ecom_Ship'};

if ($ship_go eq "go") {

if ($ship_country eq 'France') {
@sc_shipping_logic = ("Pickup||1-||0.00",
"||1||9.00",
"||2||10.00",
"||3||12.00",
"||4||20.00",
"||5||22.00",
"||6-23||27.00",
"||24-35||32.00",
"||36-||36.00");
} else {
@sc_shipping_logic = ("||1||24.00",
"||2||26.00",
"||3||28.00",
"||4||30.00",
"||5||32.00",
"||6-11||34.00",
"||12-23||45.00",
"||24-||50.00");
}
#
$shipping_price = &calculate_shipping($temp_total,
$total_quantity, $total_measured_quantity);
$shipping_logic_done = "yes";
}



_________________
God Bless!
Bonnie - AgoraCart Moderator

Get a Gold Membership
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger ICQ Number
Reply with quote
Post  
THANK YOU THANK YOU THANK YOU.
It does work...I tried both France and Allemagne [have not tried Pickup though]

One other question though.
For number of bottles over 60, they need to arrange special transport.

there fore.. is the field to the right ( "||1||9.00", ) strictly a numeric field or can I put a message "Contact Us" in there? Otherwise I guess I need to put it the form page.

Sue

View user's profile Send private message
Reply with quote
Post  
Sue,
It is strictly a numeric field, so you can't put any text in there, but it can be a percentage that would be based on the total dollar amount of the order...

Just saw something... :
Code:
$ship_country = $form_data{Ecom_ShipTo_Postal_CountryCode};
$ship_go = $form_data{'Ecom_Ship'};

if ($ship_go eq "go") {
if ($ship_method eq "Pickup")
{ # set a default value
$shipping_price = 0;
}

if ($ship_country eq 'France') {
@sc_shipping_logic = ("||1||9.00",
"||2||10.00",
"||3||12.00",
"||4||20.00",
"||5||22.00",
"||6-23||27.00",
"||24-35||32.00",
"||36-||36.00");
} else {
@sc_shipping_logic = ("||1||24.00",
"||2||26.00",
"||3||28.00",
"||4||30.00",
"||5||32.00",
"||6-11||34.00",
"||12-23||45.00",
"||24-||50.00");
}
#
$shipping_price = &calculate_shipping($temp_total,
$total_quantity, $total_measured_quantity);
$shipping_logic_done = "yes";
}


HTH!


_________________
God Bless!
Bonnie - AgoraCart Moderator

Get a Gold Membership
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger ICQ Number
Reply with quote
Post  
Thanks for the suggestion, but that will not do it.
After 59 bottles, they have to call and make special arrangements for the shipping.
I pretty well knew it would be numeric field, but one can always hope.
Oh well, the shipping works and I will figure out what to do next.

Thanks so much for all your help on this one.
Sue

View user's profile Send private message
Reply with quote
Post  
Hi again.... I spoke too soon!
The Pickup does not seem to work.
I have tried it a few times and if I put in France, pickup (for 1 bottle) is 9 Euros and if I put in Germany it is 24 euros.. I knew I should have tested it immediately.

Sue

View user's profile Send private message
Reply with quote
Post  
Sue,
Did you use the new logic I had just posted in my previous post?
I did notice that the pickup wasn't working...
Although, try this instead:
Code:
$ship_country = $form_data{Ecom_ShipTo_Postal_CountryCode};
$ship_go = $form_data{'Ecom_Ship'};

if ($ship_go eq "go") {
if ($ship_method eq "Pickup")
{ # set a default value
$shipping_price = 0;
$shipping_logic_done = "yes";
}

if ($ship_country eq 'France') {
@sc_shipping_logic = ("||1||9.00",
"||2||10.00",
"||3||12.00",
"||4||20.00",
"||5||22.00",
"||6-23||27.00",
"||24-35||32.00",
"||36-||36.00");
} else {
@sc_shipping_logic = ("||1||24.00",
"||2||26.00",
"||3||28.00",
"||4||30.00",
"||5||32.00",
"||6-11||34.00",
"||12-23||45.00",
"||24-||50.00");
}
#
$shipping_price = &calculate_shipping($temp_total,
$total_quantity, $total_measured_quantity);
$shipping_logic_done = "yes";
}


At least we are getting somewhere.
You will need to put a note on your order form about the over 60 bottle thingy...
HTH!


_________________
God Bless!
Bonnie - AgoraCart Moderator

Get a Gold Membership
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger ICQ Number
Reply with quote
Post  
Hi,
Just tried the new code and pickup does not work [ still charges ].



Sue

View user's profile Send private message
Reply with quote
Post  
Sue,
It is probably because we have not defined where to get the $ship_method from...
That was gnawing at the back of my brain....
Try this one:
Code:
$ship_country = $form_data{Ecom_ShipTo_Postal_CountryCode};
$ship_go = $form_data{'Ecom_Ship'};
$ship_method = $form_data{'Ecom_ShipTo_Method'};

if ($ship_go eq "go") {
if ($ship_method eq "Pickup")
{ # set a default value
$shipping_price = 0;
$shipping_logic_done = "yes";
}

if ($ship_country eq 'France') {
@sc_shipping_logic = ("||1||9.00",
"||2||10.00",
"||3||12.00",
"||4||20.00",
"||5||22.00",
"||6-23||27.00",
"||24-35||32.00",
"||36-||36.00");
} else {
@sc_shipping_logic = ("||1||24.00",
"||2||26.00",
"||3||28.00",
"||4||30.00",
"||5||32.00",
"||6-11||34.00",
"||12-23||45.00",
"||24-||50.00");
}
#
$shipping_price = &calculate_shipping($temp_total,
$total_quantity, $total_measured_quantity);
$shipping_logic_done = "yes";
}


Cross your fingers, I hope this is it...


_________________
God Bless!
Bonnie - AgoraCart Moderator

Get a Gold Membership
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger ICQ Number
Reply with quote
Post  
Hi,
I am in real trouble now!! Everything was fine yesterday, and now this morning it will not go to STEP ONE or STEP TWO!!
So I went back to the old shipping code (one email above) just in case, and of course this was not the problem.
It states an error has been made, go back and do it again.
So today I will look at this problem and see if I understand what is going on!!!
Then I will try the new code again.
Really sad person here at the keyboard!

I will let you know.
Sue

View user's profile Send private message
Reply with quote
Post  
HI,
The problem with the error disappeared? The error Log stated I had an error on line 1830 of the agora_order_lib? It was not an area that I had ever made changes.
But now it is gone I can open the website.

BUT, I now added the new code and it still charges for Pickup.

Also, on STEP TWO, in the summary, even though I define Pickup = Collecte, the summary comes back with Pickup and then the shipping method on STEP ONE has Pickup in the Method box also. See the code below....

Is there any way that my renaming the fields is getting in the way of things?? I left the method names and changed the Name for Forms list.

Sue

Code under SHIPPING SETTINGS -Manager
<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>
<OPTION VALUE="Standard Delivery">
Livraison</option>
<OPTION VALUE="Pickup">
Collecte </option>
</SELECT>

View user's profile Send private message
Reply with quote
Post  
The problem you had was probably due to 1 of a possible 2 things.
1. You had some invalid code in the messages in the Payment Gateway manager
(Can't use " # @ signs without escaping them, IE: \@ )

2. You did not upload the order form file in ASCII mode.

As for the shipping and picking up the "Picup" or "Standard Delivery", that can be recoded to something like:
Code:

<OPTION VALUE="Livraison">
Livraison</option>
<OPTION VALUE="Collecte">
Collecte </option>


For the shipping logic... Are you sure you used the last code I posted, with the $ship_method defined???
Double check that, please...

If it still isn't working, try this:
Code:
$ship_country = $form_data{Ecom_ShipTo_Postal_CountryCode};
$ship_go = $form_data{'Ecom_Ship'};
$ship_method = $form_data{'Ecom_ShipTo_Method'};

if ($ship_go eq "go") {
if (($ship_method eq "Collecte") && ($ship_country eq 'France'))
{ # set a default value
$shipping_price = 0;
$shipping_logic_done = "yes";
} elsif ($ship_country eq 'France') {
@sc_shipping_logic = ("||1||9.00",
"||2||10.00",
"||3||12.00",
"||4||20.00",
"||5||22.00",
"||6-23||27.00",
"||24-35||32.00",
"||36-||36.00");
} else {
@sc_shipping_logic = ("||1||24.00",
"||2||26.00",
"||3||28.00",
"||4||30.00",
"||5||32.00",
"||6-11||34.00",
"||12-23||45.00",
"||24-||50.00");
}
#
$shipping_price = &calculate_shipping($temp_total,
$total_quantity, $total_measured_quantity);
$shipping_logic_done = "yes";
}


HTH!


_________________
God Bless!
Bonnie - AgoraCart Moderator

Get a Gold Membership
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger ICQ Number
Reply with quote
Post  
Hi,
Sad to say I just put in the new code, updated and went to the site...:(
Total TTC
Total Partiel : 7.00 €
Expédition 9.00

Total TTC 16.00 €

Still wants to charge!! It doesn't seem like this should be this difficult.
Sue

View user's profile Send private message
Reply with quote
Post  
No, it shouldn't be this difficult...

Here's another one to try:
Code:
$ship_country = $form_data{Ecom_ShipTo_Postal_CountryCode};
$ship_go = $form_data{'Ecom_Ship'};
$ship_method = $form_data{'Ecom_ShipTo_Method'};

if ($ship_go eq "go") {
if (($ship_method eq "Pickup") && ($ship_country eq 'France'))
{ # set a default value
$shipping_price = 0;
$shipping_logic_done = "yes";
}

if ($ship_country eq 'France') {
@sc_shipping_logic = ("||1||9.00",
"||2||10.00",
"||3||12.00",
"||4||20.00",
"||5||22.00",
"||6-23||27.00",
"||24-35||32.00",
"||36-||36.00");
} else {
@sc_shipping_logic = ("||1||24.00",
"||2||26.00",
"||3||28.00",
"||4||30.00",
"||5||32.00",
"||6-11||34.00",
"||12-23||45.00",
"||24-||50.00");
}
#
$shipping_price = &calculate_shipping($temp_total,
$total_quantity, $total_measured_quantity);
$shipping_logic_done = "yes";
}



_________________
God Bless!
Bonnie - AgoraCart Moderator

Get a Gold Membership
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger ICQ Number
Reply with quote
Post  
Hi,
dislike kinda sorta maybe to report it...it Still charges!
Total TTC
Total Partiel : 7.00 €
Expédition 9.00


Also I noted in the code country eq France...it may not only be the french that pick it up. Germans or who ever may pick it up while on vacation. {added code if (($ship_method eq "Pickup") && ($ship_country eq 'France')) }

Sue

View user's profile Send private message
Reply with quote
Post  
Hi,
Not sure when I wrote the last note. Not very clear!! I never use the expression "kinda sorta", so very strange.
Maybe I was tired, or tried some of the wine!!

However, the new code still did not work for PICKUP. It still sets a charge.

I have stared at it for many hours, and not sure where to go from here!

Thanks
Sue

View user's profile Send private message
Reply with quote
Post  
Hi Bonnie,
Have a question( I have looked and relooked at the code, tried some things, broke my shipping system entirely and now back where I was.... and the Pickup does not work).

At one point you told me to put this code into the Order Form.
<input type="hidden" NAME="Ecom_Ship" value="go">

So I pasted it into the Order Form in PASTE SHIPPING code area after the Select statement like this:
[code] <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>
<OPTION VALUE="Standard Delivery">
Livraison</option>
<OPTION VALUE="Pickup">
Collecte </option>
</SELECT>
<input type="hidden" NAME="Ecom_Ship" value="go">[/code]

My shipping code is below. The Pickup code relies on the line setting the Ecom_Ship to "go". My question? do I have it in the right place. Does the other code run after this so it "sees" the "go" value?
Thanks for looking at it again.
Sue
[code]$ship_country = $form_data{Ecom_ShipTo_Postal_CountryCode};
$ship_go = $form_data{'Ecom_Ship'};
$ship_method = $form_data{'Ecom_ShipTo_Method'};

if ($ship_go eq "go") {
if (($ship_method eq "Pickup") && ($ship_country eq 'France'))
{ # set a default value
$shipping_price = 0;
$shipping_logic_done = "yes";
}

if ($ship_country eq 'France') {
@sc_shipping_logic = ("||1||9.00",
"||2||10.00",
"||3||12.00",
"||4||20.00",
"||5||22.00",
"||6-23||27.00",
"||24-35||32.00",
"||36-47||36.00",
"||48-59||39.00",
"||60||45.00");
} else {
@sc_shipping_logic = ("||1||24.00",
"||2||26.00",
"||3||28.00",
"||4||30.00",
"||5||32.00",
"||6-11||34.00",
"||12-23||45.00");
}
#
$shipping_price = &calculate_shipping($temp_total,
$total_quantity, $total_measured_quantity);
$shipping_logic_done = "yes";
}[/code]

View user's profile Send private message
Display posts from previous:
Reply to topic 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