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)
-   -   "IN STOCK" message with buy now button (https://forum.x-cart.com/showthread.php?t=29027)

TA 02-20-2007 04:58 AM

"IN STOCK" message with buy now button
 
We get a flood of phone calls and emails asking if a product is in stock. To help reduce this, I am thinking that an "in stock" message or image that appears whenever the buy now button appears would help. Any ideas how to accomplish this?

Thanks!

NightFire 02-20-2007 05:10 AM

Re: "IN STOCK" message with buy now button
 
You can activate the inventor tracking module. This shows how many products there are in stock, if set in the product details.
Also you could edit products.tpl And use an if statement to show an image when in stock. Also was thinking about this idea. Will try to work it out when I'm back at home.

Edit: Copied this code from the product.tpl page:

Code:

{if $config.Appearance.show_in_stock eq "Y" and $config.General.unlimited_products ne "Y" and $product.distribution eq ""}
<tr><td width="30%">{$lng.lbl_in_stock}</td><td nowrap="nowrap"><span id="product_avail_txt">{if $product.avail gt 0}{$lng.txt_items_available|substitute:"items":$product.avail}{else}{$lng.lbl_no_items_available}{/if}</span></td></tr>
{/if}


You can just remove the <td width="30%"> and add an image before the code so it will say how many items there are in stock, or if the product is out of stock. You can paste the code in your products.tpl anywhere you want.

TA 02-23-2007 05:12 PM

Re: "IN STOCK" message with buy now button
 
I don't want to show how many products I have in stock. I just want to list in stock or "available for immediate shipping" or something similar. I already have inventory tracking enabled, but I don't show the quantity of items remaining. How can I just add text to in stock items?

TA 03-09-2007 08:53 AM

Re: "IN STOCK" message with buy now button
 
I ended up just changing the language variable for the buy now button to IN STOCK - Buy Now. It's cheap and dirty, so we'll see if this helps reduce emails and phone calls.

inebriate 03-09-2007 12:12 PM

Re: "IN STOCK" message with buy now button
 
Code:

{if $product.avail gt 0}
IN STOCK
{else}
BACKORDERED
{/if}


TA 03-09-2007 12:33 PM

Re: "IN STOCK" message with buy now button
 
Just add that code to product.tpl ?

inebriate 03-09-2007 03:51 PM

Re: "IN STOCK" message with buy now button
 
in product.tpl, find
Code:

{if $config.Appearance.show_in_stock eq "Y" and $config.General.unlimited_products ne "Y" and $product.distribution eq ""}
<TR><TD width="30%">{$lng.lbl_quantity}</TD><TD nowrap><SPAN id="product_avail_txt">{if $product.avail gt 0}{$product.avail}</SPAN>{else}{$lng.txt_no}{/if} {$lng.txt_items_available}</TD></TR>
{/if}

replace with
Code:

{if $config.Appearance.show_in_stock eq "Y" and $config.General.unlimited_products ne "Y" and $product.distribution eq ""}
<TR><TD width="100%">
{if $product.avail gt 0}
IN STOCK
{else}
BACKORDERED
{/if}
</TD></TR>
{/if}


fearnothing 01-01-2008 01:04 PM

Re: "IN STOCK" message with buy now button
 
We use a similar system on our store to display a message when the stock level is at Zero.

We are starting to implement inventory management using a bar code scanner, and I have written some basic external PHP scripts to allow us to 'swipe' goods as they go out or are received in, to update the inventory accordingly.

To make this work we need to stop the inventory from auto decreasing after every order placed, however if the 'Inventory Tracking' option is disabled, it also disables the check to see if an item is out of stock and EVERYTHING appears to be in stock. Doh!

Can anyone point out the code that should be commented out to stop x-cart.products.avail being updated on order completion? The option to 'Disable Out Of Stock Items' is not appropriate as we then lose out on search engines picking these items up, and of course browsing customers (our OOS message includes a 'please contact us for delivery estimates' link).

BTW I'm happy to post the PHP scripts if anyone is interested - perhaps some Smarty wizard can find a way of making them work from within the admin interface? Well beyond my level of expertise, I'm afraid!

smek 02-26-2012 05:36 PM

Re: "IN STOCK" message with buy now button
 
I am trying to use the same code but it doesnt seem to work. Maybe because i am using 4.1.6 ?

In the product details it shows "out of stock" so i know its out of stock...

{* show message if product is out of stock *}

{if $product.avail eq 0}
<p>this is out of stock</p>
{/if}

{* show message if product is out of stock *}

TA 02-27-2012 08:46 AM

Re: "IN STOCK" message with buy now button
 
Did you clear your templates cache?


All times are GMT -8. The time now is 06:58 AM.

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