Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Feb 2007
    Location
    Ontario, Canada
    Posts
    234
    Plugin Contributions
    0

    Default Change Featured Products Display

    In the featured products on my main page, I would like the model number to display rather than the title.

    http://www.actionforms.ca/officesupplies/

    IE, the first one shows "For Deskjet 450CI/CBI, 5150, 5550, 5650/W, 5850/W, 9650, 9670…" as the title, but I just want it to show "Model: HEWC6657AC" instead.
    Thanks, Colleen
    www.af-company.com
    To err is human, but to really foul things up requires a computer. Farmers' Almanac, 1978

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: Change Featured Products Display

    Roll up your sleeves....tpl_modules_whats_new.php is the file but mostly only calls /includes/modules/new_products.php and in that file it gets the info for displaying with things like:
    Code:
     $new_products_query = "select p.products_id,...and
    $new_products->fields['products_name'] = zen_get_products_name($new_products->fields['products_id']);
    Where you want the model...p.products_model or products_model depending.

    I think at first glance that I would copy/clone this with a new name if you only want this for the main page as this is also used for the featured listing - yeah a bit more work but might be what you need
    Zen-Venom Get Bitten

  3. #3
    Join Date
    Feb 2007
    Location
    Ontario, Canada
    Posts
    234
    Plugin Contributions
    0

    Default Re: Change Featured Products Display

    I want the featured products on all pages to be displayed with the model number instead of the title, so I think I can just customize instead of cloning which will hopefully make it easier.

    I have opened the "new_products.php", however I know just enough php to make me dangerous but not useful. Should I not use the "featured_products.php" file?
    I have rolled up my sleves and I am ready to type, if only I had a clue what I was doing!
    Thanks, Colleen
    www.af-company.com
    To err is human, but to really foul things up requires a computer. Farmers' Almanac, 1978

  4. #4
    Join Date
    Feb 2007
    Location
    Ontario, Canada
    Posts
    234
    Plugin Contributions
    0

    Default Re: Change Featured Products Display

    Anybody? Help......
    Thanks, Colleen
    www.af-company.com
    To err is human, but to really foul things up requires a computer. Farmers' Almanac, 1978

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

    Default Re: Change Featured Products Display

    To change the Featured Products Centerbox ...

    You would want to customize the:
    /includes/modules/featured_products.php

    and copy to your templates and overrides directory:
    /includes/modules/your_template_dir/featured_products.php

    add the additional field(s) needed to the select statements ... then customize the display of the data ...
    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: v1.5.5]
    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!

  6. #6
    Join Date
    Feb 2007
    Location
    Ontario, Canada
    Posts
    234
    Plugin Contributions
    0

    Default Re: Change Featured Products Display

    Maybe I'm not bright, but I have no idea how to switch it from name to model so I would love a little more guidance.

    Both replys, I think, assume I have know a little more php than I do. I understand it to read it (somewhat), but writing my own stuff I leave to the smart ones!!
    Thanks, Colleen
    www.af-company.com
    To err is human, but to really foul things up requires a computer. Farmers' Almanac, 1978

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

    Default Re: Change Featured Products Display

    The products_module is in the products table ... this is designated in the SELECT statements with p ...

    If you added p.products_model then you now have the information available to you ...

    If you look at how the products_name appears in the code to display it, you can now change that to the products_model ...
    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: v1.5.5]
    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!

  8. #8
    Join Date
    Feb 2007
    Location
    Ontario, Canada
    Posts
    234
    Plugin Contributions
    0

    Default Re: Change Featured Products Display

    Ok, this is what I did and I lost my featured products and my entire right column:

    Code:
     
    if (!defined('IS_ADMIN_FLAG')) {
    die('Illegal Access');
    }
    if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) {
    $featured_products_query = "select distinct p.products_id, p.products_image, pd.products_model
    from (" . TABLE_PRODUCTS . " p
    left join " . TABLE_FEATURED . " f on p.products_id = f.products_id
    left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id )
    where p.products_id = f.products_id and p.products_id = pd.products_id and p.products_status = 1 and f.status = 1 and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'";
    } else {
    $featured_products_query = "select distinct p.products_id, p.products_image, pd.products_model
    from (" . TABLE_PRODUCTS . " p
    left join " . TABLE_FEATURED . " f on p.products_id = f.products_id
    left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.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 = '" . (int)$new_products_category_id . "'
    and p.products_id = f.products_id and p.products_id = pd.products_id and p.products_status = 1 and f.status = 1 and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'";
    }
    $featured_products = $db->ExecuteRandomMulti($featured_products_query, MAX_DISPLAY_SEARCH_RESULTS_FEATURED);
    $row = 0;
    $col = 0;
    $list_box_contents = array();
    $title = '';
    $num_products_count = $featured_products->RecordCount();
    // show only when 1 or more
    if ($num_products_count > 0) {
    if ($num_products_count < SHOW_PRODUCT_INFO_COLUMNS_FEATURED_PRODUCTS || SHOW_PRODUCT_INFO_COLUMNS_FEATURED_PRODUCTS == 0) {
    $col_width = floor(100/$num_products_count);
    } else {
    $col_width = floor(100/SHOW_PRODUCT_INFO_COLUMNS_FEATURED_PRODUCTS);
    }
    while (!$featured_products->EOF) {
    $products_price = zen_get_products_display_price($featured_products->fields['products_id']);
    $list_box_contents[$row][$col] = array('params' =>'class="centerBoxContentsFeatured centeredContent back"' . ' ' . 'style="width:' . $col_width . '%;"',
    'text' => (($featured_products->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) ? '' : '<a href="' . zen_href_link(zen_get_info_page($featured_products->fields['products_id']), 'products_id=' . $featured_products->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $featured_products->fields['products_image'], $featured_products->fields['products_model'], IMAGE_FEATURED_PRODUCTS_LISTING_WIDTH, IMAGE_FEATURED_PRODUCTS_LISTING_HEIGHT) . '</a><br />') . '<a href="' . zen_href_link(zen_get_info_page($featured_products->fields['products_id']), 'products_id=' . $featured_products->fields['products_id']) . '">' . $featured_products->fields['products_model'] . '</a><br />' . $products_price);
    $col ++;
    if ($col > (SHOW_PRODUCT_INFO_COLUMNS_FEATURED_PRODUCTS - 1)) {
    $col = 0;
    $row ++;
    }
    $featured_products->MoveNextRandom();
    }
    if ($featured_products->RecordCount() > 0) {
    if (isset($new_products_category_id) && $new_products_category_id !=0) {
    $category_title = zen_get_categories_name((int)$new_products_category_id);
    $title = zen_image($template->get_template_dir(TABLE_HEADING_FEATURED_PRODUCTS, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . TABLE_HEADING_FEATURED_PRODUCTS, HEADER_ALT_TEXT);
    } else {
    $title = zen_image($template->get_template_dir(TABLE_HEADING_FEATURED_PRODUCTS, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . TABLE_HEADING_FEATURED_PRODUCTS, HEADER_ALT_TEXT);
    }
    $zc_show_featured = true;
    }
    }
    ?>
    I did a search for p.products_name and changed it to p.products_model and all instances of products_name to products_model.
    Thanks, Colleen
    www.af-company.com
    To err is human, but to really foul things up requires a computer. Farmers' Almanac, 1978

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

    Default Re: Change Featured Products Display

    You appear to have lost all formating so assuming the file is trashed out ...

    Start with a clean copy of the:
    /includes/modules/featured_products.php

    and copy to your templates and overrides directory:
    /includes/modules/your_template_dir/featured_products.php

    Next, find in the two SELECT statements where it references:
    PHP Code:
    pd.products_name 
    and add:
    PHP Code:
    p.products_model 

    Next, look for the code:
    PHP Code:
    $featured_products->fields['products_name'
    to show the products_model instead, change to read:
    PHP Code:
    $featured_products->fields['products_model'
    What you did is call from pd.products_model ... pd is the products_description tabel ... p is the products table where the products_model is located ...
    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: v1.5.5]
    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!

  10. #10
    Join Date
    Feb 2007
    Location
    Ontario, Canada
    Posts
    234
    Plugin Contributions
    0

    Default Re: Change Featured Products Display

    YOUR ROCK! Your brillance sends me into fits of envy!!

    Thanks! That worked perfect. I didn't understand the pd. vs p. thing!!
    Thanks, Colleen
    www.af-company.com
    To err is human, but to really foul things up requires a computer. Farmers' Almanac, 1978

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 0
    Last Post: 5 Feb 2013, 10:08 AM
  2. v138a Removing Individual Products from Featured Products Group / Display
    By richd in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 12 Jun 2012, 10:25 PM
  3. change Featured products to Featured Categories?
    By chrismaddox3d in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 22 Oct 2010, 01:25 AM
  4. Question about Special Products and Featured Products Display
    By kaleidoscopecards in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 17 Feb 2007, 06:19 PM
  5. Nix All Product, change Featured Products display, Artist in Product Description, etc
    By porphyrous in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 28 Dec 2006, 06:13 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
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR