Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1
    Join Date
    Jun 2008
    Posts
    2
    Plugin Contributions
    0

    Default custom product field

    hi,

    i have added a new product field to me products table by following this great post from crazy_chris: http://www.zen-cart.com/forum/showthread.php?t=57924

    everything works fine. i am able to edit values from admin and see results on product info page. http://www.zen-cart.com/forum/images/smilies/cool.gif

    i need to output this field on the product listing page - have been tryin in vain for a couple of days and have hit a brick wall it seems. must be missing something.

    in my custom product_listing.php template i can output any existing product fields with " $listing->fields['products_id']) "

    as soon as i try to reference my new field " $listing->fields['products_image_orientation']) " - it fails and outputs nothing. the same syntax works on product info page - no problem.

    can anyone point out what i am missing .... a thousand thank you's in advance .....

    [as you can see - i wish to store the orientation of my artwork / prints .... i tried initially to just calulate (width divided by height) but could not figure that out so opted to hard code it as a product attribute]

    http://www.zen-cart.com/forum/images/smilies/blink.gif

  2. #2
    Join Date
    Aug 2005
    Location
    Southampton
    Posts
    80
    Plugin Contributions
    0

    Default Re: custom product field

    I too have followed the instructions as found in the link above, and I would like it to show in my product listing. Has anyone found the answer to this question as I really need to get this onto the listing page as soon as possible. No-one seems to be answering any of the questions concerning this issue.

  3. #3
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    21,999
    Plugin Contributions
    25

    Default Re: custom product field

    Does the SQL query for the product listing retrieve the new field's value? You would probably need to edit that before you can use it in the listing.

  4. #4
    Join Date
    Aug 2005
    Location
    Southampton
    Posts
    80
    Plugin Contributions
    0

    Default Re: custom product field

    What I have done so far is add a field on the product info page called products_delivery which is editable through admin. The database has been altered to allow for the extra field and all shows up on the product info page. I now need this field to be shown on the product listing page in order for the information to be seen by all customers so that they do not complain about delivery dates.

    I have downloaded product_listing.php to see if there is anything that is obvious for me to customise but I cannot see where to start. I know that I must pull the information from the database in order for this to be shown, but not quite sure how to do it.

  5. #5
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    21,999
    Plugin Contributions
    25

    Default Re: custom product field

    At the top of product_listing.php, this gets the data to be used:
    PHP Code:
    $listing_split = new splitPageResults($listing_sqlMAX_DISPLAY_PRODUCTS_LISTING'p.products_id''page'); 
    so you would have to find the file where splitPageResults is built (in a /functions/ or /classes/ folder, most likely) and add to the SQL query there.

  6. #6
    Join Date
    Aug 2005
    Location
    Southampton
    Posts
    80
    Plugin Contributions
    0

    Default Re: custom product field

    Me no understand!!! Am I to edit the product_listing.php file or some other file? If so where do I find this other file and what do I add?
    Last edited by SteveCollins; 21 Nov 2008 at 01:56 AM.

  7. #7
    Join Date
    Aug 2005
    Location
    Southampton
    Posts
    80
    Plugin Contributions
    0

    Default Re: custom product field

    I currently have a field set up in my database and the product info page called products_delivery that works well. But I need to be able to display this in the product listing page. Do I add this to the product listing page and how?

  8. #8
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    21,999
    Plugin Contributions
    25

    Default Re: custom product field

    Use the Developers Toolkit in admin > Tools to find the file where splitPageResults is built (see the tutorials if you don't know how to use it yet). That file is most likely the place to modify the SQL query to also retrieve your products_delivery field.

    Once you have retrieved it, you can use it in product_listing.php the same way as in the product info page.

  9. #9
    Join Date
    Aug 2005
    Location
    Southampton
    Posts
    80
    Plugin Contributions
    0

    Default Re: custom product field

    There are lots of places where splitPageResults is found but I cannot see where or what I am supposed to put the info that is needed. There is also a splitPageResults.php file in /includes/classes. Where am I supposed to place products_delivery? Am I also to edit the product_listing.php file with the same info in the splitPageResults section? Is there anywhere else that I am supposed to edit and what am I meant to change?

    I appreciate your time and effort in replying to my enquiry, but there are so many questions that are being raised by the answers given that I am not really acheiving anything. I need more specific information in order to get to the results that are needed. I am okish with PHP, good with HTML and useless with SQL, JAVASCRIPT and most other scripts. It is important that any info given doesn't just point me in the right direction, but gives me accurate and precise information about how to include the field that I require in the product_listing page.

    If you have not the time or the info please just say and I will appreciate your efforts in helping me.

  10. #10
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    21,999
    Plugin Contributions
    25

    Default Re: custom product field

    I believe /includes/classes/splitPageResults.php will be the file to edit, but I can't tell you definitively how to edit the SQL query.

    If you know what you did to get the new field into the product info page, the addition to the SQL should be quite similar if not the same. Be careful about this, as splitPageResults may also be used in other situations where you don't want to change. It may make no difference to other locations if the new field is available and unused there.
    Last edited by gjh42; 23 Nov 2008 at 05:25 PM.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Custom Amount Field?
    By gabstero in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 5 Jun 2008, 07:17 AM
  2. Summarizing a Custom Field
    By overrider in forum General Questions
    Replies: 1
    Last Post: 24 Mar 2008, 03:22 AM
  3. Creating custom features for products, similar to Product Manufacturer field
    By binary in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 19 Feb 2008, 04:37 AM
  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

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
  •