Here's a mod I've created, which works on every page of OpenCart where the "Add to Cart" button is shown:
http://www.opencart.com/index.php?route ... on_id=4358
You can choose to disable button for all "Out of Stock" items, or leave it enabled for "Pre-Order", "2 - 3 Days", etc.
Here's another for the options as well:
http://www.opencart.com/index.php?route ... on_id=4468
PM if you want 20% discount for purchasing both
http://www.opencart.com/index.php?route ... on_id=4358
You can choose to disable button for all "Out of Stock" items, or leave it enabled for "Pre-Order", "2 - 3 Days", etc.
Here's another for the options as well:
http://www.opencart.com/index.php?route ... on_id=4468
PM if you want 20% discount for purchasing both
See all my extensions: https://www.opencart.com/index.php?rout ... 20OpenCart
Thanks for releasing the usefull VQmod!
Has anyone used this for the shoppica theme? I tried to edit the xml file, the part that says
<!-- Clone this block and change default for additional themes -->
But after changing default to shoppica it does not seem to work.
Perhaps the theme is differant or I have another extension that is interfering with this. Any help/suggestions for shoppica theme would be appreciated
I did manage to get this to work for the default template of opencart 1.5.1.3, but not with shoppica
Has anyone used this for the shoppica theme? I tried to edit the xml file, the part that says
<!-- Clone this block and change default for additional themes -->
But after changing default to shoppica it does not seem to work.
Perhaps the theme is differant or I have another extension that is interfering with this. Any help/suggestions for shoppica theme would be appreciated
I did manage to get this to work for the default template of opencart 1.5.1.3, but not with shoppica
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.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)
UPDATE!
1.0.4 related product tab on the product page, on manufacturer, product compare and wishlist pagess Enjoy
Attachments
For OpenCart v1.5.1.3
Last edited by vytasm on Wed Feb 01, 2012 8:23 pm, edited 1 time in total.
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.
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.
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"
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.
Attachments
OpenCart v1.5.1.3
Change "Add to cart" when out of stock
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?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!
It doesn't appear to be working for 1.5.2.1.
Awali Art
Original Imported Fine Art
Store Front
Facebook
Twiter
YouTube
I have updated the mod but t he "out of stock" button will show everywhere except the category page..
Maybe someone can do it, i am a newbie:) Here it goes:
Maybe someone can do it, i am a newbie:) Here it goes:
i changed a little bit Miran's code to make it working for category. It seems to be working for me. Hopefully, it will work for you guys also. I tested with 1.5.2.1 version.
one small bug for that new version (1.5.2.1)
if a category is empty you get an error
Notice: Undefined variable: result in ....\vqmod\vqcache\vq2-catalog_controller_product_category.php on line 271
you need to change this
to this
it may need it elsewhere too but I haven't checked
if a category is empty you get an error
Notice: Undefined variable: result in ....\vqmod\vqcache\vq2-catalog_controller_product_category.php on line 271
you need to change this
Code: Select all
<!-- Category Controller Mod -->
<file name="catalog/controller/product/category.php">
<operation error="skip"><!-- v15x -->
<search position="before"><![CDATA[
if ($this->config->get('config_review_status')) {
]]></search>
<add trim="true"><![CDATA[
if ((float)$result['quantity']) {
$quantity = (int)$result['quantity'];
} else {
$quantity = false;
}
]]></add>
</operation>
to this
Code: Select all
<!-- Category Controller Mod -->
<file name="catalog/controller/product/category.php">
<operation error="skip"><!-- v15x -->
<search position="before"><![CDATA[
if ($this->config->get('config_review_status')) {
]]></search>
<add trim="true"><![CDATA[
if(!isset($result['quantity'])) $result['quantity'] = 0;
if ((float)$result['quantity']) {
$quantity = (int)$result['quantity'];
} else {
$quantity = false;
}
]]></add>
</operation>
Hello Vytasm,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.
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.
Any ideas on how to overcome this?
Who is online
Users browsing this forum: No registered users and 7 guests