 |
Page 1 of 1
|
Author |
Message |
Webby
Newbie - One Blade
Joined: 17 Dec 2006
Posts: 16
|
 Custom Shipping Logic
Below is what I have put in the custom shipping logic. It still doesn't work.
Where am I going wrong?
# Custom Shipping Logic Example
# Ship based on the total order.
# 1 7oz Can is 4.95, 3 7oz Can Pack is 7.95, 6 7oz Can Pack is 9.95, 12 7oz Can
Case is 11.95 etc.:
@sc_shipping_logic =
("|1|||4.95",
"|3|||14.95",
"|6|||28.50",
"|12|||54.00", ;
$shipping_price = &calculate_shipping($temp_total,
$total_quantity, $total_measured_quantity);
$shipping_logic_done = "yes"; # forces exit, no handling charge added
Joe
|
Mon Apr 30, 07 6:28 pm |
|
 |
scottcrew
Moderator
Joined: 13 Feb 2004
Posts: 7516
Location: The West Side of MI USA
|
Joe,
You are trying to base your shipping on the total dollar amount of the order, and not providing a range for the shipping to be applied to. There was, also, a coding error.
From what I can see, you really want to base your shipping on the total number of items in the order.
Try this:
Code:# Custom Shipping Logic Example
# Ship based on the total order.
# 1 7oz Can is 4.95, 3 7oz Can Pack is 7.95, 6 7oz Can Pack is 9.95, 12 7oz Can
#Case is 11.95 etc.:
@sc_shipping_logic = ("||1-2||4.95",
"||3-4||14.95",
"||6-11||28.50",
"||12-||54.00");
$shipping_price = &calculate_shipping($temp_total,
$total_quantity, $total_measured_quantity);
$shipping_logic_done = "yes"; # forces exit, no handling charge added
HTH!
_________________ God Bless!
Bonnie - AgoraCart Moderator
Get a Gold Membership
|
Tue May 01, 07 4:03 am |
 |
 |
Webby
Newbie - One Blade
Joined: 17 Dec 2006
Posts: 16
|
Ok, right now the shipping logic is working, but regardless of the option I
choose in the drop down box, it only calculates the shipping for one product
rather than multiple items. I'm assuming this is because the product number is
"1" in the add to cart box and the quantity would have to be increased in that
box for the shipping to work for that amount.
What I would like to do is simplify it and have it work so that when the
customer chooses an option from the drop down box, that would be the same as
entering it into the add to cart box. I'd like for that to be the only way it
would operate and have the add to cart box gone.
Can that be done and what steps do I need to take to make that happen?
Joe
|
Thu May 03, 07 9:56 am |
|
 |
scottcrew
Moderator
Joined: 13 Feb 2004
Posts: 7516
Location: The West Side of MI USA
|
What is the URL to your store?
_________________ God Bless!
Bonnie - AgoraCart Moderator
Get a Gold Membership
|
Thu May 03, 07 11:02 am |
 |
 |
Webby
Newbie - One Blade
Joined: 17 Dec 2006
Posts: 16
|
|
Thu May 03, 07 5:26 pm |
|
 |
scottcrew
Moderator
Joined: 13 Feb 2004
Posts: 7516
Location: The West Side of MI USA
|
Joe,
The way you are doing it will never work...
You might try the following for the quantity box:
Code:<SELECT NAME = "%%itemID%%">
<option value="">Select A Product Amount
<OPTION VALUE = "1">1 32oz bottle</option>
<OPTION VALUE = "3">3 32oz bottles</option>
<OPTION VALUE = "6">6 32oz bottles</option>
<OPTION VALUE = "12">12 32oz bottles(12)</option>
</SELECT>
HTH!
_________________ God Bless!
Bonnie - AgoraCart Moderator
Get a Gold Membership
|
Thu May 03, 07 5:51 pm |
 |
 |
Webby
Newbie - One Blade
Joined: 17 Dec 2006
Posts: 16
|
I used the code like you gave it to me and the message below is what I get when I select an option from the drop down box.
I'm sorry, it appears that you did not enter a valid numeric quantity (whole numbers greater than zero). Please use your browser's Back button and try again. Thanks!
What could I have done wrong?
Joe
|
Thu May 03, 07 8:10 pm |
|
 |
scottcrew
Moderator
Joined: 13 Feb 2004
Posts: 7516
Location: The West Side of MI USA
|
Joe,
It's not supposed to be in the option file.... it's supposed to replace the qty box...
HTH!
_________________ God Bless!
Bonnie - AgoraCart Moderator
Get a Gold Membership
|
Fri May 04, 07 6:03 am |
 |
 |
Webby
Newbie - One Blade
Joined: 17 Dec 2006
Posts: 16
|
Please excuse my igonorance, but I don't have a clue where to find that so I can replace it. I don't even know what I am looking for. Where do I find that to change it?
Joe
|
Fri May 04, 07 9:40 am |
|
 |
scottcrew
Moderator
Joined: 13 Feb 2004
Posts: 7516
Location: The West Side of MI USA
|
Joe,
It is in the productPage.inc file.
Replace the %%QtyBox%% token with the code given.
Make sure that the files get uploaded in ASCII mode.
HTH!
_________________ God Bless!
Bonnie - AgoraCart Moderator
Get a Gold Membership
|
Fri May 04, 07 11:22 am |
 |
 |
Webby
Newbie - One Blade
Joined: 17 Dec 2006
Posts: 16
|
Okay, I recreated the productPage.inc file the way I thought I was suppose to. I replaced the quantity box with the code you provided. I uploaded it in ASCII mode through filezilla, and for some reason it still isn't working. Could you give me some direction as to what I have possibly done wrong?
Below is the code I used to create the page.
Code:
<!--agorascript-pre
{ #Start of controller code, probably should leave this alone ;-)
local ($myans)="";
if ($rowCount == (1+$minCount)) { #first one
$ags_row_item=0;
$ags_tot_item=0;
$myans .= '<tr><td colspan=3><table width="100%" border=1>'."\n";
}
$ags_row_item++;
$ags_tot_item++;
if (($rowCount == ($maxCount)) || ($rowCount == ($num_returned)))
{ # very last one, need to join these two cells, no border
if ($ags_row_item == 1) { # first and only one
$myans .= '<td width="100%" colspan=2><table width=100% border=0>'."\n";
$myans .= '<tr>'."\n";
}
}
if ($ags_row_item == 2) { # second one
$ags_row_item=0; #reset counter
$myans .= '<td width="50%"><table width=100% border=0>'."\n";
} else { #first one
$myans .= '<tr><td width="50%"><table width=100% border=0>'."\n";
}
return $myans;
} # end of controller code
-->
<TR WIDTH="100%">
<TD ALIGN="CENTER" WIDTH="160" VALIGN="MIDDLE">
<FONT FACE="ARIAL" SIZE="2">
<FORM METHOD = "post" ACTION = "%%scriptURL%%">
%%make_hidden_fields%%
<BR>
%%optionFile%%
<BR>
<P>
<SELECT NAME = "%%itemID%%">
<option value="">Select A Product Amount
<OPTION VALUE = "1">1 32oz bottle</option>
<OPTION VALUE = "3">3 32oz bottles</option>
<OPTION VALUE = "6">6 32oz bottles</option>
<OPTION VALUE = "12">12 32oz bottles(12)</option>
</SELECT>
</TD>
<TD ALIGN="CENTER" WIDTH="150"</TD><a href="agora.cgi?picserve=%%userFieldTwo%%"
onClick="MyWindow=window.open('agora.cgi?picserve=%%
userFieldTwo%%','MyWindow','toolbar=no,location=no,directories=no,status=no,
menubar=no,scrollbars=no,resizable=no,width=450,height=450');
return false;" target="_new">%%image%%</a>
</tr>
<!--agorascript-pre
{ # more controller code
local ($myans)="";
if (($rowCount == ($maxCount)) || ($rowCount == ($num_returned)))
{ # very last one
if ($ags_row_item == 1) { # first and only one
$myans .= '</table></td>'."\n";
$myans .= '<td width="50%"><table width=100%>'."\n";
}
}
return $myans;
} # end controller code
-->
<tr><TD colspan=2>
<FONT FACE="ARIAL" SIZE="2">
<b>%%name%%</b>
<br>
%%description%%
</FONT>
</TD>
</FORM>
</TR>
<TR>
<td colspan=2><table width='100%' border=0 cellpadding=0 cellspacing=0>
<tr><td width='33%' align=center>
<FONT FACE="ARIAL" SIZE="2" color="#FF0000">%%price%%</font>
</td>
<td width='33%' align=center>
<A HREF="%%scripturl%%?dc=1&%%href_fields%%"><FONT FACE=ARIAL>View Cart</FONT>
</A>
</td>
<td width = '33%' align=center>
<A HREF='%%StepOneURL%%?order_form_button.x=1&%%href_fields%%'><FONT
FACE=ARIAL>Check Out</FONT>
</A>
</TD>
</tr></table>
</TD>
</TR>
<!--agorascript-pre
{ # more controller code
local ($myans)="";
if ($ags_row_item == 1) { # first one
$myans .= '</table></td>'."\n";
} else { # second one
$myans .= '</table></td></tr>'."\n";
}
if (($rowCount == ($maxCount)) || ($rowCount == ($num_returned)))
{ # very last one, need to join these two cells, no border
if ($ags_row_item == 1) { # first and only one
$myans .= '</tr></table></td>'."\n";
}
}
if (($rowCount == ($maxCount)) || ($rowCount == ($num_returned)))
{ # very last one
# if ($ags_row_item == 1) { # finished first one, add a blank dummy
#second
# $myans .= '<td> </td></tr>'."\n";
# }
$myans .= '</table></td></tr>'."\n";
}
return $myans;
} # end controller code
-->
Thanks
Joe
|
Mon May 07, 07 3:43 pm |
|
 |
scottcrew
Moderator
Joined: 13 Feb 2004
Posts: 7516
Location: The West Side of MI USA
|
Joe,
Where's the add to cart button... You weren't supposed to remove that code...
_________________ God Bless!
Bonnie - AgoraCart Moderator
Get a Gold Membership
|
Mon May 07, 07 5:49 pm |
 |
 |
Webby
Newbie - One Blade
Joined: 17 Dec 2006
Posts: 16
|
I restored the file back to it's original state, at least I think. However, now when I click the add to cart button I get this message "I'm sorry, it appears that you did not enter a valid numeric quantity (whole numbers greater than zero). Please use your browser's Back button and try again. Thanks!"
So I think I left something undone. Once I have that corrected I can go back and try entering the code you suggested I use.
Any idea where I messed up?
Thanks much for your patience while I learn.
Joe
|
Mon May 07, 07 8:11 pm |
|
 |
scottcrew
Moderator
Joined: 13 Feb 2004
Posts: 7516
Location: The West Side of MI USA
|
Yes, you had the code in the right place, but you removed the add to cart button.
The only part of the code that is supposed to be replaced was the quantity box part...
HTH!
Last edited by scottcrew on Tue May 08, 07 5:16 am; edited 1 time in total
_________________ God Bless!
Bonnie - AgoraCart Moderator
Get a Gold Membership
|
Tue May 08, 07 4:05 am |
 |
 |
Webby
Newbie - One Blade
Joined: 17 Dec 2006
Posts: 16
|
Below is the code I am using for the productPage.inc and the quantity box appears with the add to cart button, you can see it at:
https://srs42.hostproserver.com/~southern/cgi-bin/Agora/agora.cgi?product=SouthernSauce
but when I add to cart I get this message
"I'm sorry, it appears that you did not enter a valid numeric quantity (whole numbers greater than zero). Please use your browser's Back button and try again. Thanks!"
What is messed up?
Thanks
Joe
Code:
<!--agorascript-pre
{ #Start of controller code, probably should leave this alone ;-)
local ($myans)="";
if ($rowCount == (1+$minCount)) { #first one
$ags_row_item=0;
$ags_tot_item=0;
$myans .= '<tr><td colspan=3><table width="100%" border=1>'."\n";
}
$ags_row_item++;
$ags_tot_item++;
if (($rowCount == ($maxCount)) || ($rowCount == ($num_returned)))
{ # very last one, need to join these two cells, no border
if ($ags_row_item == 1) { # first and only one
$myans .= '<td width="100%" colspan=2><table width=100% border=0>'."\n";
$myans .= '<tr>'."\n";
}
}
if ($ags_row_item == 2) { # second one
$ags_row_item=0; #reset counter
$myans .= '<td width="50%"><table width=100% border=0>'."\n";
} else { #first one
$myans .= '<tr><td width="50%"><table width=100% border=0>'."\n";
}
return $myans;
} # end of controller code
-->
<TR WIDTH="100%">
<TD ALIGN="CENTER" WIDTH="160" VALIGN="MIDDLE">
<FONT FACE="ARIAL" SIZE="2">
<FORM METHOD = "post" ACTION = "%%scriptURL%%">
%%make_hidden_fields%%
<BR>
%%optionFile%%
<BR>
<P>
<!--BEGIN SELECT QUANTITY BUTTON-->
<TABLE>
<TR ALIGN="CENTER">
<SELECT NAME = "%%itemID%%">
<option value="">Select A Product Amount
<OPTION VALUE = "1">1 32oz bottle</option>
<OPTION VALUE = "3">3 32oz bottles</option>
<OPTION VALUE = "6">6 32oz bottles</option>
<OPTION VALUE = "12">12 32oz bottles(12)</option>
</SELECT>
<TD VALIGN="MIDDLE"><INPUT TYPE="IMAGE"
NAME="add_to_cart_button" VALUE="Add To Cart"
SRC="%%URLofImages%%/add_to_cart.gif" BORDER="0">
</TD>
</TR>
</TABLE>
<!--END SELECT QUANTITY BUTTON-->
</TD>
<TD ALIGN="CENTER" WIDTH="150"</TD><a href="agora.cgi?picserve=%%userFieldTwo%%"
onClick="MyWindow=window.open('agora.cgi?picserve=%%
userFieldTwo%%','MyWindow','toolbar=no,location=no,directories=no,status=no,
menubar=no,scrollbars=no,resizable=no,width=450,height=450');
return false;" target="_new">%%image%%</a>
</tr>
<!--agorascript-pre
{ # more controller code
local ($myans)="";
if (($rowCount == ($maxCount)) || ($rowCount == ($num_returned)))
{ # very last one
if ($ags_row_item == 1) { # first and only one
$myans .= '</table></td>'."\n";
$myans .= '<td width="50%"><table width=100%>'."\n";
}
}
return $myans;
} # end controller code
-->
<tr><TD colspan=2>
<FONT FACE="ARIAL" SIZE="2">
<b>%%name%%</b>
<br>
%%description%%
</FONT>
</TD>
</FORM>
</TR>
<TR>
<td colspan=2><table width='100%' border=0 cellpadding=0 cellspacing=0>
<tr><td width='33%' align=center>
<FONT FACE="ARIAL" SIZE="2" color="#FF0000">%%price%%</font>
</td>
<td width='33%' align=center>
<A HREF="%%scripturl%%?dc=1&%%href_fields%%"><FONT FACE=ARIAL>View Cart</FONT>
</A>
</td>
<td width = '33%' align=center>
<A HREF='%%StepOneURL%%?order_form_button.x=1&%%href_fields%%'><FONT
FACE=ARIAL>Check Out</FONT>
</A>
</TD>
</tr></table>
</TD>
</TR>
<!--agorascript-pre
{ # more controller code
local ($myans)="";
if ($ags_row_item == 1) { # first one
$myans .= '</table></td>'."\n";
} else { # second one
$myans .= '</table></td></tr>'."\n";
}
if (($rowCount == ($maxCount)) || ($rowCount == ($num_returned)))
{ # very last one, need to join these two cells, no border
if ($ags_row_item == 1) { # first and only one
$myans .= '</tr></table></td>'."\n";
}
}
if (($rowCount == ($maxCount)) || ($rowCount == ($num_returned)))
{ # very last one
# if ($ags_row_item == 1) { # finished first one, add a blank dummy
#second
# $myans .= '<td> </td></tr>'."\n";
# }
$myans .= '</table></td></tr>'."\n";
}
return $myans;
} # end controller code
-->
|
Tue May 08, 07 4:53 am |
|
 |
scottcrew
Moderator
Joined: 13 Feb 2004
Posts: 7516
Location: The West Side of MI USA
|
Joe,
You have to remove the option file from the product... it is interfering...
_________________ God Bless!
Bonnie - AgoraCart Moderator
Get a Gold Membership
|
Tue May 08, 07 5:19 am |
 |
 |
Webby
Newbie - One Blade
Joined: 17 Dec 2006
Posts: 16
|
 Okay, almost there pleae view the product and how it is processing.
https://srs42.hostproserver.com/~southern/cgi-bin/Agora/agora.cgi?product=SouthernSauce
When I click "Add to Cart" it does so. When I click "View Cart" I get the price of the product as the shipping price and there is no charge for the product itself. How can this be done?
I also have a different shipping price for the other product. So how can I modify the shipping logic to produce a different shipping price for the other product when that product is selected. Right now, the shipping logic is set for the Jame's Do All and not at all for the Southern Secret Sauce.
How can I get the price to display for the product amount selected and have a different shipping price for the Southern Secret Sauce?
Thanks so much!
Joe
|
Tue May 08, 07 5:55 am |
|
 |
scottcrew
Moderator
Joined: 13 Feb 2004
Posts: 7516
Location: The West Side of MI USA
|
Joe,
You need to specify a price for the product. If there are price breaks on multiple quantities you need to set up a var_opt options file to handle the quantity price breaks.
As for your shipping, you should unify the shipping calculations.
You can't have one shipping logic for 1 product and another logic for another product...
These methods should be unified.
However, there has been some special shipping logic developed in the pro forum that makes use of the product ID's. But, as the number of products increases in the store the more difficult it is to maintain.
_________________ God Bless!
Bonnie - AgoraCart Moderator
Get a Gold Membership
|
Tue May 08, 07 6:06 am |
 |
 |
|
The time now is Thu May 01, 25 9:12 pm | 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
|
|
|