Forums / Templates, Stylesheets, Page Layout / Show "in stock" instead of showing units in stock

Show "in stock" instead of showing units in stock

Started by gustafr on 10 Jul 2006, 11:13 AM · Views: 20,147

Results 61 to 70 of 70
21 Jan 2014, 2:37 AM
#61
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Show "in stock" instead of showing units in stock

That is just the stock quantity code, not the customized code.

You need to use some code similar to post 53 or post 55 to get the behavior you want.

21 Jan 2014, 10:10 PM
#62
isotank avatar

isotank

New Zenner

Join Date:
Jan 2014
Location:
Philadelphia, PA
Posts:
9
Plugin Contributions:
0

Re: Show "in stock" instead of showing units in stock

Right, I have made the changes but still see the same results. The site is currently up with the changes listed in post #53.

/includes/templates/yorkshire_clean/templates/tpl_product_info_display.php

<!--bof Product details list  -->
<?php if ( (($flag_show_product_info_model == 1 and $products_model != '') or ($flag_show_product_info_weight == 1 and $products_weight !=0) or ($flag_show_product_info_quantity == 1) or ($flag_show_product_info_manufacturer == 1 and !empty($manufacturers_name))) ) { ?>
<ul id="productDetailsList" class="floatingBox back">
  <?php echo (($flag_show_product_info_model == 1 and $products_model !='') ? '<li>' . TEXT_PRODUCT_MODEL . $products_model . '</li>' : '') . "\n"; ?>
  <?php echo (($flag_show_product_info_weight == 1 and $products_weight !=0) ? '<li>' . TEXT_PRODUCT_WEIGHT .  $products_weight . TEXT_PRODUCT_WEIGHT_UNIT . '</li>'  : '') . "\n"; ?>
 <?php echo (($flag_show_product_info_quantity == 1) ? '<li>' . ($products_quantity > 0 ? TEXT_PRODUCT_IN_STOCK : TEXT_PRODUCT_NOT_IN_STOCK) . '</li>' : '') . "\n"; ?> 
  <?php echo (($flag_show_product_info_manufacturer == 1 and !empty($manufacturers_name)) ? '<li>' . TEXT_PRODUCT_MANUFACTURER . $manufacturers_name . '</li>' : '') . "\n"; ?>
</ul>
<br class="clearBoth" />

includes -> languages -> english -> product_info.php

define('TEXT_PRODUCT_WEIGHT', 'Shipping Weight: ');
define('TEXT_PRODUCT_QUANTITY', ' Units in Stock');
define('TEXT_PRODUCT_IN_STOCK', 'In Stock');
define('TEXT_PRODUCT_NOT_IN_STOCK', 'Out of Stock');  
define('TEXT_PRODUCT_MODEL', 'Model: ');

Any idea what might be happening here?

-Joe

24 Jan 2014, 10:56 PM
#63
isotank avatar

isotank

New Zenner

Join Date:
Jan 2014
Location:
Philadelphia, PA
Posts:
9
Plugin Contributions:
0

Re: Show "in stock" instead of showing units in stock

Any suggestions on what I can do about the above issue?

Joe

25 Jan 2014, 8:02 PM
#64
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Re: Show "in stock" instead of showing units in stock

And you are certain the changed code is in the right file on the server? What are you getting? Only "in stock", only "out of stock", or nothing? Can you point to a product where this is happening? All of the categories I have looked in were empty. A product that is in stock and one that is out of stock would be best.

26 Jan 2014, 2:34 AM
#65
isotank avatar

isotank

New Zenner

Join Date:
Jan 2014
Location:
Philadelphia, PA
Posts:
9
Plugin Contributions:
0

Re: Show "in stock" instead of showing units in stock

Yeah, I am pretty sure. I even tried editing the "/includes/templates/template_default/templates/tpl_product_info_display.php" file but didn't see a change. Here is a link to the site showing you how the info is currently displayed with the changes to the two files:

http://www.dancingferret.com/isotank/index.php?main_page=index&cPath=17824&zenid=b715ecbd91a3810a8fa282b40ff874f4

I did post a message about this on the Yorkshire Clean support thread and received a response saying it was a problem with my "customization" and not related to the template.

I am pretty new at this and have been able to fuddle through most of the other aspects of the Zen Cart system but this really has me stumped.

-Joe

27 Jan 2014, 5:56 AM
#66
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Re: Show "in stock" instead of showing units in stock

Never edit the /template_default/ version of a file. If you have a copy of the file in your currently active template folder, the default version will never be used so editing it is pointless.

I see in the page source that the product details code is not outputting anything at all. What do you have for admin > Catalog > Product Types > Product-General > edit layout > Show Quantity in Stock?

28 Jan 2014, 7:56 PM
#67
isotank avatar

isotank

New Zenner

Join Date:
Jan 2014
Location:
Philadelphia, PA
Posts:
9
Plugin Contributions:
0

Re: Show "in stock" instead of showing units in stock

Strangely, I had it set to 0 (false) although the quantities were still listed. I switched it over to 1 (true) and the same quantity info is still displaying.

Joe

31 Jan 2014, 12:46 AM
#68
isotank avatar

isotank

New Zenner

Join Date:
Jan 2014
Location:
Philadelphia, PA
Posts:
9
Plugin Contributions:
0

Re: Show "in stock" instead of showing units in stock

Anyone have any thoughts on a fix for my issue? I am almost ready to make the site live but this issue is holding me back.

Joe

6 Aug 2015, 6:05 PM
#69
jimmie avatar

jimmie

Totally Zenned

Join Date:
Jan 2013
Location:
New Port Richey, Florida
Posts:
971
Plugin Contributions:
0

Re: Show "in stock" instead of showing units in stock

would like to know how to modify the mentioned modified code to also check for low stock and show my define

3-? In Stock
< 0 Special Ordered
< 1-3 Low Stock, Order today

7 Aug 2015, 3:26 AM
#70
jimmie avatar

jimmie

Totally Zenned

Join Date:
Jan 2013
Location:
New Port Richey, Florida
Posts:
971
Plugin Contributions:
0

Re: Show "in stock" instead of showing units in stock

jimmie:

would like to know how to modify the mentioned modified code to also check for low stock and show my define

3-? In Stock
< 0 Special Ordered
< 1-3 Low Stock, Order today

This is what i did.

<?php echo (($flag_show_product_info_quantity == 1 and $products_quantity > 3) ? '<li>' . TEXT_PRODUCT_IN_STOCK . $products_quantity . TEXT_PRODUCT_QUANTITY . '</li>' : '') . "\n"; ?>
  <?php echo (($flag_show_product_info_quantity == 1 and $products_quantity <= 0) ? '<li>' . TEXT_PRODUCT_NOT_IN_STOCK . $products_quantity . TEXT_PRODUCT_QUANTITY . '</li>' : '') . "\n"; ?>
  <?php echo (($flag_show_product_info_quantity == 1 and $products_quantity == 3) ? '<li>' . TEXT_PRODUCT_LOW_STOCK . $products_quantity . TEXT_PRODUCT_QUANTITY . '</li>' : '') . "\n"; ?>
  <?php echo (($flag_show_product_info_quantity == 1 and $products_quantity == 2) ? '<li>' . TEXT_PRODUCT_LOW_STOCK . $products_quantity . TEXT_PRODUCT_QUANTITY . '</li>' : '') . "\n"; ?>
  <?php echo (($flag_show_product_info_quantity == 1 and $products_quantity == 1) ? '<li>' . TEXT_PRODUCT_LOW_STOCK . $products_quantity . TEXT_PRODUCT_QUANTITY . '</li>' : '') . "\n"; ?>

did the same to listing
not very pretty but it works