Results 1 to 10 of 12

Hybrid View

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

    Default Re: How do I add a custom field to my Product Listing Page?

    Thanks for the details on how to do this ... it's always a great help to others ...
    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!

  2. #2
    Join Date
    Feb 2010
    Posts
    2,159
    Plugin Contributions
    17

    Default Re: How do I add a custom field to my Product Listing Page?

    still not done yet.

    I am trying to add a link to a CUSTOM_FIELD

    I added right below name/description a custom field for the products category. You can see by using the link above.

    I cant figure out how to link to the products category. This is where I am at:

    '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? $_GET['cPath'] : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&category_id=' . $listing->fields['category_id_name']) . '">' . ' ' . '</a>';

  3. #3
    Join Date
    Feb 2010
    Posts
    2,159
    Plugin Contributions
    17

    Default Re: How do I add a custom field to my Product Listing Page?

    I figured that one out.

    I changed:

    '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? $_GET['cPath'] : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&category_id=' . $listing->fields['category_id_name']) . '">' . ' ' . '</a>';

    to this:

    '<a href="' . zen_href_link(FILENAME_DEFAULT, 'cPath=' . $listing->fields['master_categories_id']) . '">' . $listing->fields['products_CUSTOM_FIELD'] . '</a>';

    now here is a question?

    How do I use the categories name instead of using a CUSTOM_FIELD that hold just that?

    Any suggestions?

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

    Default Re: How do I add a custom field to my Product Listing Page?

    If you want to pull the categories_name ... you have to decide do you want to pull the name of the current categories_id categories_name or the master_categories_id categories_name ...

    The difference is ...

    In a Product Listing from the Categories navigation, there is a:
    $current_category_id

    variable for the categories_id ...

    But, in a search, there isn't a $current_category_id so you would need to use the $master_categories_id ...

    The function is in the functions_lookups.php file:
    Code:
    function zen_get_category_name($category_id, $fn_language_id) {
    You might need to tweak the code a bit based on whether or not the $current_category_id exists and if not then you need to use the $master_categories_id ...
    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
    Feb 2010
    Posts
    2,159
    Plugin Contributions
    17

    Default Re: How do I add a custom field to my Product Listing Page?

    Thanks Ajeh for all you help.

    product_listing.php, located in /public_html/includes/modules/YOUR_TEMPLATE

    is what i am editing, but the changes are only affecting my advanced_search_result page and not the actual product_listing page. What am i doing wrong?

  6. #6
    Join Date
    Feb 2010
    Posts
    2,159
    Plugin Contributions
    17

    Default Re: How do I add a custom field to my Product Listing Page?

    figured it out.

    By editing /public_html/includes/modules/YOUR_TEMPLATE/product_listing.php & adding CUSTOM_FIELDS it does change both the Product Listing Page & Advanced Search Result Page.

    I had to add

    p.custom_field to:
    /public_html/includes/index_filters/default_filter.php

    in order for the CUSTOM FIELDS to show up on Product Listing Page tho.

    Next - if i should start new thread someone let me know?

    How do I use use the same TEMPLATE for All Products, New Products, Specials so that the site has a consistency to it?

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

    Default Re: How do I add a custom field to my Product Listing Page?

    Thanks for posting your solution to this ...

    Yes, it's time for a new thread for your new question ...
    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!

 

 

Similar Threads

  1. Is there a way to add additional custom field in oder listing?
    By andy0305 in forum Managing Customers and Orders
    Replies: 4
    Last Post: 20 Mar 2013, 09:27 PM
  2. Add custom images to each category on the product listing page?
    By immersive in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 8 Jul 2009, 03:29 PM
  3. How do I add a custom pulldown field to create account page?
    By margarita in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 3 May 2008, 07:48 PM
  4. Adding custom field from specials table to product listing and product info
    By davale in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 19 Oct 2007, 06:19 AM
  5. add one more field on product listing page.
    By vr4indian in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 17 Oct 2006, 01:49 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