Post by OC2PS » Sat Jun 30, 2012 5:52 am

Go to Extension page

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.
Last edited by OC2PS on Tue Aug 21, 2012 1:59 am, edited 1 time in total.

OC2PS
OC 2.3.0.2, vQmod 2.6.2, Journal2 theme
Arcfesték, Csillámtetoválás, Henna
Image
Check out: All my extensions | My FREE extensions


User avatar
Active Member

Posts

Joined
Wed Jul 22, 2009 4:15 am
Location - Hungary

Post by darbebe » Tue Jul 03, 2012 12:36 am

Hi,

i have installed the extension however unsure how to go about using it. Can you elaborate on how things go about after the installation?

This will be a helpful extension for my webbie.

Thanks in advance

Newbie

Posts

Joined
Thu Jun 21, 2012 12:50 pm

Post by OC2PS » Tue Jul 03, 2012 1:18 am

darbebe wrote:how things go about after the installation?
I've kept it simple. If the quantity (in stock) of an item goes below zero, then Add to Cart button is replaced by "Out of Stock" message. If Opencart is not doing the inventory for you (you have not selected "Subtract Stock:"), then you will need to manually set the Quantity of out of stock products to zero manually. That's pretty much all there's to it.

OC2PS
OC 2.3.0.2, vQmod 2.6.2, Journal2 theme
Arcfesték, Csillámtetoválás, Henna
Image
Check out: All my extensions | My FREE extensions


User avatar
Active Member

Posts

Joined
Wed Jul 22, 2009 4:15 am
Location - Hungary

Post by darbebe » Tue Jul 03, 2012 9:08 am

Thanks for your reply.

Please dont laugh at me as I'm new to opencart.

i have just installed the vQMod for this extension. Do i place the 'disable add to cart' file in the vqmod/xml folder?

Newbie

Posts

Joined
Thu Jun 21, 2012 12:50 pm

Post by OC2PS » Tue Jul 03, 2012 11:03 am

Yes. As a general principle for most extensions, and definitely for my extensions, if you upload the contents of upload folder to your shop root, files go to their correct places.

OC2PS
OC 2.3.0.2, vQmod 2.6.2, Journal2 theme
Arcfesték, Csillámtetoválás, Henna
Image
Check out: All my extensions | My FREE extensions


User avatar
Active Member

Posts

Joined
Wed Jul 22, 2009 4:15 am
Location - Hungary

Post by darbebe » Tue Jul 03, 2012 12:27 pm

Tried but it's not working.

The product is still able to be added into cart. Anything else that is required but not done by me?

Really thanks for your assistance.

Newbie

Posts

Joined
Thu Jun 21, 2012 12:50 pm

Post by OC2PS » Tue Jul 03, 2012 12:30 pm

Do you have OC 1.5.3.1? Do you have vQmod 1.2.6? Are you using Default theme?

OC2PS
OC 2.3.0.2, vQmod 2.6.2, Journal2 theme
Arcfesték, Csillámtetoválás, Henna
Image
Check out: All my extensions | My FREE extensions


User avatar
Active Member

Posts

Joined
Wed Jul 22, 2009 4:15 am
Location - Hungary

Post by darbebe » Tue Jul 03, 2012 12:40 pm

oh..my opencart version is 1.5.2.1. other than that, the vqmod and the theme is as per what you stated.

the extension does not work with my 1.5.2.1?

Newbie

Posts

Joined
Thu Jun 21, 2012 12:50 pm

Post by OC2PS » Tue Jul 03, 2012 12:49 pm

I have tested only with 1.5.3.1

OC2PS
OC 2.3.0.2, vQmod 2.6.2, Journal2 theme
Arcfesték, Csillámtetoválás, Henna
Image
Check out: All my extensions | My FREE extensions


User avatar
Active Member

Posts

Joined
Wed Jul 22, 2009 4:15 am
Location - Hungary

Post by jurpro » Sun Jul 08, 2012 12:23 pm

I'm using 1.5.3.1 but nothing happen. product still available even 0.

Cari album edisi luar negeri? Atau dalam negeri juga bisa. Kunjungi saja http://www.sawios.com Semoga bisa membantu. :)


User avatar
Active Member

Posts

Joined
Wed Jun 06, 2012 6:17 pm

Post by OC2PS » Sun Jul 08, 2012 2:27 pm

Default theme? vQmod 1.2.6?

OC2PS
OC 2.3.0.2, vQmod 2.6.2, Journal2 theme
Arcfesték, Csillámtetoválás, Henna
Image
Check out: All my extensions | My FREE extensions


User avatar
Active Member

Posts

Joined
Wed Jul 22, 2009 4:15 am
Location - Hungary

Post by jurpro » Sun Jul 08, 2012 3:20 pm

OC2PS wrote:Default theme? vQmod 1.2.6?
Yup... any broken code?

Cari album edisi luar negeri? Atau dalam negeri juga bisa. Kunjungi saja http://www.sawios.com Semoga bisa membantu. :)


User avatar
Active Member

Posts

Joined
Wed Jun 06, 2012 6:17 pm

Post by OC2PS » Sun Jul 08, 2012 4:03 pm

Can you provide a link to a product with quantity 0? Also, any other relevant details like mods etc.

Haven't seen this issue before.

OC2PS
OC 2.3.0.2, vQmod 2.6.2, Journal2 theme
Arcfesték, Csillámtetoválás, Henna
Image
Check out: All my extensions | My FREE extensions


User avatar
Active Member

Posts

Joined
Wed Jul 22, 2009 4:15 am
Location - Hungary

Post by hbg » Mon Jul 09, 2012 11:42 am

Hi, just a quick note to let you know I have tested it with 1.5.1.3. with Default Theme. I have just upgraded to VQMod 2.1.6.
Great Idea, but it didn't work.
This is an out of stock product:-
http://opencart.homebrewinn.com.au/shop ... eese-press
This was the error:-
--------- Date: 2012-07-09 03:37:21 ~ IP : 58.108.164.115 ----------
REQUEST URI : /shop/cheese-making/hardwaremoulds/mad-millie-cheese-press
MOD DETAILS:
modFile : /home/homebrew/public_html/opencart/shop/vqmod/xml/remove-add-to-cart-if-out-of-stock.xml
id : Remove Add to Cart button for Out of Stock items
version : 1.0.1
vqmver : 2.1.6
author : OC2PS
SEARCH NOT FOUND (ABORTING MOD): <input type="button" value="<?php echo $button_cart; ?>" onclick="addToCart('<?php echo $product['product_id']; ?>');" class="button" />

I thought that you maybe interested, for future development.

Opencart Version 1.5.1.3
https://www.opencart.homebrewinn.com.au/shop/


User avatar
hbg
Active Member

Posts

Joined
Wed Apr 13, 2011 8:52 am
Location - Newcastle NSW Australia

Post by OC2PS » Mon Jul 09, 2012 12:27 pm

hbg wrote:I have tested it with 1.5.1.3. with Default Theme.
Not supposed to work on 1.5.1.3

Developed for and tested with 1.5.3.1 as it says on documentation as well as in download compatibility.

OC2PS
OC 2.3.0.2, vQmod 2.6.2, Journal2 theme
Arcfesték, Csillámtetoválás, Henna
Image
Check out: All my extensions | My FREE extensions


User avatar
Active Member

Posts

Joined
Wed Jul 22, 2009 4:15 am
Location - Hungary

Post by hbg » Mon Jul 09, 2012 12:49 pm

OC2PS wrote:
hbg wrote:I have tested it with 1.5.1.3. with Default Theme.
Not supposed to work on 1.5.1.3

Developed for and tested with 1.5.3.1 as it says on documentation as well as in download compatibility.
Hi, some modules do work on other versions (even though they only state a particular version), but I just wanted to let you (& others) know that it won't work with 1.5.1.3. :-)

Opencart Version 1.5.1.3
https://www.opencart.homebrewinn.com.au/shop/


User avatar
hbg
Active Member

Posts

Joined
Wed Apr 13, 2011 8:52 am
Location - Newcastle NSW Australia

Post by OC2PS » Mon Jul 09, 2012 12:54 pm

I appreciate it.

All I meant is I won't go back to work on creating compatibility with older versions. If it works with 1.5.2.1 or 1.5.1.3, that's great, but I won't put additional effort to make it work with the versions that I have not intended it to work with.

OC2PS
OC 2.3.0.2, vQmod 2.6.2, Journal2 theme
Arcfesték, Csillámtetoválás, Henna
Image
Check out: All my extensions | My FREE extensions


User avatar
Active Member

Posts

Joined
Wed Jul 22, 2009 4:15 am
Location - Hungary

Post by loki52 » Thu Aug 09, 2012 1:33 am

I've tried installing this extension on a fresh install of opencart 1.5.3.1 with vqmod 2.1.6 and nothing happens to the product page when the quantity reaches 0. The "Add to Cart" button is still visible and active. Please advise.

Newbie

Posts

Joined
Thu Aug 02, 2012 12:51 am

Post by OC2PS » Thu Aug 09, 2012 2:57 am

loki52 wrote:The "Add to Cart" button is still visible and active. Please advise.
Please post a sample URL

OC2PS
OC 2.3.0.2, vQmod 2.6.2, Journal2 theme
Arcfesték, Csillámtetoválás, Henna
Image
Check out: All my extensions | My FREE extensions


User avatar
Active Member

Posts

Joined
Wed Jul 22, 2009 4:15 am
Location - Hungary

Post by estateP » Tue Aug 21, 2012 1:25 am

I have installed this and it works great. Many thanks! :)

One request though. The items I sell in my store are on off's, so when sold they are gone for good. I still want to keep them in the store as a showcase of products sold, and for SEO.

Because they are one off's, they are never going to come back into stock so the "out of stock" message is slightly misleading. Is there any way to change the message displayed to "SOLD" rather than "OUT OF STOCK"?

Also, is it possible to make the message text smaller.

Thanks for a great mod. Having the add to cart button on sold out items always seemed strange to me.

New member

Posts

Joined
Wed Jun 13, 2012 2:41 am
Who is online

Users browsing this forum: No registered users and 3 guests