0

How do I set a minimum quantity in order to checkout in my online store?

Each item in my store can be added to the cart in a quantity of "1" but I'd like a minimum of 12 items total before allowing to checkout.

Any easy fixes on how to do this?

I am using Weebly for my site and all I've been able to do is set each item at a minimum of 12 items each but I need a total of 12 items minimum before allowing checkout.

Therefore, as the user clicks the checkout button, and the minimum is not reached I'd like there to be a notice saying "add more items to your cart".

http://poloniafoods.weebly.com/store/p10/kozackie

Kara
  • 6,115
  • 16
  • 50
  • 57
justinpees
  • 420
  • 5
  • 20

1 Answers1

1

Unfortunately, I do not have enough reputation to comment on stackoverflow, so this is coming as a 'answer'.

I'm not sure of any way to do this with Weebly. The carts count/content seams to load last, so any JQuery ect.. wouldn't be able to count the contents. Even using something like var str = $( "span#wsite-nav-cart-num" ).text(); returns a dash - and not the actual number that appears in the CART (1).

I'm not sure why you would want this anyway, but that's up to you. I would suggest submitting a features request to Weebly.

P.S.. Weebly has community.weebly.com where your Weebly questions might get some better results,.. that is, unless someone directed you here.

EDIT:

Actually,.. After seeing your comment, it popped into my head, you can do a 'touchstart mouseover' event. Try this, in your Settings > SEO > Footer Code.

<script>
jQuery(function() {
var $ = jQuery;
  $(document).on('touchstart mouseover', 'a#wsite-com-minicart-checkout-button', function(e) {
      var totalCount = $( "span#wsite-nav-cart-num" ).text();
      var totalNeeded = 12;
      if (totalCount < totalNeeded) {
         var totalItems = totalNeeded - totalCount;
         $("a#wsite-com-minicart-checkout-button").click(function(event){
            event.stopImmediatePropagation();
            alert('We require ' + totalNeeded + ' items in order to checkout. You currently have ' + totalCount + '. Please add ' + totalItems + ' more items to the cart.');
           return false;
         });
      }
  });
});
</script>

The downside, something with the cart causes the alert to appear twice. And while it should work with a Responsive Theme(your current Theme), this wont work with Weebly's classic mobile Themes.

In the end, it will still be better if Weebly builds this into their system. Hope that helps!

Jeffrey Kastner
  • 651
  • 6
  • 15
  • If you want to take a closer look at my site, here it is: http://poloniafoods.weebly.com/store/p10/kozackie I'm just trying to limit my orders to 12 minimum or else I would lose money shipping 1 package myself to numerous individuals. Do you have a better way to limit my customers from buying only 1 item? Besides changing the quantity button to a minimum of 12, because I'd like to let my customers mix and match items only if they buy 12 or more. – justinpees Aug 15 '16 at 22:59
  • password to site: jakub – justinpees Aug 15 '16 at 23:02
  • Is there a way to make the checkout button unclickable if less than 12 items are in cart? – justinpees Aug 15 '16 at 23:43
  • @justinpees check out my EDIT. – Jeffrey Kastner Aug 16 '16 at 12:41
  • You are a genius!!! Thank you so much Jeffrey. If you figure out how to limit the notification to pop-up once instead of 2 or multiple time like I'm experience that would be awesome. Thanks again! <3 – justinpees Aug 17 '16 at 12:18
  • Also I've noticed that when I dismiss the notification then add 1 more item (still under the minimum) then click checkout it brings me to the checkout page even though I'm still under the minimum required. Any way around this problem too? – justinpees Aug 17 '16 at 12:23
  • edit ^^^ Actually, I've noticed that when I'm under the minimum, and I hover over the cart button several times before clicking checkout; the notification is multiplied by the amount of time I hovered before clicking. Do you think .active would work better than .hover? – justinpees Aug 17 '16 at 12:41
  • Hmm,.. It seams that the Cart's dropdown box automatically appears when adding additional items and that's causing it. ~Didn't think of, or test that. Let me take another look. – Jeffrey Kastner Aug 17 '16 at 20:30
  • It's almost there, I just need to change it so that instead of on hover over cart button, I need: on active of checkout button in mini cart. Any idea how to change this Jeffrey? – justinpees Aug 19 '16 at 05:08
  • Ok @justinpees I have edited the above answer, and tested it. That should work for you. ~Let me know how that goes. – Jeffrey Kastner Aug 19 '16 at 19:53
  • Wow!!! Fantastic work! Thank you so much Jeffrey :) It works exactly how I wanted it. – justinpees Aug 20 '16 at 18:23
  • I just have one more question about this issue and then I will open up a new, unrelated question and direct you there Jeffrey :) Is there a way to prevent the popup window from displaying the checkbox "prevent this page from displaying additional dialogs" On the second checkout attempt, the popup window will display this checkbox. – justinpees Aug 21 '16 at 18:26
  • That is the default behavior. The only way around that would be to create your own HTML pop-up that is triggered, instead of the Alert. – Jeffrey Kastner Aug 22 '16 at 01:18
  • Is there any way to have a button or checkbox for the user to click if they want to order for pickup instead? And if checked or clicked it would proceed to checkout? – justinpees Aug 22 '16 at 02:15
  • heres the new question: http://stackoverflow.com/questions/39070215/how-do-i-add-a-order-for-pickup-button-to-my-popup-window-allowing-to-proceed?noredirect=1#comment65489407_39070215 – justinpees Aug 22 '16 at 02:15