Announcement

Collapse
No announcement yet.

Overall order quantity

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

    Overall order quantity

    I want to stop the order going to checkout if the customer has not reached a minimum order quantity of 2. That can be made up of qty 2 of any single code, or at least two codes with a qty of 1 ordered. Has anyone done anything similar?

    #2
    There is a patch in the Advanced User Guide for seting a minimum order value (headed 'Setting a Minimum Order Value' on p54) but there is not an equivalent one for quantity.

    The only variable I am aware of for quantity is the JavaScript variable used in the shopping cart summary i.e. getCartItem(3) I've been fiddling around with JavaScript trying to come up with something but without success.

    I don't know whether someone else here has any ideas. Otherwise maybe register an email support question at http://www.actinic.co.uk/support/register.htm and the team there can research further.

    Comment


      #3
      Thanks Chris. As an AS/400 programming dinosaur it rankles with me slightly to be using what seems a clumsy solution but I dont know Perl so I can use the Min Value patch by using the price of my cheapest item multiplied by two; but I will put in something to the Actinic development team and get a book on Perl and JavaScript. Thanks again.

      Comment


        #4
        I've posted somewhere on this Forum regarding making it impossible to proceed to checkout if a Terms And Conditions checkbox isn't checked. This could be modified to check the GetCartItem(3) value instead.

        I've attached it here. Good luck.

        I also did some similar posts regarding "selling by the case" - someone selling wine would only allow multiples of 6 to be bought and the customer was warned if they had the wrong number in the cart.

        Norman
        Attached Files
        Norman - www.drillpine.biz
        Edinburgh, U K / Bitez, Turkey

        Comment


          #5
          This simple patch should do it:-

          Code:
          Stoppping Checkout unless 2 or more items in Cart
          
          Edit Act_Order00.html
          
          Look for the Line:-
          
          			<input type=SUBMIT name=ACTION value="NETQUOTEVAR:NEXTBUTTON">
          
          REPLACE it with:-
          
          
          <script language=JavaScript>
          <!--
          /***********************************************************************
          *
          * getCartItem		-	Gets the Actinic Cart Value & No of Items
          *
          ************************************************************************/
          
          //CART_CONTENT = Cookie name
          //1 = TOTAL_VALUE
          //3 = CART_COUNT
          
          function getCartItem(index)
          	{
          	var act_cart= getCookie("CART_CONTENT")
          	temp =(act_cart != null) ? temp=act_cart.split("\t"):0;
          	return (temp.length > 0) ? temp[index] : 0;
          	}
          // -->
          </script>
          
          <input type=SUBMIT name=ACTION value="NETQUOTEVAR:NEXTBUTTON" onclick="if (getCartItem(3) >= 2) {return true;} else {alert('Minimum order is 2 items');return false;}">
          <!--			<input type=SUBMIT name=ACTION value="NETQUOTEVAR:NEXTBUTTON"> -->
          Norman
          Norman - www.drillpine.biz
          Edinburgh, U K / Bitez, Turkey

          Comment


            #6
            Thankyou Norman. Having a proper solution makes me alot happier. Is there a good book you know to get me started on Perl and/or JavaScript so I can get to grips with whats going on? The solution for the wine seller was the one I had been searching for. Your time and effort is much appreciated - Regards Tim.

            Comment


              #7
              More info

              Once again Norman has come up trumps. However where do we find detailed info on stuff like CART_CONTENT. I've looked in the Advanced user guide etc but don't seem to see anything. Or is it a case of plodding through the code?
              I'd be really interested in getting deeper into Actinic but a pointer in the right direction would be very much appreciated.

              Comment


                #8
                When the Advanced Guide, etc don't help it's really a matter of poking through the code yourself.

                That little fragment above was lifted from reading the source of actinicextras.js.

                In fact on re-reading it you may be able to do without the function as it is already defined. Try this instead:-
                Code:
                Look for the Line:-
                
                			<input type=SUBMIT name=ACTION value="NETQUOTEVAR:NEXTBUTTON">
                
                REPLACE it with:-
                
                
                <input type=SUBMIT name=ACTION value="NETQUOTEVAR:NEXTBUTTON" onclick="if (getCartItem(3) >= 2) {return true;} else {alert('Minimum order is 2 items');return false;}">
                <!--			<input type=SUBMIT name=ACTION value="NETQUOTEVAR:NEXTBUTTON"> -->
                Norman
                Norman - www.drillpine.biz
                Edinburgh, U K / Bitez, Turkey

                Comment


                  #9
                  Thanks

                  Thanks Norman: I'll take your advice and try to find time real time to start digging deeper myself.
                  Thanks again though for the solution: saved me a lot of time & grief

                  Comment


                    #10
                    Wine Sales

                    We're trying to get a wine sale site up and running. One of the legal requirements (apparently) is that a minimum of 12 bottles must be ordered per order (otherwise you become a retailer; different licence, more hassles etc)

                    We've implemented Norman's "fix" as above to ensure that a minimum of 12 bottles of wine are ordered from the site for each order. It works perfectly (thanks again Norman) but now (of course) we're running into another problem.

                    Our customer also wants to sell preselected cases i.e. 12 bottles = 1 case, satisifies the legal side but of course leaves us with a basket total of 1 (although there are 12 bottles) which sets off the warning message at check out and shunts the user back to the ordering page.
                    (There may also be instances in the future where it is required to sell non-alcoholic items, e.g. corkscrews so a similar, if not identical problem will arise)

                    We've considered setting the case offers as 12 bottles @ case price/12 per bottle, but this is clumsy and not customer friendly. Also as these are being sold by the case we have to enforce purchase in multiples of 12 (and yes we've seen the thread on multiples, but that's also going to force all purchases into mutiples of 12 which we don't want)

                    We've thought about trapping the reference numbers (i.e. trapping only ref numbers below, say, 200 for the minnimum quantity check), but I can't track down where these are stored in order to catch them at checkout.

                    Any ideas forward would be MUCH appreciated:

                    Dave

                    Comment


                      #11
                      My suggestion is to create 12 components within the 'box' product - each one representing a bottle in the box. Then associate each component with the equivalent bottle of wine in the store. Then select 'Component as Seperate Order Line' for each component and it should automatically populate the shopping cart with 12 order lines when the single box is added to the shopping cart. Hopefully this will satisfy the JavaScript.

                      Comment


                        #12
                        Thanks Chris for the reply.

                        I've just tried that out but for some reason the components added don't seem to increment the value of cartitem(3). Or put it this way despite the components (the bottles) appearing correctly as an order in the basket only the "Product" (i.e. the case) seems to increment the variable. How that can be I don't know, I'm sure you will know

                        Apart from that it's not a very elegant solution and looks confusing at checkout (sorry not meant to be a criticism of your idea). I'd still like to explore the possibility of checking the product reference on the basis that if it's written to the checkout page then there must be a process which writes it and a variable/array carrying it. If we could then work on excluding a range of Product References from the JavaScript check for minimum quantity then our problem is solved (well apart from writing the code )

                        Any more comments you or anyone else can make will be welcome.

                        (Please forgive our/my limited knowledge: the answer is probably staring us in the face & thanks again)

                        Dave

                        Comment


                          #13
                          Following on from the above I amended Act_order00.html to write the value of CartItem(3) to the screen and indeed it shows only an increment of 1 if a case is added altough all the component bottles appear in the order.

                          Dave

                          Comment


                            #14
                            Shame that didn't work. The problem is that it is registered as a single order line, despite the fact that there are 12 items in the order line.

                            What you need to do is get them to effectively buy the single 'package' product 12 times but only pay for it once. You can set the minimum quantity orderable for a product to '12' in the 'General' tab of the product. And in the Advanced User Guide there is a little fix for forcing customers to order a certain quantity of items (using a hidden quantity field).

                            The tricky bit is getting the correct price in the shopping cart. I'm guessing that the price of the package is not easily divisible by 12. It will also show up as 12 items in the shopping cart - which will be confusing for customers.

                            OK - maybe that isn't such a great suggestion...

                            The only way I can think to do it is have the single 'package' product on its own page with a shopping mode of 'single add to cart button per page'. You then have a product underneath the package product which will automatically add 11 order lines to the shopping cart when the single add-to-cart button is clicked.

                            You would do it by laying out the 'padding' product with a really cut-down product layout template which pretty much only included the hidden quantity field into the HTML. You would need to call it something like "Ignore this line - it is just to keep the checkout happy" (or something more professional) so that when it is added to the shopping cart it doesn't freak people out.

                            Does that make sense? If you want more in-depth help I suggest registering an email support query at http://www.actinic.co.uk/support/register.htm as I am now going to be out of the office until Thursday.

                            Comment


                              #15
                              Thanks Chris: I'll think about this: have a good holiday (is it holiday??) & thanks for all your help. No doubt I'll have posted again before you get back!

                              Dave

                              Comment

                              Working...
                              X