Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2006
    Location
    North Carolina
    Posts
    279
    Plugin Contributions
    0

    Default Need help modifying New Products displayed content on the index page

    Hi everyone,

    I'm using a new install of 1.5.1 with a template called Premium 9a.
    I've currently enabled New Products to display only on the index page at this time.
    It shows the product image, plus the product name below it and the price below that displaying in a 3 column width.

    I want to change the content of what is displayed, but I've hit a brick wall.

    My website sells karaoke tracks, so the product name is not sufficient enough info alone for the customer. I have attempted to add the product description instead of the price in that location, but there is too much content that I don't need to display, but it didn't work and I couldn't figure out the problem in the logs . My current product description also has <br>'s and other data in it in it, so this appears as raw data on the index page new products result as well with other templates that I've tested.

    To prepare for the change I need, I created a new field at the end of the 'products_description' table called 'products_artist' and I've populated it with the song's artist.

    I want to edit the includes/modules/new_products.php file so that the price is removed (which I DID figure out how to do that initially) and REPLACE it 'products_price' from the table 'products' with
    'products_artist' from the table 'products_description.'

    My final result will have the product image, then the product title underneath followed by the product artist underneath that.

    Can anyone help me to accomplish this?

    thank you so much......
    Jeff Michaels,
    pres of Musical Creations Ltd.

  2. #2
    Join Date
    Aug 2006
    Location
    North Carolina
    Posts
    279
    Plugin Contributions
    0

    Default Re: Need help modifying New Products displayed content on the index page

    Does anyone have any advice on this??
    Jeff Michaels,
    pres of Musical Creations Ltd.

  3. #3
    Join Date
    Aug 2005
    Location
    Vic, Oz
    Posts
    1,905
    Plugin Contributions
    5

    Default Re: Need help modifying New Products displayed content on the index page

    Quote Originally Posted by jeffmic View Post
    Does anyone have any advice on this??
    Link to site?
    Where did you get the template from?

  4. #4
    Join Date
    Aug 2006
    Location
    North Carolina
    Posts
    279
    Plugin Contributions
    0

    Default Re: Need help modifying New Products displayed content on the index page

    thank you :-)

    Here is a link to the template that I used:
    http://www.zenflavor.com/premium-9

    and here is a link to my test website

    http://store4.musicalcreations.com

    jeff
    Jeff Michaels,
    pres of Musical Creations Ltd.

  5. #5
    Join Date
    Jan 2004
    Posts
    66,363
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Need help modifying New Products displayed content on the index page

    new_products.php
    1. Update the query by adding your custom field:
    Code:
        $new_products_query = "select distinct p.products_id, p.products_image, p.products_tax_class_id, pd.products_name, pd.products_artist,
                                      p.products_date_added, p.products_price, p.products_type, p.master_categories_id
                               from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
    2. And then update the array of data being output:
    In v1.5.1 it looks like this:
    Code:
        $list_box_contents[$row][$col] = array('params' => 'class="centerBoxContentsNew centeredContent back"' . ' ' . 'style="width:' . $col_width . '%;"',
        '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_WIDTH, IMAGE_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 />' . $products_price);
    But that's on a really long line that's hard to read, so let's separate it on its components (breaking intelligently on the . symbol):
    Code:
        $list_box_contents[$row][$col] = array('params' => 'class="centerBoxContentsNew centeredContent back"' . ' ' . 'style="width:' . $col_width . '%;"',
        '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_WIDTH, IMAGE_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 />' . 
                  $products_price);
    You can see that it's basically just an image (clickable), plus the product name (also clickable) followed by the price.
    And, since all you said you wanted to change there is replace the price with the artist data, it's really as simple as replacing $products_price with $new_products->fields['products_artist']
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  6. #6
    Join Date
    Aug 2006
    Location
    North Carolina
    Posts
    279
    Plugin Contributions
    0

    Default Re: Need help modifying New Products displayed content on the index page

    Once again buddy - YOU ARE THE BEST!!

    thank you,
    Jeff
    Jeff Michaels,
    pres of Musical Creations Ltd.

 

 

Similar Threads

  1. Need Help Customizing the Value Displayed as the Default Quantity
    By pinkchalkstudio in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 11 May 2011, 01:56 AM
  2. Changing Font Style of new products on the index page [HELP NEEDED]
    By kal in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 15 Aug 2010, 05:26 PM
  3. Changing content of the index page...
    By SandraSD in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 25 Jul 2009, 07:59 AM
  4. I need help modifying the info sidebox (links etc.)
    By MULISH in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 24 Jun 2009, 12:42 AM
  5. Changing Content Displayed on Main Page for Products
    By Esoteric in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 30 May 2007, 09:48 PM

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