crusade Posted May 17, 2004 Posted May 17, 2004 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
crusade Posted May 28, 2004 Author Posted May 28, 2004 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. ' ' ; }
Recommended Posts
Archived
This topic is now archived and is closed to further replies.