Results 1 to 10 of 10
  1. #1
    Join Date
    Oct 2007
    Posts
    12
    Plugin Contributions
    0

    Default $Define_List help

    I added some custom fields to my products table. I followed crazy_chris's post http://www.zen-cart.com/forum/showthread.php?t=57924

    I was able to successfully get the product fields to show up on my product info page. Now I am trying to add the custom product fields to my categories page.

    I am debugging the application and when I get to
    includes/modules/pages/index/main_template_vars.php and get to the $define_list array function.

    Code:
      // create column list
      $define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL,
      'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,
      'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER,
      'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE,
      'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY,
      'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT,
      'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE,
      'PRODUCT_LIST_MFRNUM' => PRODUCT_LIST_MFRNUM,
      'PRODUCT_LIST_CODE' => PRODUCT_LIST_CODE,
      'PRODUCT_LIST_SHAFTDIAMETER' => PRODUCT_LIST_SHAFTDIAMETER,
      'PRODUCT_LIST_OUTSIDEDIAMETER' => PRODUCT_LIST_OUTSIDEDIAMETER,
      'PRODUCT_LIST_LENGTH' => PRODUCT_LIST_LENGTH,
      'PRODUCT_LIST_FLANGEDIAMETER' => PRODUCT_LIST_FLANGEDIAMETER,
      'PRODUCT_LIST_FLANGETHICKNESS' => PRODUCT_LIST_FLANGETHICKNESS,
      'PRODUCT_LIST_METALID' => PRODUCT_LIST_METALID,
      'PRODUCT_LIST_METALTHICKNESS' => PRODUCT_LIST_METALTHICKNESS,
      'PRODUCT_LIST_PILOTDIAMETER' => PRODUCT_LIST_PILOTDIAMETER,
      'PRODUCT_LIST_PILOTTHICKNESS' => PRODUCT_LIST_PILOTTHICKNESS,
      'PRODUCT_LIST_IDACROSSWATER' => PRODUCT_LIST_IDACROSSWATER);
    The output shows numbers for PRODUCT_LIST_MODEL, _NAME, _MANUFACTURER, _PRICE, _QUANTITY, _WEIGHT, _IMAGE ... But for my custom fields it shows the variable name instead of the variable.

    I guess my starting question is where do these variables for $define_list come from? What page? Do they come from a database table? Do I need to add in records in the db for my custom fields?

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: $Define_List help

    Have you reviewed this for product types?

    https://www.zen-cart.com/tutorials/i...hp?article=114
    Zen-Venom Get Bitten

  3. #3
    Join Date
    Oct 2007
    Posts
    12
    Plugin Contributions
    0

    Default Re: $Define_List help

    Yeah I've read through that before. It seems like a bit more than I need especially since I already have the info showing up on the product info page. I would still like to know where this info for the define_list is coming from. If i had to guess I'd think it was coming from the configuration values set under Admin -> Configuration -> Product Listing. Because they are the same numbers that I have set for Display Product Image, Display Product Mafuacturer Name, etc.

    So if I could figure out what table in the database that was in, I might be a little closer to where I want to be :)

  4. #4
    Join Date
    Oct 2007
    Posts
    12
    Plugin Contributions
    0

    Default Re: $Define_List help

    I found them. They are actually in the Configurations table.

  5. #5
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: $Define_List help

    Now I am trying to add the custom product fields to my categories page.
    Getting them on the front end is only one part

    Having them show up in the admin for entry is what product types are about - you can clone say the 'general' type and name it a name of your choosing then add the entry fields you need
    Zen-Venom Get Bitten

  6. #6
    Join Date
    Oct 2007
    Posts
    12
    Plugin Contributions
    0

    Default Re: $Define_List help

    Does the product type section handle how the products will display in the categories page or just the product info (details) page?

  7. #7
    Join Date
    Oct 2007
    Posts
    12
    Plugin Contributions
    0

    Default Re: $Define_List help

    I tried adding a new record in the Configuration table for one of my custom fields. I was able to get it to show up from the admin section (configuration -> Product Listing) (ex. Display Flange Diameter) but it still wont show up on the categories page. And when i debug and look at the Define_list array, it is still doing the same as before.

    I just want my categories page to have these custom fields. If product types lets you do that. then I'll scrap everything and start over. But I don't think that it does. I created several test products as Product - Music and added the music type properties but in the categories page it still just displays the basic info.

  8. #8
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: $Define_List help

    Post a link to your music test product
    Zen-Venom Get Bitten

  9. #9
    Join Date
    Oct 2007
    Posts
    12
    Plugin Contributions
    0

    Default Re: $Define_List help

    I was able to get this to work. I added the record in the configuations table incorrectly. I needed to set the Configuration_Key to the same value as I had set in my $define_list. Now I am able to control these custom fields from the Product Listing Admin page.

    I think that I could also make a conditional statement on the main_template_vars.php page that will only add these fields to the define_list if I'm on a certain categories page by using the cPath variable.

  10. #10
    Join Date
    Mar 2005
    Posts
    123
    Plugin Contributions
    0

    Default Re: $Define_List help

    I don't suppose someone could do a step-by-step on this could they? I already have the custom DB field and can display the value in the product info page but I want it to show on the product listing pages and in the new products index box...

 

 

Similar Threads

  1. Help Help Help! I cannot login to Admin
    By cjayosburn in forum General Questions
    Replies: 17
    Last Post: 21 Mar 2011, 04:52 PM
  2. Help help help please site not working !
    By symmo in forum General Questions
    Replies: 1
    Last Post: 15 Jan 2010, 10:18 PM
  3. HELP! HELP! HELP! Price Different in Express Checkout
    By Craig Robbo in forum PayPal Express Checkout support
    Replies: 6
    Last Post: 15 May 2009, 06:55 PM
  4. HELP HELP HELP!!! I accidentally deleted english.php
    By whiteblazer01 in forum General Questions
    Replies: 2
    Last Post: 6 Mar 2009, 01:11 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
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR