Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Due Date in Product Info


comclusive

Recommended Posts

Posted

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?

Archived

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

×
×
  • Create New...