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)
-   -   How do I change the "out of stock" message to "sold out"? (https://forum.x-cart.com/showthread.php?t=55123)

keikoh 08-17-2010 01:55 PM

Re: In stead of " Out of Stock " should be possible to
 
How do I change the "out of stock" message to "sold out"? I'm a non tech, super beginner here. trying to read through faqs, to figure out...

robb3369 08-17-2010 02:12 PM

Re: In stead of " Out of Stock " should be possible to
 
You need to change the "txt_out_of_stock" language variable in the admin page (under content -> languages)

keikoh 08-17-2010 02:23 PM

Re: In stead of " Out of Stock " should be possible to
 
Quote:

Originally Posted by robb3369
You need to change the "txt_out_of_stock" language variable in the admin page (under content -> languages)


admin/file edit? there's no content>languages... i'm using the basic basic, possibly older versions of xcart... I go to edit templates? sorry super beginner here.

cflsystems 08-17-2010 02:46 PM

Re: In stead of " Out of Stock " should be possible to
 
Not edit templates. In admin under management - languages

robb3369 08-17-2010 02:50 PM

Re: In stead of " Out of Stock " should be possible to
 
I knew someone else would have a more accurate answer... If you add your X-Cart version to your forum signature so folks can better answer your questions.

Also see:
http://help.qtmsoft.com/index.php?title=X-Cart:Customizing_storefront#Using_Webmaster_mode

balinor 08-17-2010 03:02 PM

Re: How do I change the "out of stock" message to "sold out"?
 
Moving this to its own thread - instead of posting in a 6 year old thread, it is best to start a new one. Also, please update your signature as requested, thank you.

Dan.roh 08-20-2010 10:41 PM

Re: In stead of " Out of Stock " should be possible to
 
Quote:

Originally Posted by keikoh
How do I change the "out of stock" message to "sold out"? I'm a non tech, super beginner here. trying to read through faqs, to figure out...


Why would you want to do that in any case? Rather change it to "Pre-order". This way your customers can still order the product and pay for it and then you can put a question in you FAQ - Below is just an example; From a sales point of view, why loose an order?


Q - When will my order be delivered?



A - Delivery times will depend upon the item’s availability, the delivery option you choose and your location.

Generally deliveries are as follows:

For items showing as In Stock Now
-You will receive your order on the following working day if your order was placed before 15:00 otherwise the day after.

For items showing as Pre-Order
-You will receive your order within 2-3 working days, but please allow up to 5 working days. This will depend on our suppliers.

amy2203 08-20-2010 11:17 PM

Re: In stead of " Out of Stock " should be possible to
 
Quote:

Originally Posted by Dan.roh
Why would you want to do that in any case? Rather change it to "Pre-order". This way your customers can still order the product and pay for it


this is a custom mod though? by default, if you have inventory tracking on, which is how you would get the sold out text as the qty is zero, xcart won't allow the sale of a zero qty product.

Dan.roh 08-21-2010 12:50 AM

Re: How do I change the "out of stock" message to "sold out"?
 
That is correct Amy. Sorry, forgot to mention that part. :) My site has so many custom mods that I find it hard to recall sometimes which features was standard and which was modified.

If I recall correctly BCS modified that for me as well, but it was nothing major in the code. I wanted it like that because the way I see it, a sale is a sale and as long as your customer is aware that his order would arrive delayed and he still goes ahead with it then it's fine. In my case, items that are out of stock will arrive with my customer within 3 days but I do state that it might take longer depending on our suppliers to cover myself if it does take a bit longer

Dan.roh 08-21-2010 01:00 AM

Re: How do I change the "out of stock" message to "sold out"?
 
This is what was done. My inventory remained un touched. So all my products is set to 100 000 in stock. This way they will never become out of stock :)

An extra field was put in where you upload new products called "stock indicator" and in there you specify the amount that is in stock. Also, if "stock indicator" = 1 or above it will display in a language variable on my site in green - "In Stock Now" and everything in my "stock indicator" that is 0(zero) will display on my site as "Pre-order" in orange. And therefore xcart allows you to checkout because you have 100 000 in stock even if you have Zero

Works for me!

amy2203 08-21-2010 04:02 AM

Re: How do I change the "out of stock" message to "sold out"?
 
this kind of thing is quite specific to your business/industry. For example, for me it would be useless, I can't get stock that quickly from suppliers, and we run on very small quantities of any item.

I do have a similar mod, but that's getting OT for this post :)

Dan.roh 08-21-2010 01:27 PM

Re: How do I change the "out of stock" message to "sold out"?
 
Amy

Would it not be wise in your circumstance to rather set something up that will auto disable your products that is out of stock so that they do not show up at all on your shop front? Just a suggestion, personally I never liked sites that display products as "out of stock" or "sold out" as I can't see the point of it.

Customers can't buy the product and they can't order the product, it's like unwrapping a lollypop and holding it in front of a 3 year old and saying sorry but you can't have it, unless there is another purpose for displaying those products?

amy2203 08-21-2010 02:00 PM

Re: How do I change the "out of stock" message to "sold out"?
 
I've actually got mine set up in quite a specific way fir a few reasons sometimes products will be back in stock so the page gives them the option of being notified when it's back in stock the page also links to alternative products which may be suitable I also have it set so items I gave marked as prepress can be sold and offer the instock notification as well the thing us that often there's a sudden rush on certain items so it sells out but we don't want to completely remove the page as e want customers to know that we do stock the best and most popular items too also when items are linked from an external site f they are disabled you just get a page not found error which is even more annoying than not in stock. As I said these things are really very specific to a target Market industry and store.

Dan.roh 08-21-2010 11:35 PM

Re: How do I change the "out of stock" message to "sold out"?
 
Must say it is a good idea to have a "notify when back in stock" option. :)

My biggest problem with my site is when products get discontinued. I sell PC components and technology keep moving forward and as a result some items not only go out of stock but manufacturers stop manufacturing them so I have to delete those items. So I get the "page not found" as a result on those items. I know I should not delete products but what choice do I have if they will never be back in stock again?

amy2203 08-21-2010 11:38 PM

Re: How do I change the "out of stock" message to "sold out"?
 
this is where the hidden but available for sale status comes in. As the product is hidden, it doesn't appear in the listings as a customer browses or searches, but if they come in from a link, just as an external referrer, or a search engine etc, it shows the product, and shows it out of stock, which you could rename as discontinued. By educating the customer you help them make an alternative choice, preferably from your store instead of thinking you just don't stock it and moving on to another site.

Also, by deleting products you are destroying your order history as the product data will not be in those old orders.

Dan.roh 08-22-2010 12:05 AM

Re: How do I change the "out of stock" message to "sold out"?
 
All understood, thanks for that! But we are talking about hundreds of products that will build up over time that is discontinued at least 50-100 a month that goes discontinued or my suppliers decide not to sell them anymore. Do a count over 5 years and you will need a lot of space on your server for products that does not exist.

Mine does not destroy the order history completely it leaves me with the product name and price it was sold for but yes the actual product info is gone.

Like you said each shop is specific but this is a bit worrying deleting so many products. My other issue is my "refine your search" because products that are disabled still show up in there if they are only disabled

Learner 08-22-2010 07:46 AM

Re: How do I change the "out of stock" message to "sold out"?
 
Quote:

Originally Posted by Dan.roh
This is what was done. My inventory remained un touched. So all my products is set to 100 000 in stock. This way they will never become out of stock :)

An extra field was put in where you upload new products called "stock indicator" and in there you specify the amount that is in stock. Also, if "stock indicator" = 1 or above it will display in a language variable on my site in green - "In Stock Now" and everything in my "stock indicator" that is 0(zero) will display on my site as "Pre-order" in orange. And therefore xcart allows you to checkout because you have 100 000 in stock even if you have Zero

Works for me!


How to do that ??

Dan.roh 08-22-2010 08:12 AM

Re: How do I change the "out of stock" message to "sold out"?
 
Learner

If you are confident with coding I can provide you with my files but my product layout is different from yours so you might need to change it. Otherwise you are welcome to ask Carrie from BCS Engineering to do it for you and you can quote this post as permission from me so that Carrie can access my admin to remind herself what she has done so that it can be applied on yours.

The 2 main files that were edited are product.tpl and products.tpl which I can provide you the code for.

I am not sure what other files was edited to add the extra field named "stock indicator" when you upload new products and if there was any other files involved

If you know which files it is that you would need let me know and I can provide the code

Learner 08-22-2010 09:30 PM

Re: How do I change the "out of stock" message to "sold out"?
 
Quote:

Originally Posted by Dan.roh
Learner

If you are confident with coding I can provide you with my files but my product layout is different from yours so you might need to change it. Otherwise you are welcome to ask Carrie from BCS Engineering to do it for you and you can quote this post as permission from me so that Carrie can access my admin to remind herself what she has done so that it can be applied on yours.

The 2 main files that were edited are product.tpl and products.tpl which I can provide you the code for.

I am not sure what other files was edited to add the extra field named "stock indicator" when you upload new products and if there was any other files involved

If you know which files it is that you would need let me know and I can provide the code


To do that customization please provide me the codes which will need.

Dan.roh 08-23-2010 09:26 AM

Re: How do I change the "out of stock" message to "sold out"?
 
Learner,

As stated above, I do not know which files was edited it was too long ago. I do know that product.tpl and products.tpl was edited but there was more which I don't know which files it is. You would need to get in contact with Carrie from BCS Engineering to set it up for you.

The only time that I would be able to provide you the code is if you knew what files was needed

cflsystems 08-23-2010 02:26 PM

Re: How do I change the "out of stock" message to "sold out"?
 
All you have to do is add an extra field, then in products_t.tpl (products_list.tpl, whichever you use) and product.tpl (for 4.3.x it may be in product_details.tpl) call that extra field and place an if statement to show green or red text/image depending on the value of the field. If you search the forum for extra fields you find many post how to call it in different files and for different versions

Learner 08-24-2010 12:12 AM

Re: How do I change the "out of stock" message to "sold out"?
 
Please provide me the product.tpl and products.tpl file both.

Dan.roh 08-26-2010 09:23 AM

Re: How do I change the "out of stock" message to "sold out"?
 
In skin1/main/product_details.tpl the code that was added to create the extra field in your "Add new product" is as follows. You would need to add it where you want your extra field to appear

Code:

{/if}

<tr>
    {if $geid ne ''}<td width="15" class="TableSubHead"><input type="checkbox" value="Y" name="fields[stock_indicator]" /></td>{/if}
    <td class="FormButton" nowrap="nowrap">{$lng.lbl_stock_indicator}</td>
    <td class="ProductDetails">
    <input type="text" name="stock_indicator" size="2" value="{$product.stock_indicator}" />
    </td>
</tr>



In skin1/customer/main/product.tpl this code was added

Code:

<tr>
    <td>Availabilty:</td>
    <td>
        {if $product.stock_indicator ge 1}
            <span style="color: green; font-size: 12px; font-weight: bold;">{$lng.lbl_product_in_stock_now|regex_replace:"/<br[^>]*>/iS":" "}</span>
        {else}
            <span style="color: orange; font-size: 12px; font-weight: bold;">{$lng.lbl_product_out_of_stock|regex_replace:"/<br[^>]*>/iS":" "}</span>
        {/if}
    </td>
</tr>



In skin1/customer/mainproducts.tpl this was added

Code:

{if $products[product].stock_indicator ge 1}                       
                        <span style="color: green; font-size: 12px; font-weight: bold;">{$lng.lbl_product_in_stock_now}</span>                       
                        {else}                       
                        <span style="color: orange; font-size: 12px; font-weight: bold;">{$lng.lbl_product_out_of_stock}</span>                       
                        {/if}                   
                    </td> 




Don't ask me where to place the code as mine would be different from yours as our products layout is different. You would also need to create lanuage variables

Dan.roh 08-26-2010 10:00 AM

Re: How do I change the "out of stock" message to "sold out"?
 
Does anyone know how I can add a 3rd condition?

If stock indicator = -1

I would like it to display "No longer Available"

This would be used if I set products to "Hidden but available for sale" , for products that are discontinued

Thanks your help would be appreciated

cflsystems 08-26-2010 03:52 PM

Re: How do I change the "out of stock" message to "sold out"?
 
{if $product.stock_indicator ge 1}
CONDITION IF MORE THEN 1
{elseif $product.stock_indicator lt 0}
CONDITION IF LESS THEN 0
{else}
ALL OTHER
{/if}

Dan.roh 08-27-2010 11:37 PM

Re: How do I change the "out of stock" message to "sold out"?
 
Thanks Steve

Unfortunately it is not working. When I make my "stock indicator" field -1 then the product does not display at all. The stock indicator does not like -1 for some reason. Any suggestion for a fix?

amy2203 08-28-2010 12:46 AM

Re: How do I change the "out of stock" message to "sold out"?
 
have you got it set to disable out of stock products? in the settings?

Dan.roh 08-28-2010 01:14 AM

Re: How do I change the "out of stock" message to "sold out"?
 
Quote:

Originally Posted by amy2203
have you got it set to disable out of stock products? in the settings?


Hi Amy

This should not matter because the "stock indicator" is a custom field that was added and if set on 0 it will display a language variable "Pre-Order" and if 1 it will display "in stock now" and what I am trying to do now is add a third condition if -1 it must display "discontinued". For some reason it does not display the product at all when it is set to -1

amy2203 08-28-2010 01:18 AM

Re: How do I change the "out of stock" message to "sold out"?
 
sorry, misunderstood, I thought you were talking about the standard stock field.

I'd maybe look at how it's stored in the db, is it a text field or something? maybe it can't accept negative numbers? I don't do a lot with extra fields so i'm not much help i'm afraid,

Dan.roh 08-28-2010 01:21 AM

Re: How do I change the "out of stock" message to "sold out"?
 
Quote:

Originally Posted by amy2203
sorry, misunderstood, I thought you were talking about the standard stock field.

I'd maybe look at how it's stored in the db, is it a text field or something? maybe it can't accept negative numbers? I don't do a lot with extra fields so i'm not much help i'm afraid,


Yes it is an text field, I think?

{/if}

<tr>
{if $geid ne ''}<td width="15" class="TableSubHead"><input type="checkbox" value="Y" name="fields[stock_indicator]" /></td>{/if}
<td class="FormButton" nowrap="nowrap">{$lng.lbl_stock_indicator}</td>
<td class="ProductDetails">
<input type="text" name="stock_indicator" size="2" value="{$product.stock_indicator}" />
</td>
</tr>

Dan.roh 08-28-2010 01:48 AM

Re: How do I change the "out of stock" message to "sold out"?
 
I think I got it! I tested it on the old code and I get the same results. It seems like every time a -1 is in stock indicator it auto disable the product from my site.

I personally think it has something to do with the part below in "BOLD"?? Am I correct?

{/if}

<tr>
{if $geid ne ''}<td width="15" class="TableSubHead"><input type="checkbox" value="Y" name="fields[stock_indicator]" /></td>{/if}
<td class="FormButton" nowrap="nowrap">{$lng.lbl_stock_indicator}</td>
<td class="ProductDetails">
<input type="text" name="stock_indicator" size="2" value="{$product.stock_indicator}" />
</td>
</tr>

cflsystems 08-28-2010 07:15 AM

Re: How do I change the "out of stock" message to "sold out"?
 
No, this is not it.
What is the condition you are putting in for -1?

Dan.roh 08-28-2010 07:44 AM

Re: How do I change the "out of stock" message to "sold out"?
 
Steve

I am using your code that you supplied on my question when I asked that I want a 3rd condition. The BOLD one below is suppose to appear when I have my stock indicator set to -1

As soon as I set the stock indicator field to -1 it then disable that product from my shop front, so my guess it there must be some other code somewhere that makes that happen as this is what I originally wanted when I asked BCS to set it up for me. Obviously now there is a change of plan and I donâ–“t want the -1 to disable the product from my shop. The question is where would that piece of code be that disables my product as soon as -1 is in stock indicator?


{if $product.stock_indicator ge 1}
<span style="color: green; font-size: 12px; font-weight: bold;">{$lng.lbl_product_in_stock_now|regex_replac e:"/<br[^>]*>/iS":" "}</span>
{elseif $product.stock_indicator lt 0}
<span style="color: red; font-size: 12px; font-weight: bold;">{$lng.lbl_discontinued|regex_replace:"/<br[^>]*>/iS":" "}</span>
{else}
<span style="color: orange; font-size: 12px; font-weight: bold;">{$lng.lbl_out of stock|regex_replace:"/<br[^>]*>/iS":" "}</span>
{/if}

amy2203 08-28-2010 09:04 AM

Re: How do I change the "out of stock" message to "sold out"?
 
I would guess the code that disables it in the storefront (I assume that means it doesn't appear) is in a php file.

Does it set the status of the product, to disabled or anything, or is the status still avaailable but it still doesn't appear?

If it changes the status, i would guess there's something in the product modify code,so when it changes product details, it also changes the status based on the extra field,

if it doesn't change the status, i'd look in the files that select the products for display and see if it's excluding disabled products and those with -1 in the extra field,

hth

Dan.roh 08-28-2010 10:01 AM

Re: How do I change the "out of stock" message to "sold out"?
 
Quote:

Originally Posted by amy2203
I would guess the code that disables it in the storefront (I assume that means it doesn't appear) is in a php file.

Does it set the status of the product, to disabled or anything, or is the status still avaailable but it still doesn't appear?

If it changes the status, i would guess there's something in the product modify code,so when it changes product details, it also changes the status based on the extra field,

if it doesn't change the status, i'd look in the files that select the products for display and see if it's excluding disabled products and those with -1 in the extra field,

hth


Hi Amy

I have been at it since this morning to try and find out where is the piece of code that disables the product from storefront when -1 is in stock indicator and am still at it and can't find it.

Strange, it does not change the status of the product as it still stay as available for sale but the product just disappears from storefront as if it goes invisible once stock indicator is -1

amy2203 08-28-2010 10:09 AM

Re: How do I change the "out of stock" message to "sold out"?
 
In that case I would expect that the php file that selects the products for display from the database is also excluding products with -1

Have yu used webmaster mode to see if you can see which file selects the products and see if there'sanything there?

Dan.roh 08-28-2010 10:16 AM

Re: How do I change the "out of stock" message to "sold out"?
 
Tried it all - It's like a hidden gem!

cflsystems 08-28-2010 10:32 AM

Re: How do I change the "out of stock" message to "sold out"?
 
amy2003 is right - it is most likely the php file that sets the indicator value. You need to look in product.php and products.php. There will be a SQL statement selecting all extra fields and their values and then some line that sets the indicator based on its extra field value (code could be in /modules/Extra_Fields/extra_fields.php or in one of the products related functions in include/func/func.product.php). There could also be a clause in the SQL to say "select all products where indicator is greater then 0" so like amy2003 says products with less then 0 indicator may not be selected at all

Dan.roh 08-28-2010 12:09 PM

Re: How do I change the "out of stock" message to "sold out"?
 
Quote:

Originally Posted by cflsystems
amy2003 is right - it is most likely the php file that sets the indicator value. You need to look in product.php and products.php. There will be a SQL statement selecting all extra fields and their values and then some line that sets the indicator based on its extra field value (code could be in /modules/Extra_Fields/extra_fields.php or in one of the products related functions in include/func/func.product.php). There could also be a clause in the SQL to say "select all products where indicator is greater then 0" so like amy2003 says products with less then 0 indicator may not be selected at all



Firstly - Thank you Steve and Amy for trying to help me! Much appreciated!

I found in /include/func/func.product.php the following and not sure what is does or if it can be changed but the word stock_indicator is present so I guess this must be it as stock_indicator is a custom field that was added and I do not know of anything else in xcart with that name

#BCSE Begin
if($current_area == 'C')
$where[] = "$sql_tbl[products].stock_indicator >= 0";
#BCSE End


It is very hard looking for something if you are not sure what it is you are looking for

cflsystems 08-28-2010 05:17 PM

Re: How do I change the "out of stock" message to "sold out"?
 
This is the pice of code that tells the script only products with indicator 0 and up to be included. If you comment it out all products will be included. Place # in front of the lines


All times are GMT -8. The time now is 05:02 AM.

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