Results 1 to 10 of 17

Hybrid View

  1. #1
    Join Date
    Jan 2015
    Posts
    709
    Plugin Contributions
    1

    Default Product Listing Custom Fields

    I am using zencart v1.5.4.


    I have created a custom field in my database called (upc) within the products table. I need this to show this field on my product listing page but I am stuck on how to get it to display. If someone could assist me or lead me in the right direction i would appreciate it.

  2. #2
    Join Date
    Aug 2014
    Location
    Lisbon
    Posts
    594
    Plugin Contributions
    0

    Default Re: Product Listing Custom Fields

    “Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison

  3. #3
    Join Date
    Aug 2014
    Location
    Lisbon
    Posts
    594
    Plugin Contributions
    0

    Default Re: Product Listing Custom Fields

    Ups, sorry. it doesn't display either.
    “Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison

  4. #4
    Join Date
    Jan 2015
    Posts
    709
    Plugin Contributions
    1

    Default Re: Product Listing Custom Fields

    I actually got it by adjusting the default_filter.php and the product listing.php from a previous posting.

    The only thing now is if there is nothing in the database how do i hide the span from displaying.

    This is my code
    <span><strong>UPC:</strong> '. $listing->fields['upc'] . '' . '</span><br />

  5. #5
    Join Date
    Aug 2014
    Location
    Lisbon
    Posts
    594
    Plugin Contributions
    0

    Default Re: Product Listing Custom Fields

    Something like

    if ($listing->fields['upc']!='') {
    echo '<span><strong>UPC:</strong> '. $listing->fields['upc'] . '' . '</span><br />';
    }
    “Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison

  6. #6
    Join Date
    Jan 2015
    Posts
    709
    Plugin Contributions
    1

    Default Re: Product Listing Custom Fields

    hmm that does not seem to work on the product listing page. Any other ideas

  7. #7
    Join Date
    Aug 2014
    Location
    Lisbon
    Posts
    594
    Plugin Contributions
    0

    Default Re: Product Listing Custom Fields

    well, one example from that file is

    PHP Code:
     if ($listing->fields['products_qty_box_status'] == 0) {
                  
    $lc_button '<a href="' zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' $listing->fields['products_id']) . '">' zen_image_button(BUTTON_IMAGE_BUY_NOWBUTTON_BUY_NOW_ALT'class="listingBuyNowButton"') . '</a>';
                } else {
                  
    $lc_button TEXT_PRODUCT_LISTING_MULTIPLE_ADD_TO_CART "<input type=\"text\" name=\"products_id[" $listing->fields['products_id'] . "]\" value=\"0\" size=\"4\" />";
                } 
    If you can see the field with the right values no matter what, the only thing you need is a IF condition.
    Anyway, just pointing some direction...
    “Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison

 

 

Similar Threads

  1. Add custom fields to product
    By tkelley66 in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 11 May 2009, 07:28 PM
  2. Custom Product Fields
    By CheezyBreezy13 in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 18 Sep 2008, 06:45 PM
  3. Custom product's fields on/off
    By janekbar5 in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 4 Mar 2008, 11:20 PM
  4. Custom Order Fields within Product Listing
    By pinwest in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 2 Dec 2007, 05:00 AM
  5. show custom product fields on new and all product pages
    By crl in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 1 Oct 2007, 05:04 AM

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