Results 1 to 9 of 9

Hybrid View

  1. #1
    Join Date
    May 2007
    Location
    Cincinnati, Ohio
    Posts
    244
    Plugin Contributions
    0

    Default Setting Up Quantity Limits For One Attribute

    I am using Zencart and have categories of products. In the category, I have attributes and I have set up an attribute for size. I sell 1 ml, 6ml, 10ml bottles of my product. The 1ml size is a sample size and I would like to limit the number of samples I sell to 30 pieces but I would like to keep the rest of the sizes as an unlimited quantity, so that customers could buy up to 30 samples of the product but after that only full sized versions of the product would be available. How could I do this? Is it possible?
    The Zen of cat.

  2. #2
    Join Date
    Jul 2012
    Posts
    16,743
    Plugin Contributions
    17

    Default Re: Setting Up Quantity Limits For One Attribute

    It would require custom coding to limit one attribute among many others. If the "sample" size were offered all on their own, then it could be done with ZC out-of-the-box. But also I think would be difficult to manage as would have to update multiple entries if/when that product changed...

    So, the controlled part is the addition of a product to the cart. An event is triggered that reads the directory extra_cart_actions. At this point, there is information being Posted and data that is already represented in the cart. Need to evaluate the items added specifically for the sample size (all other comparisons would be done by the routine cart actions) and process as setup by ZC admin. Ie. dump them with notification if the quantity in cart plus the quantity added exceeds the limit, or let them get added, but not able to process further (checkout), add enough to meet the limit, etc....

    Basically would/could look at and treat all product with the option name and option value that represents 1ml (hopefully all use the same one and not multiple different representations) as a single product that is maxed at 30 or whatever number is to be the maximum.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    May 2007
    Location
    Cincinnati, Ohio
    Posts
    244
    Plugin Contributions
    0

    Default Re: Setting Up Quantity Limits For One Attribute

    Well, that sounds like a lot of trouble. I had good success with something much simpler and so I think I will stick with that. Thanks for responding though.
    The Zen of cat.

  4. #4
    Join Date
    Jul 2012
    Posts
    16,743
    Plugin Contributions
    17

    Default Re: Setting Up Quantity Limits For One Attribute

    Quote Originally Posted by fabienne View Post
    Well, that sounds like a lot of trouble. I had good success with something much simpler and so I think I will stick with that. Thanks for responding though.
    What was the simpler solution that was applied?
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  5. #5
    Join Date
    May 2007
    Location
    Cincinnati, Ohio
    Posts
    244
    Plugin Contributions
    0

    Default Re: Setting Up Quantity Limits For One Attribute

    It does not cover all bases at all. I just put in a separate item for the 1ml size. They had to write in the name of the blend they wanted in the comments section of the checkout form. I didn't have a strict quantity limit for it, I just kept track by eyeballing it (I am pretty good at that by this time) and it worked out well. I was wondering if there was some way to do it better/more sophisticatedly/etc. I suspected that there was not but thought I would ask, as you have a lot more experience with zencart than I do.
    The Zen of cat.

  6. #6
    Join Date
    Jul 2012
    Posts
    16,743
    Plugin Contributions
    17

    Default Re: Setting Up Quantity Limits For One Attribute

    Quote Originally Posted by fabienne View Post
    It does not cover all bases at all. I just put in a separate item for the 1ml size. They had to write in the name of the blend they wanted in the comments section of the checkout form. I didn't have a strict quantity limit for it, I just kept track by eyeballing it (I am pretty good at that by this time) and it worked out well. I was wondering if there was some way to do it better/more sophisticatedly/etc. I suspected that there was not but thought I would ask, as you have a lot more experience with zencart than I do.
    I wouldn't say it need be sopisticated, but certainly could be more elegant...

    It also can be very simple if the attrbutes are set up with simplicity. Ask for clarification of anything I'm about to try to describe that may not be understood:
    When reviewing the option names entered in the option names manager for the size of the bottle, is there only one such option name that is applied to all scent product that come in a size? Or is there several like fragrance1 size, fragrance2 size, etc....?

    If the answer is that every fragrance has the exact same option_id (data value of the option name) then they will also all have the same option_value_id for the 1ml option.

    With those two pieces known, when an item is added to the cart, two ways to approach, either first see if the item being added is a limiting product and then see if the limit has been reached (I think this is the preferred sequence) or identify hoow many of the limiting product are in the cart and then if the add-to-cart is the limiting item and te sum of the existing and new exceeds the limit take appropriate action...

    Both end up either allowing, preventing, or partially allowing product being added, but there are differences in the amount of "work" they each perform.

    Sure it can be coded to handle several different option_id and option_value_id pairs, but the simplest both for the code and I would say for operation/maintenance is for all product to be sold with the same type option to just simply use the same option(s) throughout.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 

Similar Threads

  1. Attribute Grid / Quantity Discount only one attribute
    By quattro in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 21 Jan 2011, 10:07 AM
  2. How to set Attribute for certain quantity of one product?
    By lioncity in forum General Questions
    Replies: 2
    Last Post: 8 Dec 2008, 04:49 PM
  3. One Product with Quantity Discounts on Only One Attribute
    By blesko in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 19 Jun 2008, 02:52 AM
  4. If chosen, attribute limits order quantity to 1?
    By rdhinman in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 16 Feb 2008, 06:00 PM
  5. Setting Quantity based on attribute
    By decoxjr in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 6 Apr 2007, 06:26 AM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR