Page 1 of 5 123 ... LastLast
Results 1 to 10 of 45

Thread: New Products Project

  1. #1
    osCMax Development Team

    New Products Project

    pgmarshall's Avatar
    Join Date
    Feb 2009
    Location
    London
    Posts
    3,517
    Total Contributions For

    pgmarshall     $ 35.00
    Rep Power
    77


    Smile New Products Project

    The New Products section on the index page of a store is an area which a lot of people seem want to edit.

    I personally have never really understood why I would want to show my customers the latest products I have added - I would much rather show them the products I select to show them.

    I know that there are a lot of contributions on the osCommerce site to do this but they all seemed rather complicated for my needs and not all of them are easy installs for OSCMAX.

    I have therefore done a bit of an edit on the New_Products files so that you get a little tick box when you load your product to declare that you want it to display on the home page in the New_Products infobox.

    This is my first go at publishing something so please use with caution - make sure you backup before installing - I have not extensively tested this! Any problems or queries - post here and I will see if I can help.

    Hope this helps someone,

    pgmarshall

    Screenshot

    ps. I am unable to upload the .txt file with the changes so I have posted it below.

    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') . '&nbsp;'; ?><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') . '&nbsp;' . 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!)

  2. #2
    ptt81
    Guest


    Default Re: New Products Project

    Nice one, rep!

    what if I want to remove the box completely off the front page and move to another page where i can link customer to it via a button menu instead? and if they want to see it its their choice to make

    I would be even more useful if we can do a like a 1-day sale module that point to 1 specific item that give a sale for that 1-day only, next day it will pick out another item randomly or selectable. That way it keeps buyer comming back to check everyday.

    another idea would be to make the new products display the newly restocked item on top of the newly added items instead.
    Last edited by ptt81; 04-07-2009 at 09:54 PM.

  3. #3
    osCMax Development Team

    New Products Project

    pgmarshall's Avatar
    Join Date
    Feb 2009
    Location
    London
    Posts
    3,517
    Total Contributions For

    pgmarshall     $ 35.00
    Rep Power
    77


    Smile Re: New Products Project

    To remove it from the front page entirely, simply open templates/fallback/index_default.tpl.php (or your copy in your own template folder) and find the following line:

    Code:
    <?php include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); ?>
    If you remove this line - the module will not show. You can also put this line in anywhere you like and it will put in the infobox.

    If you want to call the full page from a menu (rather than display the infobox) then you need to use the following link:

    Code:
    <a href="' . tep_href_link(FILENAME_PRODUCTS_NEW) . '">
    If you wanted to use this as a one day sale item - you could would need to only tick one product in your dbase to be displayed.

    If you wanted to randomly select an single item to display from a selection of ticked products you could simply change set the display setting in ADMIN to show 1 item and then in the SQL code change this from

    Code:
    order by p.products_date_added desc
    to

    Code:
    order by rand()
    which would select a random product from your ticked items. It would be randomly selected each time the page is refreshed.

    Hope this helps,

    pgmarshall

  4. #4
    ptt81
    Guest


    Default Re: New Products Project

    Hi, thanks for your help, I was wondering if we can do the same for the "special"? as I can actually set an expiration on it and the price get marked out as sale price. Is there anyway I can duplicate the special and use it for 1-day deal only but still keep the regular special for normal sales items?

  5. #5
    osCMax Development Team

    New Products Project

    pgmarshall's Avatar
    Join Date
    Feb 2009
    Location
    London
    Posts
    3,517
    Total Contributions For

    pgmarshall     $ 35.00
    Rep Power
    77


    Default Re: New Products Project

    Yep - you could do this reasonably easily. It is not something that need to do but I would have thought that you could copy the catalog/includes/boxes/specials.php and rename it specials2.php.

    Then go through the code duplicating everywhere you find specials references and add specials2. You would end up with 2 sets of specials - one is the normal one, and another one for your 1-day deal idea.

    You could look at this mod - not used it myself but could give you another set of specials - not sure if you want the carousel bit since you only need one product ...

    Anyway - worth a look ...

    pgmarshall

  6. #6
    ptt81
    Guest


    Default Re: New Products Project

    If I do that, will it show up under admin to that I can set it? How can I move the special box to the very top of the middle page? not the top of the entire site.

  7. #7
    osCMax Development Team

    New Products Project

    pgmarshall's Avatar
    Join Date
    Feb 2009
    Location
    London
    Posts
    3,517
    Total Contributions For

    pgmarshall     $ 35.00
    Rep Power
    77


    Smile Re: New Products Project

    ptt81,

    I was looking for something else and stumbled across Mindsparx's website ... they are written a contribution which looks like what you were searching for - namely the star product/special product idea.

    Link here

    Hope this helps,
    pgmarshall
    _______________________________

  8. #8
    ptt81
    Guest


    Default Re: New Products Project

    that's cool, i will sure look into it. on the other hand, i like the look of that new admin mod on that page, is there anything like that for OSCmax thats not hard to integrate? Thanks a lot

  9. #9
    osCMax Development Team

    New Products Project

    pgmarshall's Avatar
    Join Date
    Feb 2009
    Location
    London
    Posts
    3,517
    Total Contributions For

    pgmarshall     $ 35.00
    Rep Power
    77


    Default Re: New Products Project

    I have made one for myself ... the Mindsparx one doesn't really like the file access mod that comes with OSCMAX.

    I have also never really understood why oScommerce opens on that page with all of links before going through to the main admin section.

    I have created a dashboard - very similar to Mindsparx but not quite as pretty but the functionality is the same (ish) - I can let you know what I did and give you the code if you like it. Or if a few people like it - I can try and turn it into a project? I am still kind of working on it - trying to think of any other 'snapshot' views to create ...

    Basically it is a replacement for index.php in admin and the header.php file - with a few images added ...

    let me know,

    pgmarshall
    _______________________________

  10. #10
    ptt81
    Guest


    Default Re: New Products Project

    Absolutely it'd be great to have something like that for oscmax, can you please post what you did? Thank you so much.

Page 1 of 5 123 ... LastLast

Similar Threads

  1. Replies: 0
    Last Post: 09-22-2008, 11:00 AM
  2. Replies: 0
    Last Post: 09-21-2008, 01:53 AM
  3. need products to display on products.php not index.php, products not displaying below
    By libraschld in forum osCommerce 2.2 Modification Help
    Replies: 0
    Last Post: 09-20-2008, 02:40 AM
  4. "Define About Page" Project
    By allwebnow in forum osCMax v2 Features Discussion
    Replies: 1
    Last Post: 02-28-2008, 11:46 PM
  5. The josC! Project: osCommerce and Joomla CMS
    By michael_s in forum New osCommerce Contributions
    Replies: 0
    Last Post: 12-08-2007, 01:10 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •