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?
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.
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.
Re: Setting Up Quantity Limits For One Attribute
Quote:
Originally Posted by
fabienne
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?
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.
Re: Setting Up Quantity Limits For One Attribute
Quote:
Originally Posted by
fabienne
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.
Re: Setting Up Quantity Limits For One Attribute
This may or may not happen. Probably won't. But I think I have thought of a simple and even elegant alternative. I could have a separate product for each one of the 1ml samples, then I just put in the total quantity I have on hand in each produce and, voila...after the first 30 are sold, it goes to sold out status automatically. No muss no fuss, no extra coding. So, you have the product for the full sized items, next to them there is the product for the samples.
But like I said, this is a long shot for happening.
Re: Setting Up Quantity Limits For One Attribute
So let me understand this, you want to limit the quantity of one product to 30 having the attribute of 1ml, but can buy any number of product that offer 1ml sizes but only a max of 30 1ml size of any one product...
So: order 554:
30 1ml product 1
30 1ml product 2
2 10ml product 1
30 1ml product 3
Etc... To where the above would be a valid accetable cart quantity... (Is not how I understood the original question, but...)
Is that like what you're thinking?
Re: Setting Up Quantity Limits For One Attribute
Well, it's basically a moot point because after considering the implications of it all I have pretty much decided that it's more trouble than it's worth, on a number of different levels, not just how to present it in zencart. So I wouldn't spend any more time on it. I am grateful that you would pursue it but I don't like to waste your time. :smile: