mwshark wrote:
I have modified the previous version as I too needed the mod to work for the latest products. I have updated the new version (attached)

I have modified it to work with related product tab. Now it changes buttons "Add to cart" to "Out of stock" and disables them for all products that are out of stock (quantity <= 0). Tested on OC 1.5.1.3 default theme.

Change "Add to cart" button when product is out of stock. Created for OpenCart v1.5.1.3
Works on all standard theme places (Product, category, manufacturer, search, featured, specials, latest, wishlist, compare) where "Add to cart" button appears.

In v1.2.0 added new functionality.

When item quantity is 0 then "Add to cart" button is disabled and label is changed to "Out of stock".

When item quantity is less than 0 (ex. -1), then "Add to cart" button is enabled and label is changed to "Pre-Order". This allows add items into cart and checkout if checkout is enabled when items are not in stock (Admin -> System -> Settings -> (Select shop) -> Option -> set "YES" for "Stock Checkout"). If this is not enabled then Add to cart is disabled and label is set to "Out of stock"

So now it is customers can buy products even when they are not in stock, showing that information on "Add to cart" button anywhere.

UPDATED!
v1.2.1 2012.02.06 vytasm - (OpenCart v1.5.1.3)
- Bugfix: fixed problem in few modules when button was in Pre-Order state was not possible to add items to Cart.

svenman wrote:Hi,
Thank you very much for this, it's great! However, the 'out of stock' button looks strange, the left side is square and there is grey area behind it. How do I change this? I'm very new at this...
Thanks!

Have you a picture, or better a link to your shop that I could see. Link you can post me using PM then I can say what is wrong. maybe I have left something with the styles... By the way what version of OC are you using?

vytasm wrote:UPDATED!
v1.2.1 2012.02.06 vytasm - (OpenCart v1.5.1.3)
- Bugfix: fixed problem in few modules when button was in Pre-Order state was not possible to add items to Cart.

Hello Vytasm,

Great Mod!

However, I have found a quirk which I hope someone may be able to resolve. Here goes, I hope it makes sense...

For Pre Order to work, this mod requires the Stock Checkout option to be enabled. This almost works perfectly. If the product stock quantity is zero the Add to Cart button will be disabled (even when Stock Checkout is enabled) and the Out of Stock button will appear. If the stock is set to a negative quantity, the Pre Order button will show up and the customer can complete Checkout... So far, so good.

However the problem is, if for example there is perhaps 2 remaining of a particular product and you do not want to sell this product when out of stock, if the customer adds 3 or more to their basket, they are still able to Checkout due to Stock Checkout being enabled.