Wednesday, February 26, 2014

Remove Add to Cart button for Out of Stock items

There are several ways of dealing with Out of Stock products. Some of us don't want customers to be able to buy products that are out of stock.

OpenCart has an option AP > System > Settings > {Edit store} > Option > Stock, mark Stock Checkout as No) that disallows customers to check out if they have an out of stock item in their shopping cart. This is a start, but for many of us it's just not consequential!

Hence this mod. This extension removes the Add to Cart button and replaces it with an "Out of stock" message for out-of-stock products. This way, customers can't even place an out-of-stock product into their shopping carts.

Because this is a vQmod, no core files are touched, and the changes should carry over to the next version.

Requirements

  1. This is a vQmod for Opencart. Hence you need OpenCart and vQmod preinstalled.
  2. This vQmod is made for the default theme. Hence you should have the default theme as the active theme for this to work. While you can very easily modify this for other themes, the out-of-the-box support is only for default theme. If you don't know how, and need me to do paid customization, please PM me.
  3. Please note that this mod applies to all pages and modules shipped in Opencart core. But if you have an additional module or page containing an Add to Cart button, then unfortunately this mod will not affect it. You can modify the mod to affect that module/page, but the out-of-the-box support is only for OC default package. If you don't know how to make changes, and need me to do paid customization, please PM me.

Installation
Upload the contents of the uploads folder to your shop's root folder.

How do I change the color/size/font of the out of stock message?
Use CSS to style the class outofstock
(e.g. by using http://www.opencart.com/index.php?route ... on_id=6241 )
Sample css

CODE: SELECT ALL
.outofstock {
color: red;
font-size: 12px;
}


How do I change the text of the out of stock message?
AP > System > Localisation > Stock Statuses > {Edit Out of Stock}

Advertising
This free mod adds my link to your English site's footer (next to the Opencart link). It would be nice if you don't remove it. 

Extension page: http://www.opencart.com/index.php?route ... on_id=7095

No comments:

Post a Comment