Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2010
    Posts
    117
    Plugin Contributions
    0

    Default Disable Automatic Stock Adjustment in Shopping Cart

    Hi,

    I have searched the Forum but found not solution to my issues.

    A couple of weeks ago we upgraded from v1.3.9 to v1.5.6. It seemed to go well except for an issue that my customers are complaining about.

    When there is insufficient stock, it is automatically adjusted, with the warning message -
    - Quantity has been adjusted to what is in stock + list of items.

    If my customers haven't logged in for a while, then it can be a long list of items and it is hard for them to see "at a glance" which items it's referring to.

    In the v.1.3.9 the insufficient/sold out items where marked with *** and the following message:
    Products marked with *** are out of stock or there are not enough in stock to fill your order.
    Please change the quantity of products marked with (***). Thank you


    In the new Version of ZC I see the option to add the (***) in config/stock/Mark product out of Stock, but it's not showing in the Shopping Cart.

    So my question, is it possible to disable the automatic adjusting and enable the manually adjusting, like in the older versions?

    Info:

    Upgrade v1.3.9 - v1.5.6
    Plugins: Minimum Order Total / Edit Orders / several others..
    PHP Version: 7.1.1

    Happy to provide link to shop, if necessary.

    thanks for your help

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

    Default Re: Disable Automatic Stock Adjustment in Shopping Cart

    This has been a transition occurring "slowly" over the last couple of versions. The "mark out-of-stock" part occurs when the product is permitted to be out-of-stock as identified by the various configuration->stock settings.

    I can remember a time when I was told that it was undesirable for the system to auto-adjust to the maximum available quantity because it allowed competitors to know the quantity in hand or some other potentially unusual reason. However, now the base code auto-adjusts downward to the largest available if the stored in cart total exceeds the allowable or if more than available is attempted to be added to the cart.

    With the setting configuration->stock->Allow Checkout set to true, then the quantity will not be auto-adjusted and will be identified as being "out-of-stock". But, that also will mean that users will be able to checkout with quantity on "back order".

    If that behavior is not desired (checkout with insufficient quantity on hand), then in includes/classes/shopping_cart.php if you search for STOCK_ALLOW_CHECKOUT and then in any if statement line that contains that text if you prepend it with a false && then there would not be the auto-adjustment and the quantity would exceed the available and the user would need to correct the total in order to checkout.

    So and example would be changing:
    Code:
    if (STOCK_ALLOW_CHECKOUT == 'false' &&($new_qty > $chk_current_qty)) {
    To:
    Code:
    if (false && STOCK_ALLOW_CHECKOUT == 'false' && ($new_qty > $chk_current_qty)) {
    There are other occurrences of STOCK_ALLOW_CHECKOUT within the file, but a similar modification could be made for each of those to prevent the addition from affecting the quantity that had been stored in the cart or is added to the cart from the store.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Nov 2010
    Posts
    117
    Plugin Contributions
    0

    Default Re: Disable Automatic Stock Adjustment in Shopping Cart

    Hi,

    I sort of missed this reply.

    thanks for your reply and Suggestion. I am abit worried about changing core files - we might give it a go after we change to v1.5.6b.

    thanks again

 

 

Similar Threads

  1. v151 Automatic Update of quantity in cart to available stock
    By amirshawn80 in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 20 Jan 2013, 03:59 PM
  2. Attribute - Stock Adjustment - Help?
    By lastlokean in forum Setting Up Categories, Products, Attributes
    Replies: 6
    Last Post: 28 Nov 2012, 11:30 PM
  3. Replies: 5
    Last Post: 3 Aug 2011, 08:15 AM
  4. How to disable out of stock in the main-page-shopping-cart?
    By insidethelogcabin in forum Basic Configuration
    Replies: 2
    Last Post: 1 Feb 2007, 05:56 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