Jump to content
Sign in to follow this  
zipper

[Contribution] New Products Box Mod Ver 1,0

Recommended Posts

If you do not add new products frequently, the "New products in.." box will look silly after a few mounths, showing the same products all the time.

This Mod solves this problem by adding a time for the new items to be displayed in the box.

You can easily change the number of days new products are be shown in the box.

If there are no new products within the chosen number of days, (default 30) the box will not show up at all.

This applies to the box showing under the subcategories aswell.

 

It is very easy to install and to configure. (Contri only contains one file)

Please give me feedback on this Mod as it is my first Mod ever. :)

Send feedback by PM, mail or by replying to this post, please.

 

The Contribution can be found here:

http://www.oscommerce.com/community/contributions,1382

 

Enjoy!

 

/ Henrik (Zipper)


"Those who say it can't be done should get out of the way of those who are doing it."

I will not always answer quick since I have alot of work at the moment.

My Contributions:

** Control New Products Mod

** Contact Alert Mod

Share this post


Link to post
Share on other sites

I have released a 2,0 of this script with some bugfixes and a major addition.

 

The script now lets you choose if you want to show the box or not when there are no new products within the choosen amount of days.

If you choose to show the box, the box will show a text saying No new products this month.

This can ofcourse be changed to what ever language you are using on your site.

Enjoy!

 

http://www.oscommerce.com/community/contributions,1382

 

/ Henrik (Zipper)


"Those who say it can't be done should get out of the way of those who are doing it."

I will not always answer quick since I have alot of work at the moment.

My Contributions:

** Control New Products Mod

** Contact Alert Mod

Share this post


Link to post
Share on other sites

Please help me see if my mod works with MS1 and MS2.

 

Just install it, there is just one file to replace, and give me feedback if it works or not.

 

I have only tested this mod on my own catalog system wich is prior to MS1.

 

Thanks for the help with this.

 

Here?s the mod.

http://www.oscommerce.com/community/contributions,1382

 

/ Zipper


"Those who say it can't be done should get out of the way of those who are doing it."

I will not always answer quick since I have alot of work at the moment.

My Contributions:

** Control New Products Mod

** Contact Alert Mod

Share this post


Link to post
Share on other sites

Hi,

 

this mod is pretty helpful. But, as always with the many possible varieties of modifications, there is a problem.

 

I use the enable_disable_categories contrib. The modification is made in new_products.php as well.

 

With a lot of comparing code I got it working that far that your mod does it's work properly. But, how else should it be, the categories can't be turned off any more.

 

Here is the code that needs to be changed:

 

That is done

 

if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) {

$new_products_query = tep_db_query("select p.products_id, p.products_image, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where products_status = '1' and products_date_added > SUBDATE( now( ) , INTERVAL " . $days . " DAY ) limit " . MAX_DISPLAY_NEW_PRODUCTS);

} else {

$new_products_query = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . $new_products_category_id . "' and p.products_status = '1' and products_date_added > SUBDATE( now( ) , INTERVAL " . $days . " DAY )");

$check_products_query = tep_db_query("select count(p.products_id) as count from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . $new_products_category_id . "' and p.products_status = '1' and products_date_added > SUBDATE( now( ) , INTERVAL " . $days . " DAY ) limit " . MAX_DISPLAY_NEW_PRODUCTS);

}

 

 

and that follows after it

 

if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) {

$new_products_query = tep_db_query("select p.products_id, p.products_image, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where c.categories_status='1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and products_status = '1' order by p.products_date_added DESC limit " . MAX_DISPLAY_NEW_PRODUCTS);

} else {

$new_products_query = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where c.categories_status='1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . $new_products_category_id . "' and p.products_status = '1' order by p.products_date_added DESC limit " . MAX_DISPLAY_NEW_PRODUCTS);

}

 

I am stuck!!!

 

Any advise?

 

Thanks a lot in adevance

 

Michael


Not because it is difficult we don't dare to do it, but because we don't dare to do it, it is difficult. (Seneca)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×