potteryhouse / stock_by_attribute_1.5.4

Stock by Attribute for Zen Cart 1.5.3
GNU General Public License v2.0
2 stars 5 forks source link

Unavailable Items added to Shopping Cart without DD active #45

Closed mc12345678 closed 8 years ago

mc12345678 commented 8 years ago

Until commit: dab36bce81c3fc78c2c3feb2f34fbcea721b3b4a if a product tracked by SBA having more than one option name, with dynamic dropdowns inactive, and where the combination of option values was not assigned as an allowable variant, then it was possible that up to the quantity identified to the product (not an SBA tracked quantity) could be added to the cart without error.

The above commit has incorporated a checking process used elsewhere in the code, but performs the following:

  1. if the product is tracked by SBA, then if the combination of attributes are included as a single variant in the SBA table, then allow the product to be added.
  2. if the check of 1. above failed, then inspect that each of the attributes individually are listed in the SBA table. If each are present, then the minimum amount of that combination is provided.
  3. if the checks of 1 and 2 both fail then the customer is alerted by language define that the product is not available and the product is not added to the cart. When Dynamic Dropdowns is used, the same "action" occurs; however, through javascript and before the above code is activated. If javascript does not work/is not active, then the above code takes precedence.

What is not (yet) covered is the following: if a product has a variant of 2 or more option names and a variant of 1 or more option names, there is no "test" to validate that the SBA table supports distribution of the product (adding to the cart). In order to accomplish this tasking, there are a few aspects to consider, preferably from a reality standpoint rather than only a theoretical view.

  1. Whatever method(s) are to be allowed, the input (admin side) as well as the output (shopping cart) need to provide the checks and balances to minimize the problems associated.
  2. Likely will need to iterate through several options/combinations in order to "build" the product properly.
    2.a. Ie. would it be acceptable if two variants had overlapping objects to be considered a complete product?
    2.b. What if there were two or more ways to combine the series of attributes to get a single product, which combination should be used when removing items from stock if less than the full stock quantity is chosen? the one that is lower in stock? the one that has a larger stock quantity? Some sort of tracking system indicating which is easier/harder to restock? Etc... How many different options should be offered to the user/customer?
  3. Should there be limitations applied such that only certain methods are available based on previously entered data? (admin side)
  4. Implementing this feature would certainly widen up the opportunity to have non-stock related items included, although this feature is not the only reason to incorporate such a non-stock item capability.

Thoughts?

mc12345678 commented 8 years ago

This was referenced by issue #48 because for the purposes of the title, this issue is closed. With DD now disabled, there is a check performed when adding product to the cart to see if the product variant does exist as a defined variant.

Closed.