Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2005
    Posts
    13
    Plugin Contributions
    0

    Default Additional Columns in Product Listing

    I would like to do one of the following two things:

    1. Add additional columns/fields to products and display them sortable in the product listing.

    2. Display the attribute sortable in the product listing

    Is there a module or a how-to that can accomplish this? If not, does anyone know of a cart that can handle it out-of-the-box for free or at cost?

  2. #2
    Join Date
    Nov 2005
    Posts
    13
    Plugin Contributions
    0

    Default Re: Additional Columns in Product Listing

    Check this post: There is an OS Commerce mod that does exactly this: http://www.zen-cart.com/forum/showthread.php?t=32004.

    Does anyone have a decent guide as to how this could be ported to ZCart? The Wiki site is down!!! o.O

  3. #3
    Join Date
    Nov 2005
    Posts
    13
    Plugin Contributions
    0

    Default Re: Additional Columns in Product Listing

    Hmm... it seems there is no solution available on this website in this regard. Most of the code that the OSC mod handles is obsolete and moved around to other files, making it pretty useless for ZC.

    I'm having a bit of luck modding ZC myself, except I was having difficulty creating a new table and joining it to the product listing tables... I've currently just added a few fields to the product table to avoid modifying the SQL. Any good example of how to add an SQL join statement to the default_filter.php? I'm kind of a newbie.

  4. #4
    Join Date
    Jul 2006
    Location
    Beautiful Maine
    Posts
    7
    Plugin Contributions
    0

    Default Re: Additional Columns in Product Listing

    The music genre filter shows sql joins for product_extra tables. It should be in the same folder as your default_filter.php file. If not, here's a sample (it has several other tables joined in, which you can delete if you only need one joined table):

    Code:
    $listing_sql = "select " . $select_column_list . " p.products_id, p.products_type, p.products_price, p.products_tax_class_id, pd.products_description, if(s.status = 1, s.specials_new_products_price, NULL) AS specials_new_products_price, IF(s.status = 1, s.specials_new_products_price, p.products_price) as final_price, p.products_sort_order, p.product_is_call, p.product_is_always_free_shipping
            from " . TABLE_PRODUCTS . " p, " .
            TABLE_PRODUCTS_DESCRIPTION . " pd, " .
            TABLE_PRODUCT_MUSIC_EXTRA . " pme left join " . TABLE_SPECIALS . " s on pme.products_id = s.products_id, " .
            TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " .
            TABLE_MUSIC_GENRE . " m
            where  m.music_genre_id = '" . (int)$_GET['music_genre_id'] . "'
              and p.products_id = pme.products_id
              and p.products_status = 1
              and pme.music_genre_id = '" . (int)$_GET['music_genre_id'] . "'
              and pme.products_id = p2c.products_id
              and pd.products_id = p2c.products_id
              and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
              and p2c.categories_id = '" . (int)$_GET['filter_id'] . "'";
    If deleting some joins, be careful with your string closures and concatenations.

    Here it is with just the one extra table joined:

    Code:
    $listing_sql = "select " . $select_column_list . " p.products_id, p.products_type, p.products_price, p.products_tax_class_id, pd.products_description, if(s.status = 1, s.specials_new_products_price, NULL) AS specials_new_products_price, IF(s.status = 1, s.specials_new_products_price, p.products_price) as final_price, p.products_sort_order, p.product_is_call, p.product_is_always_free_shipping, pme.[your extra field here]
            from " . TABLE_PRODUCTS . " p, " .
            TABLE_PRODUCTS_DESCRIPTION . " pd, " .
            TABLE_PRODUCT_MUSIC_EXTRA . " pme left join " . TABLE_SPECIALS . " s on pme.products_id = s.products_id, " .
            TABLE_PRODUCTS_TO_CATEGORIES . " p2c
    	where  p.products_id = pme.products_id
              and p.products_status = 1
              and pme.products_id = p2c.products_id
              and pd.products_id = p2c.products_id
              and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
              and p2c.categories_id = '" . (int)$_GET['filter_id'] . "'";
    (untested)

    But I think there's a lot more to it than just getting the table joined and adding a field or 3 to the query. Such as getting the info into the product listing display, sorting, etc.

 

 

Similar Threads

  1. v139h Product Listing Columns
    By maxell6230 in forum General Questions
    Replies: 1
    Last Post: 21 Apr 2012, 01:22 PM
  2. product listing columns
    By kidzcomfort in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 2 Aug 2008, 04:37 AM
  3. Product Listing Columns
    By tmdelia in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 29 Aug 2007, 04:39 AM
  4. Product Listing Columns
    By quixotica in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 12 Oct 2006, 02:39 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