1Putts Posted March 25, 2006 Posted March 25, 2006 I've been looking for a contribution to do this but so far haven't found anything: A modification to the includes/modules/product_listing.php that would compare the current date to the date the product was added (products_date_added) and simply add the word "NEW" underneath the product name if it was added in, say, the last 60 (or whatever) days. That way, the whole thing would be automatic - it would show "NEW" if it falls within the predefined timeline and nothing if it didn't. I've found the code in product_listing.php where like an "if" statement would go...but I don't know how to compare the current date with the date added and get a real number. This is the area (as far as I can tell): case 'PRODUCT_LIST_NAME': $lc_align = ''; if (isset($HTTP_GET_VARS['manufacturers_id'])) { $lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a>'; } else { $lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a> '; } break;
Recommended Posts
Archived
This topic is now archived and is closed to further replies.