Display Additional Text For Out Of Stokc Products

We have brick and mortar stores as well as out online store.
When a product is out of stock in CS-Cart then its probably available in one of our stores.
Unfortunately many customers interpret the CS-Cart out of stock message as if the product is not in stock in any store.

For out of stock products, I would like to display a message:

This product is out of stock for online ordering, but is probably in stock in one of our stores. Call for more information: 123-456789

Is it possible to do this somehow?

Just change the language variable in admin>languages

https://prnt.sc/jqrozi

If I change that text then it will change not only on the product itself, but also on all product listings. For example on category grid items. There is no space for large texts there. I only want to display this text on product page.

If I change that text then it will change not only on the product itself, but also on all product listings. For example on category grid items. There is no space for large texts there. I only want to display this text on product page.

Maybe explain that in your first post

As with most things in cs-cart, there are several things you can do (or ways you can change it).

1) Create an override of the product_data.tpl hook "products:out_of_stock_block" and change the variable {$out_of_stock_text} to be what you want.

2) Use jQuery "append()" function to add to the existing text in the id="out_of_stock_info_{$obj_prefix}{$obj_id} span tag. I.e. append something like: "This item may be available in one of our stores".

3) Use jQuery to replace the above with something like "This item is not in stock in our online store but may be available at one of our locations".

If it were me, I'd probably use #2 or #3 rather than try to manage any future changes that might occur to this block using code similar to (UNTESTED) below which would be the hook file:

design/themes/[YOUR THEME]/templates/addons/my_changes/hooks/products/out_of_stock_block.post.tpl

{if $details_page}
  {** Set a new lang var named 'my_new_out_of_stock_text' **}
  
{/if}

You can also add HTML block with SMARTY support and the following content to Products layout page

{assign var="product_amount" value=$product.inventory_amount|default:$product.amount}
{if $product_amount <= 0}
This product is out of stock for online ordering, but is probably in stock in one of our stores. Call for more information: 123-456789
{/if}

And there are probably 10 more ways to skin this cat! :-)

Thats really useful.

As the example by ecom includes a conditional, I would also like to add a conditional that the product is not in category 94

i.e. product_amount is 0 AND category ID is not 94.

Thats really useful.

As the example by ecom includes a conditional, I would also like to add a conditional that the product is not in category 94

i.e. product_amount is 0 AND category ID is not 94.

Please try

{assign var="product_amount" value=$product.inventory_amount|default:$product.amount}
{if $product_amount <= 0 && $product.main_category != 94}
This product is out of stock for online ordering, but is probably in stock in one of our stores. Call for more information: 123-456789
{/if}

The block displays on the correct pages, but unfortunately the block title displays on all pages. Even if a product is not out of stock.

Change the "wrapper" to nothing and the block name will not appear. If you want it to appear as a titled block then just include the following as the first line within the condition.

{include file="common/subheader.tpl" title="Your title here"}

This will insert an h3 tag (could be an h5 I don't remember) with your title text.

The block displays on the correct pages, but unfortunately the block title displays on all pages. Even if a product is not out of stock.

What wrapper do you use for this block?

I tried all wrappers, but have now disabled the wrapper. This works.

I tried all wrappers, but have now disabled the wrapper. This works.

If the wrapper still required, you can use

{assign var="product_amount" value=$product.inventory_amount|default:$product.amount}
{if $product_amount <= 0 && $product.main_category != 94}
{capture name="content"}
This product is out of stock for online ordering, but is probably in stock in one of our stores. Call for more information: 123-456789
{/capture}
{include file="blocks/wrappers/sidebox_general.tpl" content=$smarty.capture.content title="My title"}
{/if}

As with most things in cs-cart, there are several things you can do (or ways you can change it).

Hello! Could you help me how to add "Notify me..." checkbox in the grid list? Thanks