comclusive Posted October 20, 2006 Posted October 20, 2006 I want to display xx products due on xxxxx if a product is out of stock, so I have done this code in product_info.php: if($product_info['products_quantity'] <= 0) { if ($product_info['products_on_order'] != 0) { if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) { echo '<font face="arial" color="#008800" size="2">'; echo '(' . $product_info['products_on_order'] . ' due on ' . tep_date_long($product_info['products_date_available']) . ')</font>'; }elseif ($product_info['products_date_available'] == date('Y-m-d 00:00:00')) { echo '<font face="arial" color="#008800" size="2">'; echo '(' . $product_info['products_on_order'] . ' due today)</font>'; }else{ echo '<font face="arial" color="#FF0000" size="2">'; echo '(' . $product_info['products_on_order'] . ' overdue)</font>'; } } } It is fine for products due to come in at a later date, or if they are late, but if the parts are due in on the current day, it still says they are overdue. Have I gone wrong in the code?
comclusive Posted October 20, 2006 Author Posted October 20, 2006 It's ok, when I was testing I entered a date through phpmyadmin, and it was timestamped, not 00:00:00!! Apologies
Recommended Posts
Archived
This topic is now archived and is closed to further replies.