Announcement

Collapse
No announcement yet.

minimum order quantity for products

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    minimum order quantity for products

    I've been digging in the forums and not sure what might be the best way to set a minimum quantity for some products i.e. we have an product that is $1.25 and would like to require minimum of 5. I saw reference to Bill's (Emporium Plus) old modules, and other different coding for similar problems but not sure which is the most straight forward solution, so that it works in the basket and everywhere.

    #2
    You might want to reach out to Brennan to see if he can get you a copy of Bill's Minimum and Maximum Quantity module and play with it.
    Leslie Kirk
    Miva Certified Developer
    Miva Merchant Specialist since 1997
    Previously of Webs Your Way
    (aka Leslie Nord leslienord)

    Email me: [email protected]
    www.lesliekirk.com

    Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

    Comment


      #3
      very easy to achieve with the set of custom fields for min and max
      Code:
                      <mvt:comment>Checking if product has a limited quantity per sale item</mvt:comment>
                      <mvt:assign name="g.p_sale_limit" value="''" />
                      <mvt:item name="customfields" param="Read_Product_ID(l.settings:group:product:id, 'limit_sale_qty', g.p_sale_limit)" />
                      <mvt:if expr="g.p_sale_limit EQ '0'">
                          <mvt:assign name="g.p_sale_limit" value="''" />
                      </mvt:if>
      
                      <mvt:comment>If limit is set, making sure we're not over the limit</mvt:comment>
                      <mvt:assign name="g.p_is_over_limit" value="''" />
                      <mvt:assign name="g.p_is_over_limit_css_highlight" value="''" />                
                      <mvt:if expr="NOT ISNULL g.p_sale_limit AND g.p_sale_limit GT 0 AND l.settings:group:quantity GT g.p_sale_limit">
                          <mvt:assign name="g.p_is_over_limit" value="'true'" />
                          <mvt:assign name="g.p_is_over_limit_css_highlight" value="' x-red'" />
                          <script type="text/javascript">
                              qty_error_count += 1;
                              qty_error_message = 'Sorry, "&mvt:global:p_pname; (&mvt:global:p_ename;)" is currently in limited supply. The maximum quantity for the order is: <span class="x-bold">&mvt:global:p_sale_limit;</span><br>' + qty_error_message;
                          </script>
                      </mvt:if>

      Comment


        #4
        Thanks for the suggestion lesliekirk and for the code AHerb (going to play with that right now).

        Comment


          #5
          AHerb - I see I mis-explained it - but still pocketing the code. :) I was looking to force a minimum quantity of certain products, so if Product A has a Min of 5 and someone tries to buy just 1 it would say 'you must purchase at least 5' but actually I think I may be able to use your code hmmm... It is not urgent so something to play with. :)

          In the past I have grouped some items as a 5-pack and created a separate 1 pc item but the purpose of doing this is because there are a few products that are cheap, and we actually pick them up at a local warehouse that has a $100 minimum -so to go buy one $1.25 widget for a customer we'd have to buy a bunch of other stuff if there were no other orders from that warehouse. By the same token I don't want to force someone to by sets of 5 if they only need 6 say - so they would buy 6 and that is more than min of 5 so okay. I just don't want to travel for a single unit of a cheap item. fyi we do stock some of those but about 5000 items so people don't always order the same model we have in stock so we only offer a subset of the products aailable from this source until we sell enough to stock more items. :)
          Last edited by habreu; 03-15-18, 03:08 PM.

          Comment


            #6
            It's pretty much the same code. Instead of limit_sale_qty you'd have to check for another custom field like.... let's say qty_min_must_buy_or_quit
            - Read custom field
            - Match quantity with the custom field and argue with the customer :-)

            If you not gonna sort it out by tomorrow, leave a message here I'll help you to modify it a bit to match the task.

            Comment


              #7
              I appreciate the generous offer. I'll play with it a little first - I may learn something. :) I'll pop back if I start pulling out my hair.Thanks a lot.

              Comment


                #8
                Bill's CIM Minimum and Maximum Quantity module would solve that problem. We use it and it works in 9.08. I don't think it is in the App store.

                Comment


                  #9
                  Originally posted by razertip View Post
                  Bill's CIM Minimum and Maximum Quantity module would solve that problem. We use it and it works in 9.08. I don't think it is in the App store.
                  It's not. That's why I suggested reaching out to Brennan to see if he could get a copy of it.
                  Leslie Kirk
                  Miva Certified Developer
                  Miva Merchant Specialist since 1997
                  Previously of Webs Your Way
                  (aka Leslie Nord leslienord)

                  Email me: [email protected]
                  www.lesliekirk.com

                  Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

                  Comment


                    #10
                    Thank you all. Will do. :)

                    Comment

                    Working...
                    X