Zen Cart Logo
Forums / Setting Up Categories, Products, Attributes / I need to hide a column in Product Listing

I need to hide a column in Product Listing

Locked

Views: 2,014

Results 1 to 11 of 11
This thread is locked. New replies are disabled.
25 Oct 2006, 3:11 PM
#1
jeffmic avatar

jeffmic

Zen Follower

Join Date:
Aug 2006
Location:
North Carolina
Posts:
280
Plugin Contributions:
0

I need to hide a column in Product Listing

Hey gang,

I know this one is kinda strange, but I have 'Manufacturers' displaying in the first column in my Product Listing. I still need to have that as the sort field, BUT I really don't want it's contents to display within the Product Listing...just using the text for the sort.
The image (which I have in the next field) will suffice.

I need for room to display what I want in the Product Listing, and the Manufacturers is taking up the extra space.

Is there a place to actually comment this out (and the heading above it) to hide it from the customer and still have it used in the calulation for the sort?

thanks so much,

Jeff Michaels

25 Oct 2006, 3:20 PM
#2
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,608
Plugin Contributions:
0

Re: I need to hide a column in Product Listing

What version are you using? You can turn the column off in the Admin> Configuration> Product Listing

25 Oct 2006, 3:23 PM
#3
jeffmic avatar

jeffmic

Zen Follower

Join Date:
Aug 2006
Location:
North Carolina
Posts:
280
Plugin Contributions:
0

Re: I need to hide a column in Product Listing

1.3.5

Yes, I know I can turn it off, but I still need that column's info to determine the sort I want.
When I turn it off, the columns change positions and Manufacturer is no longer a choice to create the sort I need.

I'm look to still use the data within Manufacturer for sort purposes, but not display it

can this be done?

thanks,
Jeff

25 Oct 2006, 11:21 PM
#4
jeffmic avatar

jeffmic

Zen Follower

Join Date:
Aug 2006
Location:
North Carolina
Posts:
280
Plugin Contributions:
0

Re: I need to hide a column in Product Listing

Has anyone had a chance to devise a solution to my little problem?

thanks so much in advance

Jeff Michaels
pres of Musical Creations Ltd.

26 Oct 2006, 3:57 AM
#5
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: I need to hide a column in Product Listing

You'd have to cheat ...

You want functionality but not the display ...

The two are tied together ... and that is where it gets tricky ...

If you remove the column then the sort order which is based on columns gets off ...

If you made the column but the title was blank and you commented out the output and just sent a   ... visually you would not see the info ... but functionally it would still be there ...

Depending on your layout/template etc. you could more or less fake it out doing it this way ...

26 Oct 2006, 4:47 AM
#6
jeffmic avatar

jeffmic

Zen Follower

Join Date:
Aug 2006
Location:
North Carolina
Posts:
280
Plugin Contributions:
0

Re: I need to hide a column in Product Listing

Linda,

Can you point me to the proper file that would have the data I could comment out in a column? I've been searching pretty hard here and nothing is leading to this. The heading was pretty easy to locate though. This is in the index listing. I have 5 columns displaying and I only want to 'hide' the first column so everything in the remain 4 (especially the description) would fill in the gap.

thanks,
Jeff

/Users/jeffmic/Desktop/Picture 2.pdf

26 Oct 2006, 5:08 AM
#7
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: I need to hide a column in Product Listing

Bunch of peices and parts to the products_listing ...

Note: there is also the advanced search too ... on many things, there has to be changes to those files ... but I think you can sneak by that this time ...

/includes/modules/product_listing.php

Copy to your templates and overrides directory:
/includes/modules/your_template_dir/product_listing.php

Now there are two points here for the display ... headers and listing ...

This is the title ...

    case 'PRODUCT_LIST_MODEL':
    $lc_text = TABLE_HEADING_MODEL;
    $lc_align = '';
    $zc_col_count_description++;
$lc_text = ' ';

This is the listing output:

        case 'PRODUCT_LIST_MODEL':
        $lc_align = '';
        $lc_text = $listing->fields['products_model'];
        break;
$lc_text = ' ';
26 Oct 2006, 5:08 AM
#8
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: I need to hide a column in Product Listing

poopers ... I just did model vs manufactuer ... :cry:

26 Oct 2006, 5:10 AM
#9
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: I need to hide a column in Product Listing

Take two ...

    case 'PRODUCT_LIST_MANUFACTURER':
    $lc_text = TABLE_HEADING_MANUFACTURER;
    $lc_align = '';
    $zc_col_count_description++;
    break;
$lc_text = ' ';
        case 'PRODUCT_LIST_MANUFACTURER':
        $lc_align = '';
        $lc_text = '<a href="' . zen_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing->fields['manufacturers_id']) . '">' . $listing->fields['manufacturers_name'] . '</a>';
        break;
$lc_text = ' ';

/me needs coffee bad ... :lamo:

26 Oct 2006, 12:38 PM
#10
jeffmic avatar

jeffmic

Zen Follower

Join Date:
Aug 2006
Location:
North Carolina
Posts:
280
Plugin Contributions:
0

Re: I need to hide a column in Product Listing

Thanks Linda,

I got the manufactuers column to hide nicely and the original sort still works.
At first, I thought I had to comment out the first set of lines and then add the  .

All I had to do was just add the   before the break and it worked perfectly.

One small additional question:

How can I add a little 'padding' around the columns so the image, model, etc are not bumping into each other. Things are quite tight and some space will really help.
I tried to add some spaces ( ), but it didn't work.

thanks,
Jeff

26 Oct 2006, 5:48 PM
#11
jeffmic avatar

jeffmic

Zen Follower

Join Date:
Aug 2006
Location:
North Carolina
Posts:
280
Plugin Contributions:
0

Re: I need to hide a column in Product Listing

Never mind Linda....

I found and fixed it in the css

thanks
Jeff