Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Display Additional Text For Out Of Stokc Products Rate Topic   - - - - -

 
  • P-Pharma
  • Junior Member
  • Members
  • Join Date: 30-Jun 10
  • 1122 posts

Posted 04 June 2018 - 04:49 PM #1

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?



 
  • johnbol1
  • Never Re
  • Members
  • Join Date: 23-Feb 10
  • 4342 posts

Posted 04 June 2018 - 05:22 PM #2

Just change the language variable in admin>languages

 

https://prnt.sc/jqrozi


Custom printed hi visibility clothing sale the UK's online hivis safety shop
v4.5.2


 
  • P-Pharma
  • Junior Member
  • Members
  • Join Date: 30-Jun 10
  • 1122 posts

Posted 04 June 2018 - 05:46 PM #3

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.



 
  • johnbol1
  • Never Re
  • Members
  • Join Date: 23-Feb 10
  • 4342 posts

Posted 04 June 2018 - 06:15 PM #4

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


Custom printed hi visibility clothing sale the UK's online hivis safety shop
v4.5.2


 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 10770 posts

Posted 04 June 2018 - 07:35 PM #5

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' **}
  <script type="text/javascript">
    {* This will replace the standard text with the text from 'my_new_out_of_stock_text' *}
    $('#out_of_stock_info_{$obj_prefix}{$obj_id}').html({'__('my_new_out_of_stock_text')}'); 
  </script>
{/if}

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 17827 posts

Posted 05 June 2018 - 06:02 AM #6

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}

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 10770 posts

Posted 05 June 2018 - 07:40 AM #7

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


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • P-Pharma
  • Junior Member
  • Members
  • Join Date: 30-Jun 10
  • 1122 posts

Posted 05 June 2018 - 01:25 PM #8

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.



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 17827 posts

Posted 05 June 2018 - 01:48 PM #9

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}

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • P-Pharma
  • Junior Member
  • Members
  • Join Date: 30-Jun 10
  • 1122 posts

Posted 06 June 2018 - 07:09 PM #10

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.



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 10770 posts

Posted 06 June 2018 - 07:21 PM #11

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.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 17827 posts

Posted 07 June 2018 - 05:39 AM #12

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?


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • P-Pharma
  • Junior Member
  • Members
  • Join Date: 30-Jun 10
  • 1122 posts

Posted 07 June 2018 - 06:27 PM #13

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



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 17827 posts

Posted 08 June 2018 - 06:11 AM #14

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}

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.