E-Commerce Shipping help-cost per item

# Thread: E-Commerce Shipping help-cost per item

1. Junior Member
Join Date
Dec 1969
Posts
5

## E-Commerce Shipping help-cost per item

I have made an e-commerce site and I need to set-up the shipping charges based on the type and total quantity of items.<BR><BR>Previously, the shipping charges were based on the total items, but I need to enhance it and do not know where/how to start. I am pretty green at ASP still.<BR><BR>Here is what I currently use:<BR>&#060;%Private Function GetShipping(amt2)<BR>If (rsTotalQuantity.Fields.Item("TotalQty").Value)&#0 60;=1 Then GetShipping=18.00: Exit Function<BR>If (rsTotalQuantity.Fields.Item("TotalQty").Value)&#0 62;=2 Then GetShipping=(rsTotalQuantity.Fields.Item("TotalQty ").Value)*10+18-10: Exit Function<BR><BR> Exit Function<BR>End Function<BR>%&#062;<BR><BR>This charges \$18.00 for the first item, and \$10.00 for each additional. I have 4 new item types that I need to charge different amounts for each item type and how many of each item. The amount is predefined and does not change.<BR><BR>Please help!<BR><BR>THANKS<BR><BR>Pete

2. Senior Member
Join Date
Dec 1969
Posts
5,955

## I don't know where you...

...store the types and how they affect the shipping charges, but you&#039;d do something like:<BR><BR>Private Function GetShipping(amt2)<BR><BR>If rsTotalQuantity.Fields.Item("Type").Value = 1 Then<BR>&nbsp;&nbsp;GetShipping = 12<BR>Else If rsTotalQuantity.Fields.Item("Type").Value = 2 Then<BR>&nbsp;&nbsp;GetShipping = 200<BR>Else If rsTotalQuantity.Fields.Item("Type").Value = 3 Then<BR>&nbsp;&nbsp;GetShipping = 50<BR>Else If rsTotalQuantity.Fields.Item("Type").Value = 4 Then<BR>&nbsp;&nbsp;GetShipping = 200<BR>End If<BR><BR>As I said, don&#039;t know where the type is stored, so it depends on what you&#039;re doing, but the code above should give you an idea as to what I&#039;m getting at.<BR><BR>Oliver.

3. Junior Member
Join Date
Dec 1969
Posts
5

## RE: I don't know where you...

Thanks. I am storing the item type in a field in my DB.<BR><BR>How would I handle multiple items of different quantities. For example, if I have 3 type 1 items, I charge \$12.00 for the first one and \$6.00 for each additional. I need the ability to specify multiple quantity pricing for each item type.<BR><BR>Thanks again, I know I am being a pain.<BR><BR>Pete

4. Senior Member
Join Date
Dec 1969
Posts
5,955

## Well, you'd have to loop...

...through each item and add the shipping charges together, based on the type for the item. As I said, it&#039;s hard to say without knowing your database structure, but if you sit down for a bit and familiarize yourself with the database, the code and maybe learn some more ASP, it should be easy. I don&#039;t think I&#039;ll have the time to work this through with you, since it seems to going to take some time.<BR><BR>Oliver.

5. Junior Member
Join Date
Dec 1969
Posts
5

## RE: Well, you'd have to loop...

Thanks Oliver. I am working on it now trying to come up with a way to make it work, or with different ways to accomplish it.<BR><BR>Thanks for the time and suggestions.<BR><BR>Peter

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•