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
Custom Shipping Logic
Author Message
Reply with quote
Post 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

View user's profile Send private message
Reply with quote
Post  
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
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger ICQ Number
Reply with quote
Post  
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

View user's profile Send private message
Reply with quote
Post  
What is the URL to your store?


_________________
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  
The URL is as follows:

https://srs42.hostproserver.com/~southern/cgi-bin/Agora/agora.cgi?product=SouthernSauce

Thanks

Joe

View user's profile Send private message
Reply with quote
Post  
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
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger ICQ Number
Reply with quote
Post  
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

View user's profile Send private message
Reply with quote
Post  
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
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger ICQ Number
Reply with quote
Post  
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

View user's profile Send private message
Reply with quote
Post  
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
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger ICQ Number
Reply with quote
Post  
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>&nbsp;</td></tr>'."\n";
#   }
  $myans .= '</table></td></tr>'."\n";
 }
return $myans;
} # end controller code
-->

Thanks

Joe

View user's profile Send private message
Reply with quote
Post  
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
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger ICQ Number
Reply with quote
Post  
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

View user's profile Send private message
Reply with quote
Post  
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
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger ICQ Number
Reply with quote
Post  
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>&nbsp;</td></tr>'."\n";
#   }
  $myans .= '</table></td></tr>'."\n";
 }
return $myans;
} # end controller code
-->


View user's profile Send private message
Reply with quote
Post  
Joe,
You have to remove the option file from the product... it is interfering...


_________________
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  
Very Happy 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

View user's profile Send private message
Reply with quote
Post  
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
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger ICQ Number
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