in

dashCommerce

An ASP.NET Open Source e-Commerce Application

Minimum Order?

Last post 07-01-2008 12:51 PM by MrBruce. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 06-27-2008 11:10 AM

    • MrBruce
    • Top 10 Contributor
    • Joined on 02-11-2008
    • Juno Beach, FL
    • Posts 120

    Minimum Order?

    I'd like an error message to appear on the screen when the user gets to the cart page if the subtotal is less than $70.00.

    I've looked at cart.aspx which seems to be pulling the entire order from ordersummary.ascx. I think that's probably where the message should appear...

    How do I evaluate whether the order subtotal is less than $70, and respond with a message if it does?

     

     

    --
    Bruce
  • 06-30-2008 10:42 AM In reply to

    • MrBruce
    • Top 10 Contributor
    • Joined on 02-11-2008
    • Juno Beach, FL
    • Posts 120

    Re: Minimum Order?

    This is extremely frustrating!

    I went to ordersummary.ascx, and added a row to the table with a label stating that "Minimum Order is $70.00!" and turned its visibility off. Then I went to the code-behind page, and in the section marked "Loads the order" I added the following:

    if (this.Order.SubTotal < 70)
    {
    lblMinOrder.visible =
    true;
    }

    When I try to rebuild, I get an error that tells me that the name "lblMinOrder" does not exist in the current context. I tried other names as well, and also tried not using the lbl prefix. Am I not allowed to add a label to a page here???

    If my approach is all screwed up (and I admit it could be, as I'm still trying to learn this stuff), could some kind soul please point me in the right direction???

     

    I am now trying to use a Text Box control, which seems to be friendlier, but can't figure out how to change its visibility in the code-behind page....

    if (this.Order.SubTotal < 70)
    {
       HOW DO I TALK TO MY TEXT BOX HERE???
    }

    P.S. Is this a Really Hard Question for some reason??? It seems that any well-thought-out eCommerce site should consider a minimum purchase, since so many Merchant Accounts have minimums.....

    --
    Bruce
    Filed under:
  • 06-30-2008 10:37 PM In reply to

    Re: Minimum Order?

    Answer

    First order.ascx is in the admin folder so that is only used in the admin section of the site. (Your probably talking about ordersummary.ascx)

    Are you working with VS standerd or above (Not VWD Express)?

    lblMinOrder.Visible = true;//CSharp is Case Sensitive
    Also make sure that
    lblMinOrder is generated in ordersummary.ascx.designer.cs file. (or you can add it there yourself)

    You might also want to check out some videos on asp.net

    Find a bug? Create a Work Item for a fast response.. Want to help? Create a patch for us!
  • 07-01-2008 9:19 AM In reply to

    • MrBruce
    • Top 10 Contributor
    • Joined on 02-11-2008
    • Juno Beach, FL
    • Posts 120

    Re: Minimum Order?

    Thank you for your help, yitzchok! It works well!

    Yes, I did mean ordersummary.ascx, and have edited my post to correct that.

    Yes, I am working with VS2008 Standard Edition.

    Thank you for the reminder that C# is Case Sensitive, although my sense of panic was related to the fact that the Label itself wasn't working....

    Yes, I'm constantly learning from the videos on ASP.NET, as well as reading books, etc. However, the use of "designer" files is a completely new concept to me and I have no idea where/how to learn more about them and their use in dashCommerce. I wonder if you could explain, or direct me to a resource?

    --
    Bruce
  • 07-01-2008 10:04 AM In reply to

    Re: Minimum Order?

    MrBruce:

    P.S. Is this a Really Hard Question for some reason??? It seems that any well-thought-out eCommerce site should consider a minimum purchase, since so many Merchant Accounts have minimums.....

    No, it's not a hard question, but building software is an evolutionary process and some things are accounted for while others are not. Basically, community feedback drives the evolution of the product, just as customer feedback would drive a commercial product. While I like to think dashCommerce is pretty well thought out, we don't currently consider a minimum purchase because there has been no requests for it until now. Also, I've never heard of a Merchant Account requiring a minimum purchase. The account may have a minimum balance, but I've never heard of a minimum purchase being required by a merchant account.

    Regarding designer files - it is merely a separation of code files that Visual Studio produces, which helps keep the main code file (myfile.cs) relatively clean. Back in the 1.1 days, all that designer generated code was in myfile.cs and it cluttered up the primary "work surface", so MS rightfully decided to create a designer file, which you usually don't have to mess with too often.

    --
    Support dashCommerce - Buy Our Stuff!!


    Find a bug? Create a Work Item for a fast response.. Want to help? Create a patch for us! Documentation? Help us write some!
  • 07-01-2008 11:03 AM In reply to

    • MrBruce
    • Top 10 Contributor
    • Joined on 02-11-2008
    • Juno Beach, FL
    • Posts 120

    Re: Minimum Order?

    Chris,

    Haven't you ever been to a restaurant or store that had a sign by the cash register indicating that their minimum for credit card sales was $X.00 ??? It's because their merchant account either doesn't allow charges under a certain dollar amount, or charges them a premium which they choose not to pay. Anyhow, other eCommerce applications do take the minimum order into account. Here's one example:

    from aspdotnetstorefront's feature list:

    "set a minimum order total threshold for proceed to checkout (e.g. must purchase over $100)"

    As far as these designer files are concerned, thanks for the info! I notice at the top of those pages is a notice that says "<auto-generated> This code was generated by a tool." although it doesn't mention WHAT tool...??? I'd like to research this a bit to continue my education and can't find anything related to it in my VS2008 Help!

    --
    Bruce
  • 07-01-2008 11:50 AM In reply to

    Re: Minimum Order?

    Yeah, I've seen that but it's never come up here or in any stores that I have done. You are welcome to add it to CodePlex and we can try to get the functionality supported in a future version of the product.

    The "tool" referenced in the designer file is Visual Studio. The only time I muck with the designer files is when an control doesn't "register" with the designer file. But know this about designer files: - the tool modifies them all the time, so if you put something in there and then go into design mode, the code that you put in there will be overwritten when you change the design of the page or form. So, keep any custom code out of there. (This was also one of the reasons they split it out - folks would modify the designer generated code and then flip to design mode and they would lose all their changes). The only stuff in there is the control declarations.

    --
    Support dashCommerce - Buy Our Stuff!!


    Find a bug? Create a Work Item for a fast response.. Want to help? Create a patch for us! Documentation? Help us write some!
  • 07-01-2008 12:51 PM In reply to

    • MrBruce
    • Top 10 Contributor
    • Joined on 02-11-2008
    • Juno Beach, FL
    • Posts 120

    Re: Minimum Order?

    Thanks for the info!

    Drinks

    --
    Bruce
Page 1 of 1 (8 items)