Results 1 to 10 of 17

Hybrid View

  1. #1
    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

  2. #2
    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 />

  3. #3
    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

  4. #4
    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

  5. #5
    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

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

    Default Re: Product Listing Custom Fields

    this is my current code whwere i am trying to put it

    <div class="listingDescription">' . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listi ng->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '<br /><br />' . '<strong>Model: </strong>' . $listing->fields['products_model'] . '' . '</span><br />











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



    <span><strong>Manufacturer:</strong> '. $listing->fields['manufacturers_name'] . '' . '</span><br />

    <span> <span style="color:#1a3c8a;"><strong>In Stock</strong></span></span><br />

    <span class="freesh"><span style="color:#209b50;"><strong>Free Shipping</strong></span> on orders over $250</span><br /><br />
    ' . '</div>';



    where the <span><strong>UPC:</strong> '. $listing->fields['upc'] . '' . '</span><br /> it wont let me put the if statement it says there is an error

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

    Default Re: Product Listing Custom Fields

    So something like that ?
    I don't know where that echo starts in your code. But see if you understand it:

    PHP Code:
    echo '<div class="listingDescription">' zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '<br /><br />' '<strong>Model: </strong>' $listing->fields['products_model'] . '' '</span><br /> '// [B]YOU CLOSE [/B]

    if ($listing->fields['upc']!='') { 
    echo 
    '<span><strong>UPC:</strong> '$listing->fields['upc'] . '' '</span><br />';
    }

    // [B]YOU ECHO AGAIN[/B]
    echo '<span><strong>Manufacturer:</strong> '$listing->fields['manufacturers_name'] . '' '</span><br />
    <span> <span style="color:#1a3c8a;"><strong>In Stock</strong></span></span><br />
    <span class="freesh"><span style="color:#209b50;"><strong>Free Shipping</strong></span> on orders over $250</span><br /><br />
    '</div>'
    Hope it helps
    “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