Forums / Setting Up Categories, Products, Attributes / Extra Fields oin category listing page?

Extra Fields oin category listing page?

Views: 3,207

Results 1 to 20 of 20
1 Sep 2011, 2:33 PM
#1
stsung avatar

stsung

New Zenner

Join Date:
Aug 2011
Posts:
21
Plugin Contributions:
0

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)

the shop I'm working on now...
http://outcast.cz/

8 Sep 2011, 2:53 PM
#2
stsung avatar

stsung

New Zenner

Join Date:
Aug 2011
Posts:
21
Plugin Contributions:
0

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 **

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 **

  'TABLE_HEADING_EDITION' => TABLE_HEADING_EDITION,

in the switch section:

  case 'PRODUCT_LIST_EDITION':
   $select_column_list .= 'p.products_edition, ';
   break;

**3. in the product listing you use... add this **

case 'PRODUCT_LIST_EDITION':
  $lc_text = TABLE_HEADING_EDITION;
  $lc_align = 'left';
  $zc_col_count_description++;
  break;

and then finally under...

for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {
 $lc_align = '';
 switch ($column_list[$col]) {
    case 'PRODUCT_LIST_EDITION':
    $lc_align = 'left';
    $lc_text = '  '.$listing->fields['products_edition'];
    break;

4. Run SQL to add values to configuration table!!:

insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description,
  configuration_group_id, sort_order, date_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.

the shop I'm working on now...
http://outcast.cz/

12 Sep 2011, 9:54 AM
#3
jagall avatar

jagall

Zen Follower

Join Date:
Mar 2011
Location:
Ireland
Posts:
286
Plugin Contributions:
0

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

12 Sep 2011, 6:25 PM
#4
idc1 avatar

idc1

Zen Follower

Join Date:
Jul 2011
Posts:
139
Plugin Contributions:
0

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

12 Sep 2011, 8:11 PM
#5
jagall avatar

jagall

Zen Follower

Join Date:
Mar 2011
Location:
Ireland
Posts:
286
Plugin Contributions:
0

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

13 Sep 2011, 1:02 PM
#6
idc1 avatar

idc1

Zen Follower

Join Date:
Jul 2011
Posts:
139
Plugin Contributions:
0

Re: Extra Fields oin category listing page?

jagall:

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

13 Sep 2011, 1:03 PM
#7
idc1 avatar

idc1

Zen Follower

Join Date:
Jul 2011
Posts:
139
Plugin Contributions:
0

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

13 Sep 2011, 1:34 PM
#8
jagall avatar

jagall

Zen Follower

Join Date:
Mar 2011
Location:
Ireland
Posts:
286
Plugin Contributions:
0

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.

13 Sep 2011, 3:16 PM
#9
idc1 avatar

idc1

Zen Follower

Join Date:
Jul 2011
Posts:
139
Plugin Contributions:
0

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

13 Sep 2011, 6:28 PM
#10
idc1 avatar

idc1

Zen Follower

Join Date:
Jul 2011
Posts:
139
Plugin Contributions:
0

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

14 Sep 2011, 9:56 PM
#11
jagall avatar

jagall

Zen Follower

Join Date:
Mar 2011
Location:
Ireland
Posts:
286
Plugin Contributions:
0

Re: Extra Fields oin category listing page?

idc1:

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.

thank you for this, I entered it manually and it shows in admin but still not on the product listing ahhhh

index.php

define('TABLE_HEADING_COUNT', 'Product Count');

main_template_vars

// 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_COUNT' => PRODUCT_LIST_COUNT,
'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE);

case 'PRODUCT_LIST_COUNT':
$select_column_list .= 'p.products_count, ';
break; 

Product listing code:

case 'PRODUCT_LIST_COUNT':
$lc_text = TABLE_HEADING_COUNT;
$lc_align = 'left';
$zc_col_count_description++;
break;

    case 'PRODUCT_LIST_COUNT':
	$lc_align = 'left';
	$lc_text = '  '.$listing->fields['products_count'];
	break;

Am I missing something here, beginning to think it is the way my fields are set up? any ideas appreciated v much.

15 Sep 2011, 1:55 PM
#12
idc1 avatar

idc1

Zen Follower

Join Date:
Jul 2011
Posts:
139
Plugin Contributions:
0

Re: Extra Fields oin category listing page?

jagall:

thank you for this, I entered it manually and it shows in admin but still not on the product listing ahhhh

Am I missing something here, beginning to think it is the way my fields are set up? any ideas appreciated v much.

Do you see the column header or anything? What table did you put your "COUNT" data in?

idc1:

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?
Anyone with some insight to my dilemma quoted above?

ZC 1.5.5
Add ons: - Column/Grid 1.3.8 - Dual pricing 1.7 - ImageHandler3

15 Sep 2011, 7:36 PM
#13
jagall avatar

jagall

Zen Follower

Join Date:
Mar 2011
Location:
Ireland
Posts:
286
Plugin Contributions:
0

Re: Extra Fields oin category listing page?

well the extra field is in the products table i.e.products_count.
In the product listing, it asks Do you want to display product listing? but nothing is showing up at all!!!

15 Sep 2011, 8:30 PM
#14
jagall avatar

jagall

Zen Follower

Join Date:
Mar 2011
Location:
Ireland
Posts:
286
Plugin Contributions:
0

Re: Extra Fields oin category listing page?

Hi just noticed that when i added a new product via the admin the extra field shows up the product details e.g.
Product Code: NERL3026
Manufactured by: Nestle
Count:36
Quantity Per Box: 36
R.R.P.: 0.65

I already have this displaying as quantity per box. also it doesn't not show the tabbed product interface either.

15 Sep 2011, 10:10 PM
#15
jagall avatar

jagall

Zen Follower

Join Date:
Mar 2011
Location:
Ireland
Posts:
286
Plugin Contributions:
0

Re: Extra Fields oin category listing page?

jagall:

Hi just noticed that when i added a new product via the admin the extra field shows up the product details e.g.
Product Code: NERL3026
Manufactured by: Nestle
Count:36
Quantity Per Box: 36
R.R.P.: 0.65

I already have this displaying as quantity per box. also it doesn't not show the tabbed product interface either.

Got rid of the extra count field but have given up on getting it to display at this stage, may come back to this later tho. thanks:frusty:

20 Sep 2011, 11:25 PM
#16
stsung avatar

stsung

New Zenner

Join Date:
Aug 2011
Posts:
21
Plugin Contributions:
0

Re: Extra Fields oin category listing page?

idc1: well, I actually created a search by keyword to sort by my extra fields. but I encountered a problem as the javascript removing the initial keyword does not remove it ... and thus the search does not find anything. (it's a filter actually)

for that both headers need to be edited.

the shop I'm working on now...
http://outcast.cz/

28 Sep 2011, 3:28 PM
#17
idc1 avatar

idc1

Zen Follower

Join Date:
Jul 2011
Posts:
139
Plugin Contributions:
0

Re: Extra Fields oin category listing page?

stsung:

idc1: well, I actually created a search by keyword to sort by my extra fields. but I encountered a problem as the javascript removing the initial keyword does not remove it ... and thus the search does not find anything. (it's a filter actually)

for that both headers need to be edited.

That sounds more complicated than it seems like it should be. It may be my ignorance to php right now but I don't see why it doesn't just function like Product_List_Name, Product_List_Model, Product_List_Manufacturer, Product_List_Price. I may not be choosing the correct terms but is the additional field just not being captured in an array that allows it to be sorted like the rest?

For example in the product_listing.php there is this snippit of code:
if ( ($column_list[$col] != 'PRODUCT_LIST_IMAGE') ) {
$lc_text = zen_create_sort_heading($_GET['sort'], $col+1, $lc_text);
}

$list_box_contents[0][$col] = array('align' => $lc_align,
'params' => 'class="productListing-heading"',
'text' => $lc_text );

Is the additonal field not captured in the above snippit?

ZC 1.5.5
Add ons: - Column/Grid 1.3.8 - Dual pricing 1.7 - ImageHandler3

29 Sep 2011, 7:28 PM
#18
idc1 avatar

idc1

Zen Follower

Join Date:
Jul 2011
Posts:
139
Plugin Contributions:
0

Re: Extra Fields oin category listing page?

Stsung, to do it your way are you say header.php files need to be updated? Could you clarify which ones if this is the case. There are so many it's confusing. Or do you just mean the header portion of code in the product_listing.php

Thanks

ZC 1.5.5
Add ons: - Column/Grid 1.3.8 - Dual pricing 1.7 - ImageHandler3

4 Oct 2011, 8:43 PM
#19
games4gamers avatar

games4gamers

New Zenner

Join Date:
Dec 2008
Posts:
55
Plugin Contributions:
0

Re: Extra Fields oin category listing page?

stsung:

**2. in /main_template_vars.php find the part that adds a column and add it **

'TABLE_HEADING_EDITION' => TABLE_HEADING_EDITION,


Confused about this part. Where is this file located? \includes\modules\pages\index? \includes\modules\pages\product_info?

Neither have any other references to table headings which your comment seems to imply that there should be others in the file.

Some clarification about more specifically where this goes would be appreciated. Thanks. :smile:
4 Oct 2011, 8:58 PM
#20
idc1 avatar

idc1

Zen Follower

Join Date:
Jul 2011
Posts:
139
Plugin Contributions:
0

Re: Extra Fields oin category listing page?

games4gamers:

Confused about this part. Where is this file located? \includes\modules\pages\index? \includes\modules\pages\product_info?

Neither have any other references to table headings which your comment seems to imply that there should be others in the file.

Some clarification about more specifically where this goes would be appreciated. Thanks. :smile:

I believe the below may answer your question. See the second location that is listed

idc1:

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