AbanteCart Community

AbanteCart Development => New Features Discussion => Topic started by: Nimitz1061 on June 26, 2012, 08:03:34 PM

Title: API request
Post by: Nimitz1061 on June 26, 2012, 08:03:34 PM
Can we get the quantity on hand checks encapsulated and hooked?  This would be most helpful for a project we're working on..

(particularly concerned with add to cart and cart validation in checkout)

David
Title: Re: API request
Post by: abantecart on June 27, 2012, 09:38:22 AM
There is no way currently to get quantity for the product. This was hidden for storefront users. There was a concern with unwanted requests for product quantity.

This can be added as easy as creating new controller quantity.php with access to product model.

public_html/storefront/controller/api/product/quantity.php
Title: Re: API request
Post by: Nimitz1061 on June 29, 2012, 12:28:31 PM
I'm not looking for a way to serve up quantity on hand to the customer, but for checks of requested quantity against quantity on hand.

It would appear to be necessary to add this to existing controllers....

David
Title: Re: API request
Post by: Nimitz1061 on June 29, 2012, 12:52:55 PM
Looking at core/lib/cart.php - I think what we would need would be to have a method added, say checkQOH or checkQuantity that encapsulates existing checks against quantity on hand.

This should allow us to add the additional controllers we need...
Title: Re: API request
Post by: abantecart on June 29, 2012, 04:19:01 PM
2 important points before you change core code:

1. I suggest to extend class rather than change it. This will prevent issues with future upgrades.
2. If you think this is missing or important feature, you can suggest it for us to develop, or even better, you can develop it and suggest for us to add it to the core.

Title: Re: API request
Post by: Nimitz1061 on June 30, 2012, 07:46:33 AM
2 important points before you change core code:

1. I suggest to extend class rather than change it. This will prevent issues with future upgrades.
2. If you think this is missing or important feature, you can suggest it for us to develop, or even better, you can develop it and suggest for us to add it to the core.



I thought suggesting core feature developments was what this sub-forum was about.  We're looking to prevent issues with future upgrades and are asking the core development team to encapsulate this as a method because it extends the standard API in such a way as to limit the impact of future development. 

David
Title: Re: API request
Post by: abantecart on July 02, 2012, 08:21:55 AM
Thank you for suggestion. We will consider this. Unfortunately, I can not give you exact date yet.
Title: Re: API request
Post by: Nimitz1061 on July 03, 2012, 10:14:06 AM
I understand the time scale issues.  We are still involved in design activities ourselves, so the timing is good.

We will be doing a number of addon projects which will need to affect quantity on hand tracking throughout the cart.  It will be best for us if we have methods which will remain stable, so I appreciate your efforts here.

Thanks.

David
Title: Re: API request
Post by: abantecart on July 03, 2012, 03:06:35 PM
Stability is a key. We are working on that. I really want to put many features into core, but there is a negative side too that effects stability of core if done too fast.
Leaving some room for developers to create extensions :)