Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Join Date
    Feb 2010
    Location
    Syracuse, NY
    Posts
    2,159
    Plugin Contributions
    17

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

    I added a custom product field to a product. It all works fine, shows up on product listing page and is search-able.

    Here is my question, i want to add the custom field under the image, just like how the description is under the name.

    Anyone know how to go about it?

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

    Default Product Listing Column Sort Order

    OK - I need some expert help. I managed to get my custom product fields to appear kinda the way I want but I can't seem to arrange the order they are appearing on the Product Listing. Actually I can't get them to appear on the Product Listing Page only on the Advanced Search Results Page.

    right now order is
    PRICE, CUSTOM FEILD1, CUSTOM FEILD2, CUSTOM FEILD3, CUSTOM FEILD4,

    I just want to move PRICE to the end column but can't figure it out.


    Next question is what files do I need to edit to have my Product Listing Page appear like my Advanced Search Result page.

    You can see what I have do with the ADVANCED_SEARCH_RESULTS product listing by clicking here.

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

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

    Just wanna thank everyone for their input.

    putting the model/part# under the image is now complete, i figured it out.

  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?

    What was the solution that you discovered worked for you for this problem?
    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!

  5. #5
    Join Date
    Feb 2010
    Location
    Syracuse, NY
    Posts
    2,159
    Plugin Contributions
    17

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

    getting the CUSTOM_FIELD under the image was actually easy and I know nothing but basic hotmail.

    so all i did is change the following:

    $lc_text = '<div class="img_box"><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 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $listing->fields['products_image'], $listing->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_PRODUCT_LISTING_HEIGHT, 'class="listingProductImage"') . '</a></div>';

    to this:

    $lc_text = '<div class="img_box"><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 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $listing->fields['products_image'], $listing->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_PRODUCT_LISTING_HEIGHT, 'class="listingProductImage"') . '</a></div>' . $listing->fields['products_custom_field'];

  6. #6
    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: 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!

  7. #7
    Join Date
    Feb 2010
    Location
    Syracuse, NY
    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>';

  8. #8
    Join Date
    Feb 2010
    Location
    Syracuse, NY
    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?

  9. #9
    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: 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 2010
    Location
    Syracuse, NY
    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?

 

 
Page 1 of 2 12 LastLast

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

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