SIMPLE NEW_PRODUCTS CHANGE TO BE ABLE TO SELECT WHICH PRODUCTS TO SHOW AS 'NEW PRODUCTS' RATHER
THAN USING THE MONTH() FUNCTION. DESIGNED FOR OSCMAX v2.0 RC4 STABLE.
BACKUP! BACKUP! BACKUP!
BEFORE YOU MAKE ANY CHANGES MAKE SURE YOU BACKUP YOUR FILES.
************************************************** ***********************************************
STEP 1:
RUN SQL:
ALTER TABLE `products` ADD `products_featured` TINYINT( 1 ) NOT NULL AFTER `products_status` ;
************************************************** ***********************************************
STEP 2: Edit catalog/includes/modules/new_products.php
Find two instances of (near lines 26 & 29)
and month(p.products_date_added) = month(now())
Replace with
and p.products_featured = '1'
************************************************** **********************************************
STEP 3: Edit catalog/admin/categories.php
A) Find: (near line 295)
'products_ready_to_ship' => tep_db_prepare_input($HTTP_POST_VARS['products_ready_to_ship']),
Replace with:
'products_ready_to_ship' => tep_db_prepare_input($HTTP_POST_VARS['products_ready_to_ship']),
'products_featured' => tep_db_prepare_input($HTTP_POST_VARS['products_featured']),
B) Find three instances of: (near line 399, 404 & 727)
products_ready_to_ship,
Replace with:
products_ready_to_ship, products_featured,
C) Find: (near line 1050)
p.products_ready_to_ship,
Replace with:
p.products_ready_to_ship, p.products_featured,
D) Find: (near line 404)
. "', '" . $product['products_ready_to_ship'] .
Replace with:
. "', '" . $product['products_ready_to_ship'] . "', '" . $product['products_featured'] .
E) Find:
<tr>
<td class="main"><?php echo TEXT_PRODUCTS_DATE_AVAILABLE; ?><br><small>(YYYY-MM-DD)</small></td>
<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' '; ?><script language="javascript">dateAvailable.writeControl() ; dateAvailable.dateFormat="yyyy-MM-dd";</script></td>
</tr>
<tr>
<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
</tr>
Add after:
<tr>
<td class="main"><?php echo TEXT_PRODUCTS_FEATURED; ?></td>
<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_checkbox_field('products_featured', '1', (($product['products_featured'] == '1') ? true : false)); ?></td>
</tr>
<tr>
<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
</tr>
************************************************** **********************************************
STEP 3: Edit catalog/admin/includes/languages/english/categories.php
Find:
define('TEXT_PRODUCTS_DATE_AVAILABLE', 'Date Available:');
Add after:
define('TEXT_PRODUCTS_FEATURED', 'Display as New Product?');
************************************************** **********************************************
STEP 4: Copy catalog/templates/fallback/products_new.php to catalog/templates/<your template>/products_new.php
Find:
and month(p.products_date_added) = month(now())
Replace with:
and p.products_featured = '1'
************************************************** **********************************************
YOU SHOULD NOW BE FINISHED!! NICE AND SIMPLE (I HOPE!)
Bookmarks