[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

5.8

Determining price of product based on price range

Asked by nigerman in Active Server Pages (ASP)

Tags: error, database, sub

I need your expert help on this code please.

As par of my ecommerce solution, I needed to add a shopping cart functionality that, among other things, add item to the cart, determines quantity, unit price, total price, etc.

So far,the code below does that nicely.

Problem is, the client I am doing this work for has 3 different price listings.

For instance, for t-shirt, and I am using t-shirt as an example here, if a customer wants to order a t-shirt, s/he can pay either $10, $25 or $22 depending on which group he or she belongs to.


Example, here sample price groupings:

Product Code    AIP Price   1-10 Price   10 and Up price
sp387            $29         $34           $27

ep233            $19         $24           $17

dn987            $39         $44           $37

From the sample example above, we can see that if an individual belongs to a group called AIP
and wishes to puchase items with product codes sp387, ep233, dn987, s/he will pay 29, 19, 39 respestively.

If the customer wishes to purchase items with same product codes, but don't belong to AIP and wishes to purchase items that are less than 10 in quantity, they pay 34, 24, 44 and if the customers wishes to purchase items with those product numbers with quanities greater than 10, the users pays 27, 17, 37 respectively.

Can I ask someone to show me how to modify this code to give a customer the option to select a price based on the the option they selected from any of the 3 groups above.

This code has already been implemented before the client came up with these new pricing guidelines.

Since I already have one field called price on the database.
I thought about adding 2 new fields, one called 10PlusqtyPrice (for purchases of 10 or more products) and AIPPrice (For customers who may belong to AIP).

The price field already on the db will represent purchases of less than 10 products.

How to go about coding this so that when a customer adds a product to cart, the app determines the price based on any of the ranges described above.
Hope this is fairly clear.

Thanks in advance.

Below is the current working code.


Response.Buffer = true
Dim catid, strcat
catid = Request.QueryString("id")
strcat = Request.QueryString ("cat")

If catid = "" OR (IsNumeric(catid) = false) Then
    Response.Redirect "home.asp"
End if

Dim catname, productslist
sub productInfo(connObj,category)
    q = chr(34)
    set cmd = server.CreateObject("ADODB.Command")
    cmd.ActiveConnection = connObj
    cmd.CommandText = "qryProdsCategory"
    cmd.CommandType = adCmdStoredProc
    set param = cmd.CreateParameter("theCategory",adInteger,adParamInput,4)
    cmd.Parameters.Append(param)
    cmd("theCategory") = Cint(category)
    set rs = server.CreateObject("ADODB.Recordset")
    set rs = cmd.Execute

    if not rs.EOF then
        catname = rs("catdescription")
        strHTML = "<table width='100%' border=0 cellspacing=0 cellpadding=0>"
        strHTML = strHTML & "<tr>"

        i = 1
        while not rs.EOF
            strHTML = strHTML & "<td class=bodytextcolor width='33%' align=center>" & vbcrlf
            strHTML = strHTML & "<br><img src=" & q& "img/small/" & rs("cimageurl") &q& " align=" & q& "center"& q & " WIDTH='97' HEIGHT='125'>" & vbcrlf
            strHTML = strHTML & "<br>" & rs("cname") & " " & vbcrlf
            strHTML = strHTML & "<br>Price: " & FormatCurrency(rs("cprice"),2) & "" & vbcrlf
            strHTML = strHTML & "<br><font size=-1><a href="&q&"product.asp?id=" & rs("catalogID") &q&">View Details</a></font>" & vbcrlf & vbcrlf
            strHTML = strHTML & "<form action="&q&"addprod.asp"&q&" method="&q&"POST"&q&" name=form"&i&" onSubmit="&q& "return checkItems(form"&i&")" & q&">" & vbcrlf
            strHTML = strHTML & "<input type="&q&"hidden"&q&" name="&q&"fproductid"&q&" value="&q & rs("catalogID")& q&">" & vbcrlf
            strHTML = strHTML & "Quantity: <input maxLength="&q&"6"&q&" name="&q&"fquantity"&q&" size=2 value="&q&"1"&q&">" & vbcrlf
            strHTML = strHTML & "<input type="&q&"submit"&q&" value="&q&"ORDER"&q&" name="&q&"order"&q&" style="&q&"font-family: Arial; color: #800000; font-weight: bold"&q&">"
            strHTML = strHTML & "</form></td>" & vbcrlf

            if (i mod 3) = 0 then
                strHTML = strHTML & "</td></tr>" & vbcrlf
            end if
            i = i + 1
            rs.MoveNext
        wend

        strHTML = strHTML & ""
    else
        strHTML = "Product information not found."
        catname = "Error"
    end if
        productslist = strHTML
    rs.Close
    set rs = nothing
    set cmd = nothing

end sub

%>


    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="100%" height="25">
            <table width="100%" border="0" cellspacing="0" cellpadding="10">
            <tr>
              <td width="100%" colspan="3" align="center" class="body">
                      <strong>Here are the Millennium Healthcare Products we carry:</strong><br>
                    Click the link to see details on the product.
              </td>
            </tr>

            <tr>
                <td colspan="3" class="bodytextcolor">
                    <strong>
    <%
    'on error resume next
    call openConn()
    call productInfo(dbc,catid)

    call closeConn()
    response.write catname
   %>
                 </strong>
                </td>
            </tr>
            <!--  -->

            <tr>
             <td width="33%" class="bodytextcolor" align="center">
             <%= productslist %>
            </td>
        </tr>
       </table>
[+][-]10/22/04 06:30 AM, ID: 12380525Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zone: Active Server Pages (ASP)
Tags: error, database, sub
Sign Up Now!
Solution Provided By: peh803
Participating Experts: 1
Solution Grade: A
 
[+][-]10/22/04 07:13 AM, ID: 12380966Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/22/04 07:26 AM, ID: 12381085Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/22/04 07:52 AM, ID: 12381409Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/22/04 08:26 AM, ID: 12381833Assisted Solution

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]10/22/04 09:18 AM, ID: 12382422Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/22/04 09:41 AM, ID: 12382663Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/22/04 10:04 AM, ID: 12382893Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/22/04 10:10 AM, ID: 12382936Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/22/04 10:58 AM, ID: 12383400Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/22/04 11:07 AM, ID: 12383477Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/22/04 11:15 AM, ID: 12383548Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/22/04 11:22 AM, ID: 12383607Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/22/04 11:33 AM, ID: 12383712Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/22/04 11:51 AM, ID: 12383900Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/22/04 11:57 AM, ID: 12383958Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/22/04 12:34 PM, ID: 12384353Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/22/04 12:44 PM, ID: 12384436Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/22/04 12:45 PM, ID: 12384447Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/22/04 12:50 PM, ID: 12384480Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/22/04 12:54 PM, ID: 12384514Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/22/04 12:59 PM, ID: 12384564Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/22/04 01:16 PM, ID: 12384722Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/22/04 01:17 PM, ID: 12384727Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/22/04 01:27 PM, ID: 12384811Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/22/04 01:31 PM, ID: 12384858Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/22/04 01:37 PM, ID: 12384904Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/22/04 01:39 PM, ID: 12384924Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/22/04 01:48 PM, ID: 12384992Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/22/04 02:26 PM, ID: 12385292Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/22/04 03:33 PM, ID: 12385742Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/22/04 05:30 PM, ID: 12386294Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/25/04 07:28 AM, ID: 12400507Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/25/04 10:43 AM, ID: 12402612Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/25/04 12:22 PM, ID: 12403800Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/25/04 12:58 PM, ID: 12404260Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/25/04 01:14 PM, ID: 12404447Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/25/04 01:29 PM, ID: 12404592Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/25/04 01:33 PM, ID: 12404631Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/25/04 01:38 PM, ID: 12404677Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/25/04 01:41 PM, ID: 12404714Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/25/04 01:47 PM, ID: 12404776Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/25/04 02:02 PM, ID: 12404919Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/25/04 02:03 PM, ID: 12404938Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/25/04 02:07 PM, ID: 12404976Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/25/04 02:26 PM, ID: 12405153Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/25/04 04:55 PM, ID: 12406243Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/26/04 05:16 AM, ID: 12409895Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/26/04 06:09 AM, ID: 12410323Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/26/04 08:25 AM, ID: 12411982Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/26/04 08:29 AM, ID: 12412031Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/26/04 09:59 AM, ID: 12413062Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/29/04 08:27 PM, ID: 12450312Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12/27/04 06:13 AM, ID: 12906631Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12/27/04 07:00 AM, ID: 12906853Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12/27/04 07:35 AM, ID: 12907003Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/14/05 08:43 AM, ID: 13045759Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/14/05 08:55 AM, ID: 13045902Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/14/05 09:26 AM, ID: 13046320Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/14/05 09:31 AM, ID: 13046392Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/14/05 10:53 AM, ID: 13047411Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091021-EE-VQP-81