X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Show out of stock items but not for sale (https://forum.x-cart.com/showthread.php?t=53450)

simonparker 04-26-2010 07:57 AM

Show out of stock items but not for sale
 
May seem like a strange request but i can't see how to do this. I have over 20000 products online but stock changes daily as more items come in, and more are sold, and it seems madness to have to daily create a new sitemap as items appear and dissapear, yet alone the havoc that creates with google rankings and links back to products no longer there.

What i want to do, is to show items that are out of stock, but make them not available for sale. I know that's not the best for the customer but at least they know it's something we do normally have (usually in stock again within a week).

I have ticked the box to not track stock as i don't want to do that, prefer to do it manually.

any advice? Sure somewhere there is a setting for this but can't seem to find it.

hoosierglass 04-26-2010 08:16 AM

Re: Show out of stock items but not for sale
 
This doesn't seem strange at all. From time to time I have to disable a product when we are out of stock for more than a couple of days. This in turn causes problems with indexed pages. I would love to have a disabled but visable option for a product's status.

Here is an idea for a MOD:
New availability option, Disabled: Visable.

When it is set to this, the add to cart or buy now buttons are replaced with a "currently out of stock" box or image.

Even better would be a form to request an email when back in stock.

Mike

joncampbell 04-26-2010 09:05 AM

Re: Show out of stock items but not for sale
 
Simon,

If you have inventory tracking disabled how is X-Cart supposed to know that a item is out of stock?

Normally if you have inventory tracking on it can still show the product as long as General Settings -> Inventory Options -> Disable products which are out of stock
is not checked.

In my tests on X-Cart 4.3 with inventory tracking enabled and the above checkbox not checked it keeps the product publicly available, it just says Out of Stock on the product page.

gb2world 04-26-2010 09:10 AM

Re: Show out of stock items but not for sale
 
If you want to be able to set it per product in you administration or csv uploads, you could use an extra field.

simonparker 04-26-2010 09:27 AM

Re: Show out of stock items but not for sale
 
my products either have 1 in stock in which case they're listed, or 0 in stock so they're not, so at the end of the day i'll look at what stock as come in from suppliers, what is sold and update them all to in or out of stock.

Just needs to be simple, if i have items listed as '0' stock, then display them but not available to buy.

simonparker 04-26-2010 09:34 AM

Re: Show out of stock items but not for sale
 
Quote:

Originally Posted by joncampbell
Simon,

If you have inventory tracking disabled how is X-Cart supposed to know that a item is out of stock?

Normally if you have inventory tracking on it can still show the product as long as General Settings -> Inventory Options -> Disable products which are out of stock
is not checked.

In my tests on X-Cart 4.3 with inventory tracking enabled and the above checkbox not checked it keeps the product publicly available, it just says Out of Stock on the product page.


I have both boxes ticked as i want to manually alter stock at the end of the day, not have it done automatically. But if i have it checked to track inventory and the 'Disable products which are out of stock' unchecked, then they are visible and can be sold, i want them visible but 'out of stock' message which i only get when inventory tracking is on.

joncampbell 04-26-2010 10:54 AM

Re: Show out of stock items but not for sale
 
Set your inventory tracking to off and your disabled when out of stock to off.

Then edit your include/func/func.product.php


Find this section
$appearance = array(
'empty_stock' => $config['General']['unlimited_products'] != "Y" && ($product['avail'] <= 0 || $product['avail'] < $product['min_amount']),
'has_price' => $product['taxed_price'] > 0 || (!empty($product['variantid']) && isset($product['variants_has_price']) && $product['variants_has_price']),
'has_market_price' => $product['list_price'] > 0 && $product['taxed_price'] < $product['list_price'],
'buy_now_enabled' => $current_area == 'C' && $config['Appearance']['buynow_button_enabled'] == "Y",
'buy_now_form_enabled' => $product['price'] > 0 || ($active_modules['Special_Offers'] && $product['use_special_price']) || $product['product_type'] == 'C',
'min_quantity' => max(1, $product['min_amount']),
'max_quantity' => $config['General']['unlimited_products'] == "Y" ? $config['Appearance']['max_select_quantity'] : min($config['Appearance']['max_select_quantity'], $product['avail']),
'buy_now_buttons_enabled' => $config['General']['unlimited_products'] == "Y" || ($product['avail'] > 0 && $product['avail'] >= $product['min_amount']) || ($product['variantid'] && $product['avail'] > 0),
'force_1_amount' => $product['distribution'] || (!empty($active_modules['Subscriptions']) && !empty($product['catalogprice']))
);


I changed it to this:
$appearance = array(
'empty_stock' => ($product['avail'] <= 0 || $product['avail'] < $product['min_amount']),
'has_price' => $product['taxed_price'] > 0 || (!empty($product['variantid']) && isset($product['variants_has_price']) && $product['variants_has_price']),
'has_market_price' => $product['list_price'] > 0 && $product['taxed_price'] < $product['list_price'],
'buy_now_enabled' => $current_area == 'C' && $config['Appearance']['buynow_button_enabled'] == "Y",
'buy_now_form_enabled' => $product['price'] > 0 || ($active_modules['Special_Offers'] && $product['use_special_price']) || $product['product_type'] == 'C',
'min_quantity' => max(1, $product['min_amount']),
'max_quantity' => $config['General']['unlimited_products'] == "Y" ? $config['Appearance']['max_select_quantity'] : min($config['Appearance']['max_select_quantity'], $product['avail']),
'buy_now_buttons_enabled' => ($product['avail'] > 0 && $product['avail'] >= $product['min_amount']) || ($product['variantid'] && $product['avail'] > 0),
'force_1_amount' => $product['distribution'] || (!empty($active_modules['Subscriptions']) && !empty($product['catalogprice']))
);



On my 4.3 that makes it so the system doesnt check if inventory track is on or off, it will only check if there is any stock left. So you can have inventory tracking disabled and it will still show it as out of stock if availability is down to 0.

Works for me,

hoosierglass 04-26-2010 11:43 AM

Re: Show out of stock items but not for sale
 
Nice MOD Jon.

Now I just need to do a little work on my products_t.tpl to make these changes look better.

Thanks a bundle.

simonparker 04-27-2010 12:50 AM

Re: Show out of stock items but not for sale
 
Thanks Jon, will give it a try and let you know. Appreciate your help

XCart4Life 11-15-2011 12:20 PM

Re: Show out of stock items but not for sale
 
Great! Worked in 4.4.4!

I edited the same file... include/func/func.product.php

I just changed the one line:

PHP Code:

'empty_stock'   => $config['General']['unlimited_products'] != "Y" 


To this:

PHP Code:

'empty_stock' => ($product['avail'] <= || $product['avail'] < $product['min_amount']) 



All times are GMT -8. The time now is 08:55 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.