Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Put products_date_available into the listing page?


crusade

Recommended Posts

So far I have removed the 'buy_now' button from the products listing pages when products are at quantity 0, and replaced with 'out of stock'. So far so good but then I would also like to add the date when product is back in stock.

 

..how to manage to get products_date_available shown in the products_listing.php ?

 

I have found the code used in the products_info.php to show expected date,

 

 

if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) {

?>

<tr>

<td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_AVAILABLE, tep_date_long($product_info['products_date_available'])); ?></td>

</tr>

<?php

 

 

But.. I need to implement this into a this "case" from products_listing.php,

 

 

case 'PRODUCT_LIST_QUANTITY':

if($listing['products_quantity'] != 0){

$lc_align = 'middle';

$lc_text = ' ' . $listing['products_quantity'] . ' ';

} else { ..........here should date be........

}

break;

 

 

Any php guru who would be able to help me out here?

 

Best regards

.runar

Link to comment
Share on other sites

  • 2 weeks later...

Got it, thanks to a smal modification of

http://www.oscommerce.com/forums/index.php?sho...=0entry105126

 

case 'PRODUCT_LIST_QUANTITY':

if($listing['products_quantity'] != 0){

 

 

$lc_align = 'middle';

$lc_text = ' ' . $listing['products_quantity'] . ' ';

 

 

} else {

 

$expected_query = tep_db_query("select products_date_available from " . TABLE_PRODUCTS . " where products_id = '" . $listing['products_id'] . "'");

$expected_values = tep_db_fetch_array($expected_query);

$expectedDate = $expected_values['products_date_available'];

$dateAvailable = tep_date_short($expectedDate);

$lc_align = 'middle';

$lc_text = ' ' . $dateAvailable. ' ' ;

}

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...