Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Hide attributes for a category

Hide attributes for a category

Locked

Views: 692

Results 1 to 6 of 6
This thread is locked. New replies are disabled.
20 Apr 2010, 8:56 PM
#1
abidan avatar

abidan

New Zenner

Join Date:
Mar 2009
Posts:
26
Plugin Contributions:
0

Hide attributes for a category

I want to hide the attributes section of products in a particular category only but still show them for all other categories - say category id 77 all products should not show attributes. the reason i want to do this is so that a hidden attribute can be passed when a product is purchased.

I tried this but it does not work:

if ($listing->fields['master_categories_id'] == '77') {
echo ''
} else {
require($template->get_template_dir('/tpl_modules_attributes.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_attributes.php');
}

it just always shows the template for attributes, i think it is something to do with the first line ....anyone any ideas??

Thanks in advance

20 Apr 2010, 9:04 PM
#2
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Hide attributes for a category

Possibly easier using a CATEGORY-SPECIFIC stylesheet.

Create a NEW stylesheet called c_77.css (use notepad)

Insert the following declaration:

#productAttributes, .wrapperAttribsOptions {display:none;}

(you may need to use {visibility:hidden} instead of {display:none} )

SAVE, then ftp to your css folder.

See what happens...

20 Apr 2010, 10:11 PM
#3
abidan avatar

abidan

New Zenner

Join Date:
Mar 2009
Posts:
26
Plugin Contributions:
0

Re: Hide attributes for a category

Hi Schoolboy

Yeah my first thoughts were style sheet but i dont think that would work? I only want to hide all the attributes for all products in one category, how would that css entry work, wouldnt it hide attributes for ALL categories???

20 Apr 2010, 10:34 PM
#4
abidan avatar

abidan

New Zenner

Join Date:
Mar 2009
Posts:
26
Plugin Contributions:
0

Re: Hide attributes for a category

Oh hang on, i didnt read properly i will try create seperate stylesheet :)

20 Apr 2010, 10:47 PM
#5
abidan avatar

abidan

New Zenner

Join Date:
Mar 2009
Posts:
26
Plugin Contributions:
0

Re: Hide attributes for a category

schoolboy:

Possibly easier using a CATEGORY-SPECIFIC stylesheet.

Create a NEW stylesheet called c_77.css (use notepad)

Insert the following declaration:

#productAttributes, .wrapperAttribsOptions {display:none;}

(you may need to use {visibility:hidden} instead of {display:none} )

SAVE, then ftp to your css folder.

See what happens...

Brilliant solution schoolboy, worked a treat, thankyou......... my category was actually a subcategory too so i fugured out i had to use both categories i.e. 77_78.css.............. attributes now gone for that category :) So simple, thankyou :)

21 Apr 2010, 7:31 AM
#6
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Hide attributes for a category

There is a CSS-README file in the css folder... See what else you can do with SPECIFIC stylesheets...