Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Stock status in product info


mark27uk3

Recommended Posts

Posted

Hi Guys,

 

I am trying to add stock status to the product_info page but need some help.

 

What I have so far (which is not a lot) is this:

 

I have added these 3 lines to catalog/includes/languages/english/product_info.php

 

define('TEXT_INSTOCK', 'This item is normally available from stock!');
define('TEXT_PREORDER', 'This item needs to be pre-ordered');
define('TEXT_OUTOFSTOCK', 'This item is out of stock, but can still be ordered');

 

The first line is to be shown if the product is in stock, the second if the product has a 'date available' added to it in admin and the third is to be shown if the product is out of stock.

 

This little snippet of code if as far as I have got, I know I need to use an 'IF' statement but dont know how! :blink:

 

<tr>
<td align="left" class="headerNavigationa">
<?php echo 'Stock status for ', $product_info_values['products_name'], echo ': '; 
?>
</td>
</tr>

 

Also instead of just using one class for the whole text, I would like the 'Stock status for' in black, the product name in orange and the define text in black.

 

Any help with this would be really appreciated.

 

Thanks

 

Mark :thumbsup:

Lifes a bitch, then you marry one, then you die!

Posted

Hi mark,

isn't there already a contribution that does exactly this ?

 

Not that it is terribly difficult, but why reinvent ...

 

Carine

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Posted

Hi Carine,

 

I have had a look at the contrib thats available and it does not really fit my needs, surely a couple of 'IF' statements can do the job as well.

 

e.g.

 

if product in stock > display message 1

if product not yet released > display message 2

if product out of stock > display message 3

 

Thanks

 

Mark :thumbsup:

Lifes a bitch, then you marry one, then you die!

Posted
Hi Carine,

 

I have had a look at the contrib thats available and it does not really fit my needs, surely a couple of 'IF' statements can do the job as well.

 

e.g.

 

if product in stock > display message 1

if product not yet released > display message 2

if product out of stock > display message 3

 

Thanks

 

Mark :thumbsup:

 

 

simply extend the product info query first with the fields you want the checks to work on.

 

then indeed write out the if structure (with else) as you did above.

Treasurer MFC

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...