Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2005
    Posts
    30
    Plugin Contributions
    0

    Default Adding Category Name to the New Products/Featured/Specials Boxes on Main Page

    I'm working on designing a template and I'd like to add the category to the items displayed in the center column boxes so they look something like the attached image. From my poking and prodding on this, I know the necessary pages are in the includes/modules directory, an example would be the includes/modules/new_products.php file. The code that generates the display for that particular page is...
    Code:
      while (!$new_products->EOF) {
    
        $products_price = zen_get_products_display_price($new_products->fields['products_id']);
    
        $new_products->fields['products_name'] = zen_get_products_name($new_products->fields['products_id']);
        $list_box_contents[$row][$col] = array('params' => 'class="centerBoxContentsNew back"' . ' ' . 'style="width:' . $col_width . '%;"',
        'text' => '<div style="float: left; padding-right: 5px;"><a href="' . zen_href_link(zen_get_info_page($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_WIDTH, IMAGE_PRODUCT_NEW_HEIGHT) . '</a></div><span class="ml3"><a href="' . zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'products_id=' . $new_products->fields['products_id']) . '">' . $new_products->fields['products_name'] . '</a></span><br />' . $products_price);
    
        $col ++;
        if ($col > (SHOW_PRODUCT_INFO_COLUMNS_NEW_PRODUCTS - 1)) {
          $col = 0;
          $row ++;
        }
        $new_products->MoveNextRandom();
      }
    You'll note, I've added a style command to the div tag as well as inserted a span tag. These will be migrated to the stylesheet after I get them all worked out properly.

    Any help I can get on this would be greatly appreciated.
    Attached Images Attached Images  

  2. #2
    Join Date
    Dec 2005
    Posts
    30
    Plugin Contributions
    0

    Default Re: Adding Category Name to the New Products/Featured/Specials Boxes on Main Page

    Sorry, don't mean to bump my own thread, but I figured it out... I had to add
    Code:
    left join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c on p.products_id = p2c.products_id
    left join " . TABLE_CATEGORIES_DESCRIPTION . " cd on p2c.categories_id = cd.categories_id
    to the db query for starters. The rest just fell into place.

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

    Default Re: Adding Category Name to the New Products/Featured/Specials Boxes on Main Page

    Thanks for the update ... most helpful to have both the question and answer even if you find the solution yourself ...
    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!

  4. #4
    Join Date
    Dec 2005
    Posts
    30
    Plugin Contributions
    0

    Default Re: Adding Category Name to the New Products/Featured/Specials Boxes on Main Page

    I know what you mean about having the answer posted, even it is just a smidgen. It's a bit aggrivating to search all day for a solution just to discover "Eureka! I fixed it!" as a reply with no additional information. My little snippet of code may not be the complete solution, but at least it's a starting point for the next one in line.

    Have a great day!

 

 

Similar Threads

  1. v151 Arrangement of Featured Products, Monthly Specials, and New Products on Main Page
    By kelly60 in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 25 Nov 2014, 10:27 PM
  2. removing new products, featured items, monthly specials boxes from center column
    By HighOptional in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 16 Nov 2012, 05:01 AM
  3. Adding Manufacturer Name to "Featured Products" as Main Page
    By jenniferuth in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 12 Apr 2010, 10:49 PM
  4. New/Featured/Specials Products in Main Page Table
    By mipavluk in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 12 Jan 2010, 11:13 PM
  5. Replies: 1
    Last Post: 27 Nov 2008, 12:05 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