Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 5 of 5

Thread: wholesale minimum order value

  1. #1
    sugith_k is offline Member
    Join Date
    Mar 2009
    Posts
    97

    Default wholesale minimum order value

    Hi,
    Can someone please tell me how to set a minimum order value for the wholesale orders?

    eg:- wholesale customers must spend over $350


    Sugith Karunaratne
    www.eyepax.com

  2. #2
    ASPAlfred is offline Senior Member
    Join Date
    Nov 2007
    Posts
    2,244

    Default

    There's an appconfig: CartMinOrderAmount, which determines the minimum order amount but regardless of whether the customer is under a customer level or not.

  3. #3
    sugith_k is offline Member
    Join Date
    Mar 2009
    Posts
    97

    Default

    But I need that to apply only for wholesale customers. Is there a way that I can apply it to only wholesale customers?


    Sugith Karunaratne

  4. #4
    BFG 9000 is offline Senior Member
    Join Date
    Oct 2006
    Location
    South UK
    Posts
    882

    Default

    It's not perfect, but you could include an xmlpackage in your skin which tests to see if the customer is a wholesale customer & if their cart has reached the treshold you specify.
    If not, you can have your xmlpackage output some css or javascript that hides or removes the checkout button.


    TTFN

    BFG

  5. #5
    ASPAlfred is offline Senior Member
    Join Date
    Nov 2007
    Posts
    2,244

    Default

    You can as well create an appconfig called CustomerLevelIDforWholesale which holds the value of your wholesale customer level ID. Open up your shoppingcart.aspx.cs file:

    From this lines: 625-628
    Code:
     if (!cart.MeetsMinimumOrderAmount(MinOrderAmount))
       {
           pnlMeetsMinimumOrderAmountError.Visible = true;
           MeetsMinimumOrderAmountError.Text = String.Format(AppLogic.GetString("shoppingcart.aspx.4", SkinID,ThisCustomer.LocaleSetting), ThisCustomer.CurrencyString(MinOrderAmount));
       }
    change it to:
    Code:
     if ((!cart.MeetsMinimumOrderAmount(MinOrderAmount)) && (ThisCustomer.CustomerLevelID == AppLogic.AppConfigNativeInt("CustomerLevelIDforWholesale"))))
       {
           pnlMeetsMinimumOrderAmountError.Visible = true;
           MeetsMinimumOrderAmountError.Text = String.Format(AppLogic.GetString("shoppingcart.aspx.4", SkinID,ThisCustomer.LocaleSetting), ThisCustomer.CurrencyString(MinOrderAmount));
       }
    And, from these lines: 1143-1147
    Code:
    bool validated = true;
    
    if (!cart.MeetsMinimumOrderAmount(AppLogic.AppConfigUSDecimal("CartMinOrderAmount")) 
          {
             validated = false;
          }
    change it to:
    Code:
    bool validated = true;
    
    if if (!cart.MeetsMinimumOrderAmount(AppLogic.AppConfigUSDecimal("CartMinOrderAmount")) && (ThisCustomer.CustomerLevelID == AppLogic.AppConfigNativeInt("CustomerLevelIDforWholesale")))      
          {
             validated = false;
          }
    If you're allowing Paypal and GoogleCheckout, you should also add the CustomerLevelIDforWholesale condition. Don't forget to make a backup first before anything else.