Stock Check & max Quantity

Table of Contents

You can purchase and download this extension at the Opencart Extension Store

A full list of my extensions is availble here: Opencart Market Place

Overview

This extension prevents the adding to cart of items that are not in stock. It also gives you an additional field for the product maximum – that being the maximum amount of a product that can be added to the cart.

The stock check feature can be turned off for individual products to allow you to sell pre-order products while still restricting normal products – see settings section below.

REMEMBER TO BACKUP YOUR FILES BEFORE MAKING ANY CHANGES

If using Opencart 3.x then I recommend installing this extension - Modification Manager - or similar as if you have any issues with the your theme or template then making alterations to extension is faster and easier.

New Installation - Opencart 3.

  1. Go to Admin -> Extensions -> Installer and upload the
    max_qyt_and_stock_check.xxxxxxxx.ocmod.zip file.
  2. Go to Admin -> Extensions -> Modifications and click
    Refresh to refresh the modification cache (top right).
  3. Go to Admin -> Extensions -> Extensions
  4. Select Modules and install the Stock Check Module

New Installation Opencart 1.5.x (vQmod)

  1. Before installation make sure you have already installed the latest vQmod.
  2. Upload the contents of the /upload folder for the version of Opencart that you use.
  3. Go to Catalog > Products and Edit any product
  4. Go to the Data Tab and click the Install button

Settings

For a normal shop without pre-order (so, only allow products that are in stock to be added to cart and only checkout with products in stock

    • Edit a product and you will see a new ‘Maximum’ field ‘Stock Check’ field and ‘Backorder‘ field switches.
    • Default for Maximum is 0 (no maximum). If you want to set a maximum, enter a number here.
    • Default for ‘Stock Check’ is YES. Leave this set to YES.
    • Default for ’Backorder’ is NO. Leave this set to NO.
    • Go to System > Setting [options tab] and scroll down to the STOCK section. Set ‘Stock Checkout’ to NO.

For shop that allows pre-order items (selling more than is in stock):

  • Create or rename a Stock Status if necessary like ’7 - 10 days’ or whatever it happens to be, the stock status is shown in the cart.
  • Edit a product and you will see a new ‘Maximum’ field ‘Stock Check’ field and ‘Backorder‘ field switches.
  • Default for Maximum is 0 (no maximum). If you want to set a maximum, enter a number here.
  • Default for ‘Stock Check’ is YES. Leave this set to YES.
  • Default for ’Backorder’ is NO. Set this to YES.
  • Set the ’Out of Stock Status’ to the correct status. The Out of Stock Status is what will show in the cart if the product is out of stock or they have added more than is in stock.
  • Go to System > Setting [options tab] and scroll down to the STOCK section. Set ‘Stock Checkout’ to NO.

Information:

For OC3.x, this extension makes use of both OCMOD and the Opencart Events System. To view the events that are installed go to admin -> Extensions -> Events.

Installing the module or clicking the Install Button (OC1.5.x) will update the database product table - 3 new fields are added: Maximum, stockcheck and backorder.  These are not removed when the extension is removed in case you want to reinstall the extension. Defaults are set and you should not have any issue with these extra fields with the extension removed.

Uninstall

Opencart 3.x
  1. Go to Extensions -> Modules
  2. Uninstall the Stock Check Module
  3. Go to Extension -> Installer and uninstall the max_qyt_and_stock_check.xxxxxxxx.ocmod.zip entry
    This will remove the files from your server.
  4. Go to Extensions -> Modifications and click on the refresh button.
Opencart 1.5.x (vQmod)
  1. Rename or delete the file ../vqmod/xml/max_quantity.xml

Known Issues

This will not work by default on 3rd party checkouts where there is a cart module on the checkout page (i.e. One Page Checkouts).

 
It is normally a simple fix to get it to work but you will need to supply me with ftp details and an admin login.  Please send support request via the support form.

Support

For help and support please use the email form Email Support Form

If something has gone wrong or you need support then please include as much information as possible and a full description of the problem.  If you send me an email that just says 'it's not working', support is going to take a lot longer as I'm going to have to start asking lots of questions.... the more information I have the quicker I can solve any problems.