Page 1 of 2 12 LastLast
Results 1 to 10 of 20
  1. #1
    Join Date
    Aug 2011
    Posts
    21
    Plugin Contributions
    0

    Default Extra Fields oin category listing page?

    is it possible somehow to load extra fields on the category listing page?

    because in general I don't want to use product listing at all. thus I need the data on category listing page. I just couldn't manage to list any other fields than those already predefined there.

    any help?

    (I need my extra fields to show + quantity + price + add to card by quantity)

  2. #2
    Join Date
    Aug 2011
    Posts
    21
    Plugin Contributions
    0

    Default Re: Extra Fields oin category listing page?

    ok, I found out what needs to be done. so if anyone else wants to do this here's kind of tutorial or at least guidelines to follow.

    after you add the new fields (search the forum if you don't know what to do).

    you need to edit few files.

    1. in the language files you use enter definitions
    in my case it would be

    PHP Code:
    define('TABLE_HEADING_EDITION''Edition');
    define('TABLE_HEADING_COLOR''Color');
    define('TABLE_HEADING_TYPEMTG''Type');
    define('TABLE_HEADING_CASTINGCOST''Casting Cost');
    define('TABLE_HEADING_RARITY''Rarity'); 
    2. in /main_template_vars.php find the part that adds a column and add it

    PHP Code:
      'TABLE_HEADING_EDITION' => TABLE_HEADING_EDITION
    in the switch section:

    PHP Code:
       case 'PRODUCT_LIST_EDITION':
        
    $select_column_list .= 'p.products_edition, ';
        break; 
    3. in the product listing you use... add this


    PHP Code:
      case 'PRODUCT_LIST_EDITION':
        
    $lc_text TABLE_HEADING_EDITION;
        
    $lc_align 'left';
        
    $zc_col_count_description++;
        break; 
    and then finally under...

    PHP Code:
     for ($col=0$n=sizeof($column_list); $col<$n$col++) {
        
    $lc_align '';
        switch (
    $column_list[$col]) { 
    PHP Code:
        case 'PRODUCT_LIST_EDITION':
        
    $lc_align 'left';
        
    $lc_text '&nbsp;&nbsp;'.$listing->fields['products_edition'];
        break; 
    4. Run SQL to add values to configuration table!!:

    PHP Code:
      insert into configuration (configuration_titleconfiguration_keyconfiguration_valueconfiguration_description,
        
    configuration_group_idsort_orderdate_added values (
        
    'Display Product Edition''PRODUCT_LIST_EDITION, '4', 'Do you want to display the Product Edition?', 8, 5, now()); 
    after all this you should have a new column created and the new field data loaded.

    I had everything set up but forgot about the configuration *double facepalm*.
    Last edited by stsung; 8 Sep 2011 at 03:58 PM.

  3. #3
    Join Date
    Mar 2011
    Location
    Ireland
    Posts
    286
    Plugin Contributions
    0

    Default Re: Extra Fields oin category listing page?

    hello stsung, I am just looking at your code now and well done on getting this sorted. i have two custom fields and wondered if I follow your code will this allow me to display the extra field in the product listing display see link here, i.e. the custom field would go under the product name. Thanks

  4. #4
    Join Date
    Jul 2011
    Posts
    138
    Plugin Contributions
    0

    Default Re: Extra Fields oin category listing page?

    For anyone trying the above here are my comments:

    -stsung's edit worked like a charm.

    -the only problem I experienced and to make others aware is to make sure the following snippit of code calls the right place (the red portion in particular):

    case 'PRODUCT_LIST_EDITION':
    $select_column_list .= 'p.products_edition, ';
    break;
    ZC 1.5.5
    Add ons: - Column/Grid 1.3.8 - Dual pricing 1.7 - ImageHandler3

  5. #5
    Join Date
    Mar 2011
    Location
    Ireland
    Posts
    286
    Plugin Contributions
    0

    Default Re: Extra Fields oin category listing page?

    hi getting an error when uploading sql
    can you indicate exactly what files needs to be updated?? cheers

  6. #6
    Join Date
    Jul 2011
    Posts
    138
    Plugin Contributions
    0

    Default Re: Extra Fields oin category listing page?

    Quote Originally Posted by jagall View Post
    hi getting an error when uploading sql
    can you indicate exactly what files needs to be updated?? cheers
    I just went into the PHPadmin, opened up the configuration table and added per sstung's instructions (making necessary naming or sorting adjustments per my needs):

    configuration_title =Display Product Edition
    configuration_key =PRODUCT_LIST_EDITION
    configuration_value =4
    configuration_description ='Do you want to display the Product Edition?
    configuration_group_id =8
    sort_order =5
    date_added= 2011-09-12 12:27:37
    ZC 1.5.5
    Add ons: - Column/Grid 1.3.8 - Dual pricing 1.7 - ImageHandler3

  7. #7
    Join Date
    Jul 2011
    Posts
    138
    Plugin Contributions
    0

    Default Re: Extra Fields oin category listing page?

    The problem I seem to be having now is that the field does not sort correctly when you click the header title to do such
    ZC 1.5.5
    Add ons: - Column/Grid 1.3.8 - Dual pricing 1.7 - ImageHandler3

  8. #8
    Join Date
    Mar 2011
    Location
    Ireland
    Posts
    286
    Plugin Contributions
    0

    Default Re: Extra Fields oin category listing page?

    thanks I'll try that, can you advise as to the path name which you updated your files, I updated the files in the languages folder: includes/languages/english/sweet/index.php,
    /includes/modules/product_listing.php and the main_template_vars.php in the includes/modules/pages/index as it seems to be only one place to update this, is this correct from what you done yourself thanks.

  9. #9
    Join Date
    Jul 2011
    Posts
    138
    Plugin Contributions
    0

    Default Re: Extra Fields oin category listing page?

    The 3 I changed were

    /includes/languages/english/YOUR_TEMPLATE/index.php
    /includes/modules/pages/index/main_template_vars.php
    /includes/modules/YOUR_TEMPLATE/product_listing.php

    The only difference I see is that you did not use an override file for your product_listing.php.
    ZC 1.5.5
    Add ons: - Column/Grid 1.3.8 - Dual pricing 1.7 - ImageHandler3

  10. #10
    Join Date
    Jul 2011
    Posts
    138
    Plugin Contributions
    0

    Default Re: Extra Fields oin category listing page?

    I've tried to change the settings in the admin>config but that does not solve my problem. Evidently there is a bit of code that has to be included in one of the files so that the additional fields can be sorted.

    When I first visit one of my product listing pages, items are sorted by Item Name. If I then try to sort by my new field (in ascending or descending order), it does not sort by that column. Rather it sorts ascending by model.

    Any idea what is missing?
    ZC 1.5.5
    Add ons: - Column/Grid 1.3.8 - Dual pricing 1.7 - ImageHandler3

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 1
    Last Post: 10 Sep 2013, 10:09 PM
  2. Extra Fields on product_listing page
    By dropbop in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 13 Apr 2011, 01:26 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