Most of the items in my store will be in stock only once. so when they are sold out, most likely they will not be restocked.
How would someone change a items status in the db to "disable", instead of simply listed out of stock in the front end?
Once a item is gone I have no reason for it to still show up in the store.
I don't what to delete the item from the db yet, I would rather do that in the admin once I know for sure it was really sold out or not going to be restocked.
It might be good if this could be made an option that could be triggered off of the "Out Of Stock Status:" in the admin area so if you chose let say "disable item" instead of "More Coming Soon" or "Out of stock" then it would automatically disable the item. - I am sure there are others who could use something like this.
How would someone change a items status in the db to "disable", instead of simply listed out of stock in the front end?
Once a item is gone I have no reason for it to still show up in the store.
I don't what to delete the item from the db yet, I would rather do that in the admin once I know for sure it was really sold out or not going to be restocked.
It might be good if this could be made an option that could be triggered off of the "Out Of Stock Status:" in the admin area so if you chose let say "disable item" instead of "More Coming Soon" or "Out of stock" then it would automatically disable the item. - I am sure there are others who could use something like this.
Oh my.. That is just what i needed. Have you found a way to do this yet?
I have been using Open Cart for a friends store but i can see that Would help her us so much.
I have been using Open Cart for a friends store but i can see that Would help her us so much.
»-(¯`·.·´¯)->"The most wasted day in that in which we have not laughed."<-(¯`·.·´¯)-«
1. Edit: catalog/model/catalog/product.php
2. All places you find:
3. Replace with:
2. All places you find:
Code: Select all
p.status = '1'
Code: Select all
p.status = '1' AND p.quantity > '0'
Works like a charm... I love simple solutions.!
I also had to make that same change to your Controller/product/all.php so that it works with your free "Show All Products" plugin.
Thanks Qphoria .
Perhaps that will be an standard option in an upcoming upgrade.
I also had to make that same change to your Controller/product/all.php so that it works with your free "Show All Products" plugin.
Thanks Qphoria .
Perhaps that will be an standard option in an upcoming upgrade.
Oh yes it was simple .. I just think that it would be a good option (because it is so easy to do) to have for others and something that would not have to redone after each update (assuming the file changes in an update)
I don't know perhaps no one else needs such a thing.
Thanks again.
I don't know perhaps no one else needs such a thing.
Thanks again.
Jan here
What a simple fix, (thanks Qphoria) Sally said this is going to help us out a lot.
I agree with sgfx. If it was settable in the administration area in the future, that would be cool.
I like the ideal of adding it to the pull down were we select 'out of stock' or 'more coming soon'
Good job guys. -=:@:=-
What a simple fix, (thanks Qphoria) Sally said this is going to help us out a lot.
I agree with sgfx. If it was settable in the administration area in the future, that would be cool.
I like the ideal of adding it to the pull down were we select 'out of stock' or 'more coming soon'
Good job guys. -=:@:=-
»-(¯`·.·´¯)->"The most wasted day in that in which we have not laughed."<-(¯`·.·´¯)-«
Yes I have the same issue - is there a simple way to make 'options values' not in stock not display on the dropdown?nakz wrote:Thanks Qphoria!
How do I disable this for "Option" item?
Current option item with vale "0" still showing in the drop down box.
Thanks.
Please I'm having and issue when I do this mod after editing the catalog/model/catalog/product.php
and replacing all the p.status = '1' as told... the out of stock items stop displaying but the search function stops working and I'm getting this message when I do a search:
Please help me I need this mod but can't afford to loose searching capabilities neither.
Thanks for the help in advance
and replacing all the p.status = '1' as told... the out of stock items stop displaying but the search function stops working and I'm getting this message when I do a search:
Code: Select all
Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'p.status = '1' AND p.quantity > '0' AND p.date_available <= NOW()' at line 1
Error No: 1064
SELECT COUNT(*) AS total FROM product p LEFT JOIN product_description pd ON (p.product_id = pd.product_id) LEFT JOIN product_tags pt ON (p.product_id = pt.product_id) LEFT JOIN product_to_store p2s ON (p.product_id = p2s.product_id) LEFT JOIN manufacturer m ON (p.manufacturer_id = m.manufacturer_id) LEFT JOIN stock_status ss ON (p.stock_status_id = ss.stock_status_id) WHERE pd.language_id = '2' AND p2s.store_id = '0' AND ss.language_id = '2' AND pt.language_id = '2' AND (LCASE(pt.tag) = 'i4' OR LCASE(pt.tag) = 'i4') p.status = '1' AND p.quantity > '0' AND p.date_available <= NOW()
Thanks for the help in advance
Your query is lacking an 'AND' before the 'p.status = '1'' string...it should say AND p.status = '1'
Best.
Best.
Hi,
Love this simple fix which makes perfect sense to me, and I thought a client wanted it, but as it turns out he just added a lot of "coming soon" products with quantity of 0, and he does want to display these items of course. Is there a way to show coming soon, and not show out of stock?
edit: it concerns OpenCart v1.4.9.1. additional, we have 4 statusses for products: in stock, out of stock, coming soon, not online available (i'm new to OpenCart and working on an existing shop I'm not even sure if this is default or personalized) obviously i only want out of stock disabled.
Love this simple fix which makes perfect sense to me, and I thought a client wanted it, but as it turns out he just added a lot of "coming soon" products with quantity of 0, and he does want to display these items of course. Is there a way to show coming soon, and not show out of stock?
edit: it concerns OpenCart v1.4.9.1. additional, we have 4 statusses for products: in stock, out of stock, coming soon, not online available (i'm new to OpenCart and working on an existing shop I'm not even sure if this is default or personalized) obviously i only want out of stock disabled.
I totally agree with sgfx, it should be an option in admin. It's hard to update when you do changes to the core.
Or maybe it would be great to display the product (product's profile, in search, etc) and instead of allow users to click on "Add to Cart", it should show up a message. "Unavailable product", "No longer available" or something like that.
I don't understand why users can add unavailable products to the cart with System => Settings => Option => Stock Checkout disabled.
Using version 1.5.1.2 here.
Thank you.
Or maybe it would be great to display the product (product's profile, in search, etc) and instead of allow users to click on "Add to Cart", it should show up a message. "Unavailable product", "No longer available" or something like that.
I don't understand why users can add unavailable products to the cart with System => Settings => Option => Stock Checkout disabled.
Using version 1.5.1.2 here.
Thank you.
Instead of change core files, I've made changes to my template files, removing the button when stock = 0. For example:
/opencart/catalog/view/theme/mytheme/template/product/product.tpl (~line 180):
I've added the first if statement. That's it.
/opencart/catalog/view/theme/mytheme/template/product/product.tpl (~line 180):
Code: Select all
<?php if ($product_info['quantity']) { ?>
<div class="cart">
<div><?php echo $text_qty; ?>
<input type="text" name="quantity" size="2" value="<?php echo $minimum; ?>" />
<input type="hidden" name="product_id" size="2" value="<?php echo $product_id; ?>" /> <a id="button-cart" class="button"><span><?php echo $button_cart; ?></span></a>
</div>
<?php if ($minimum > 1) { ?>
<div class="minimum"><?php echo $text_minimum; ?></div>
<?php } ?>
</div>
<?php } ?>
Unfortunately, it can't be made changing template files... You can't check the stock on /www/megaminiaturas/catalog/view/theme/megaminiaturas/template/product/category.tpl. I'll need to do changes in OpenCart's core.
Any alternative?
Thanks
Any alternative?
Thanks
I think there should be 2 options in the admin panel for out of stock items.
1. Remove Add to Cart Button - This will the add to cart button in the product page, category listing and remove the item in the featured list, Latest List etc.
2. Remove Listing - That will hide the product from the site.
1. Remove Add to Cart Button - This will the add to cart button in the product page, category listing and remove the item in the featured list, Latest List etc.
2. Remove Listing - That will hide the product from the site.
Set the product inactive.pramathesh wrote:2. Remove Listing - That will hide the product from the site.
Norman in 't Veldt
Moderator OpenCart Forums
_________________ READ and Search BEFORE POSTING _________________
Our FREE search: Find your answer FAST!.
[How to] BTW + Verzend + betaal setup.
Who is online
Users browsing this forum: No registered users and 357 guests