Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13
  1. #11
    Join Date
    Feb 2007
    Posts
    1
    Plugin Contributions
    0

    Default Re: min purchase setup

    The minimum order module download that Sunabac posted seems to be working for me, but it's true that this mod is based on the total order price, rather than quantity.

    That said, if you download and have a look at its code, it's a really simple mod. So if you don't mind hard-coding your minimum quantity, don't even install the mod, just have a look at the file here:

    includes/templates/yourtemplate/templates/tpl_shopping_cart_default.php

    Diff'ing his version to the standard version, I figured out I needed to add this section at line 51 (right after <?php } //endif flagAnyOutOfStock ?>):
    Code:
    <?php // BOF MIN ORDER AMOUNT
    if ($_SESSION['cart']->count_contents() < 12) {?>
    <div class="messageStackError"><?php echo sprintf('You must have at least 12 items in your cart to checkout.'); ?></div>
    <?php }// EOF MIN ORDER AMOUNT ?>
    Then, lower in the same file, starting at line 132 (right after <!--bof shopping cart buttons-->), replace this section of code:

    Code:
    <div class="buttonRow forward"><?php echo '<a href="' . zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . zen_image_button(BUTTON_IMAGE_CHECKOUT, BUTTON_CHECKOUT_ALT) . '</a>'; ?></div>
    With a wrapped version that also checks for the cart's quantity:

    Code:
    <?php // BOF MIN ORDER AMOUNT
    if ($_SESSION['cart']->count_contents() >= 12) {?>
    <div class="buttonRow forward"><?php echo '<a href="' . zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . zen_image_button(BUTTON_IMAGE_CHECKOUT, BUTTON_CHECKOUT_ALT) . '</a>'; ?></div>
    <?php }// EOF MIN ORDER AMOUNT ?>
    Obviously change the error message and number 12 to whatever your minimum quantity really is.

    This is my first foray into ZenCart hacking, but if I'm feeling really ambitious maybe I'll repackage this mod into one that does this quantity check automagically.

    BTW, very nicely customized wine shop cosmicomic, you wouldn't know it's ZC...

    Also, thanks to Ajeh and the ZC team, this is really impressive stuff. While I hope the admin section gets a usability overhaul sooner rather than later, you can't beat the ability to customize!

  2. #12
    Join Date
    Dec 2006
    Location
    Summer:Ontaio, Winter:Texas
    Posts
    211
    Plugin Contributions
    0

    Default Re: min purchase setup

    I am actually using the minimum amount, rather than the quantity, that was not a problem. If I set-up admin with 2 wholesale amounts they will work ONLY as long as I don't edit that product. If I go to edit, it will drop the cents for the first price and the full amount of the second price.... So I have to keep on re-entering price(s) every time I edit a product...

  3. #13
    Join Date
    Nov 2007
    Location
    North East United Kingdom
    Posts
    25
    Plugin Contributions
    0

    red flag Re: min purchase setup

    Hi Pauline,
    did you manage to find out if / how to do this?
    I am looking for the same feature and having the same problems you did!
    Any help or suggestions from your own experience would be greatly appreciated.
    Cheers,
    Ben

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. Min. Purchase price per model number
    By lisah746 in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 1 May 2009, 08:44 PM
  2. Free Item Contingent upon the Purchase of another item-How to setup?
    By everest in forum Setting Up Specials and SaleMaker
    Replies: 0
    Last Post: 15 May 2008, 01:19 AM
  3. How to Setup a max amout of purchase
    By Onatop in forum General Questions
    Replies: 4
    Last Post: 24 Jun 2007, 08:06 PM
  4. Coupon is restricting min purchase to category
    By wittymom in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 0
    Last Post: 11 Dec 2006, 09:20 PM
  5. Have UPS setup, however, when test purchase, ups is not showing...
    By weber in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 15 Nov 2006, 08:27 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg