Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

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

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #31  
Old 08-28-2010, 01:48 AM
  Dan.roh's Avatar 
Dan.roh Dan.roh is offline
 

eXpert
  
Join Date: Jul 2008
Posts: 397
 

Default 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>
__________________
Regards

Dan


Xcart version:
4.1.10 GOLD
Reply With Quote
  #32  
Old 08-28-2010, 07:15 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default 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?
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #33  
Old 08-28-2010, 07:44 AM
  Dan.roh's Avatar 
Dan.roh Dan.roh is offline
 

eXpert
  
Join Date: Jul 2008
Posts: 397
 

Default 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}
__________________
Regards

Dan


Xcart version:
4.1.10 GOLD
Reply With Quote
  #34  
Old 08-28-2010, 09:04 AM
  amy2203's Avatar 
amy2203 amy2203 is offline
 

X-Wizard
  
Join Date: Jul 2004
Location: Watford, UK
Posts: 1,509
 

Default 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
__________________
X-Cart version 5 (Previously 3.5-4)

Previous Versions included
BCSE Reward Points Mod
Altered Cart On Sale Mod
Wordpress Plugin

Please don't PM me for support. I help where I can on the forum and your question will more likely be answered there.

Shout me a Coffee!
Reply With Quote
  #35  
Old 08-28-2010, 10:01 AM
  Dan.roh's Avatar 
Dan.roh Dan.roh is offline
 

eXpert
  
Join Date: Jul 2008
Posts: 397
 

Default 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
__________________
Regards

Dan


Xcart version:
4.1.10 GOLD
Reply With Quote
  #36  
Old 08-28-2010, 10:09 AM
  amy2203's Avatar 
amy2203 amy2203 is offline
 

X-Wizard
  
Join Date: Jul 2004
Location: Watford, UK
Posts: 1,509
 

Default 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?
__________________
X-Cart version 5 (Previously 3.5-4)

Previous Versions included
BCSE Reward Points Mod
Altered Cart On Sale Mod
Wordpress Plugin

Please don't PM me for support. I help where I can on the forum and your question will more likely be answered there.

Shout me a Coffee!
Reply With Quote

The following user thanks amy2203 for this useful post:
Dan.roh (08-29-2010)
  #37  
Old 08-28-2010, 10:16 AM
  Dan.roh's Avatar 
Dan.roh Dan.roh is offline
 

eXpert
  
Join Date: Jul 2008
Posts: 397
 

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

Tried it all - It's like a hidden gem!
__________________
Regards

Dan


Xcart version:
4.1.10 GOLD
Reply With Quote
  #38  
Old 08-28-2010, 10:32 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default 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
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote

The following user thanks cflsystems for this useful post:
Dan.roh (08-29-2010)
  #39  
Old 08-28-2010, 12:09 PM
  Dan.roh's Avatar 
Dan.roh Dan.roh is offline
 

eXpert
  
Join Date: Jul 2008
Posts: 397
 

Default 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
__________________
Regards

Dan


Xcart version:
4.1.10 GOLD
Reply With Quote
  #40  
Old 08-28-2010, 05:17 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default 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
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


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

   

 
X-Cart forums © 2001-2020