Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default new_products.php - replacing $new_products->fields['products_name'] with manufacturer

    I'm trying to change the text under the thumbnails on my Empty Cart page when it displays the list of new products instead of just an empty page.

    This is not controlled by the same files as the main new products page and so it displays different text under the images.

    I’m trying to replace the products_id (or is it called products_name?) with whatever generates the ‘manufacturers id' or 'manufacturers name')

    So, I’d quite like to get from this:

    to this:


    I’m just not sure how to call for the manufacturers name instead of the products_name.

    Can anyone tell me how I need to alter the php file? This is the line that controls this text at the moment:
    PHP Code:
        'text' => (($new_products->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) ? '' '<a href="' zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'cPath=' $productsInCategory[$new_products->fields['products_id']] . '&products_id=' $new_products->fields['products_id']) . '">' zen_image(DIR_WS_IMAGES $new_products->fields['products_image'], $new_products->fields['products_name'], IMAGE_PRODUCT_NEW_WIDTHIMAGE_PRODUCT_NEW_HEIGHT) . '</a><br />') . '<a href="' zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'cPath=' $productsInCategory[$new_products->fields['products_id']] . '&products_id=' $new_products->fields['products_id']) . '">' $new_products->fields['products_name'] . '</a><br />' $new_products->fields['products_model'] .$products_model .'<br />' .$products_price.'<br /><p>' ); 
    Last edited by limelites; 15 Mar 2009 at 10:59 AM.

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: new_products.php - replacing $new_products->fields['products_name'] with manufact

    That is the New Products centerbox which is the same on the Home page or Categories etc.

    The Link you have for New Products is the New Products Listing ...

    The New Products Centerbox is located at:
    /includes/modules/new_products.php

    be sure to use your templates and overrides and be aware what ever you change will also happen when run on the other locations for the New Products centerbox ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  3. #3
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default Re: new_products.php - replacing $new_products->fields['products_name'] with manufact

    Hi Linda,

    I do always use override files.

    However, my new products centre box is controlled here (when page returns empty results) by new_products.php........... as opposed to tpl_modules_products_new_listing.php which controls the new products when I click on the New Products link from the navigation menu.....

    That's why both pages display this text in very different ways and that's why editing new_products.php has no effect whatsoever on the new products page (unless it's displayed automatically when a user finds the emtpy cart message)

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: new_products.php - replacing $new_products->fields['products_name'] with manufact

    Looks like you have succeeded ... what was your method?
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  5. #5
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default Re: new_products.php - replacing $new_products->fields['products_name'] with manufact

    Yes, success at last :-)

    replace this line in new_products.php:
    PHP Code:
    'text' => (($new_products->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) ? '' '<a href="' zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'cPath=' $productsInCategory[$new_products->fields['products_id']] . '&products_id=' $new_products->fields['products_id']) . '">' zen_image(DIR_WS_IMAGES $new_products->fields['products_image'], $new_products->fields['products_name'], IMAGE_PRODUCT_NEW_WIDTHIMAGE_PRODUCT_NEW_HEIGHT) . '</a><br />') . '<a href="' zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'cPath=' $productsInCategory[$new_products->fields['products_id']] . '&products_id=' $new_products->fields['products_id']) . '">' $new_products->fields['products_name'] . '</a><br />' $new_products->fields['products_model'] .$products_model .'<br />' .$products_price.'<br /><p>' ); 
    with this:
    PHP Code:
    if ( (($manufacturers_id && $_GET['filter_id'] == 0) || $_GET['music_genre_id'] > || $_GET['record_company_id'] > 0) || (!isset($new_products_category_id) || $new_products_category_id == '0') ) {
      
    $new_products_query "select distinct p.products_id, p.products_image, p.products_tax_class_id, pd.products_name,m.manufacturers_name, m.manufacturers_id,
                                    p.products_date_added, p.products_price, p.products_type,  p.products_model,p.manufacturers_id,p.master_categories_id
                               from " 
    TABLE_PRODUCTS " p, " TABLE_PRODUCTS_DESCRIPTION " pd, ".TABLE_MANUFACTURERS " m
                               where p.products_id = pd.products_id
                               and p.manufacturers_id = m.manufacturers_id
                               and pd.language_id = '" 
    . (int)$_SESSION['languages_id'] . "'
                               and   p.products_status = 1 " 
    $display_limit

 

 

Similar Threads

  1. Display slideshow at main page and hide in other pages like new_products
    By ritesh.shrestha in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 16 Sep 2011, 05:50 PM
  2. Upcoming products in new_products
    By Lopi in forum Customization from the Admin
    Replies: 6
    Last Post: 23 Mar 2010, 12:57 PM
  3. Replies: 4
    Last Post: 23 Feb 2010, 11:35 AM
  4. Product list replacing dropdown manufacturer filter with images
    By roboto in forum Templates, Stylesheets, Page Layout
    Replies: 15
    Last Post: 12 Sep 2009, 06:37 PM

Posting Permissions

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