Forums / General Questions / Hide disply only attributes

Hide disply only attributes

Views: 3,261

Results 1 to 11 of 11
30 Apr 2012, 6:21 AM
#1
mcgill avatar

mcgill

Zen Follower

Join Date:
Aug 2005
Posts:
101
Plugin Contributions:
0

Hide disply only attributes

Hi
I hope this is the right place to post this question.

Is there a way to hide display only attributes?

Only a fool say's money doesn't matter. No rich man ever starved to death.

30 Apr 2012, 12:51 PM
#2
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,185
Plugin Contributions:
0

Re: Hide disply only attributes

May i have a link to the attribute in question here please ...
And explain a little more in detail ..

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.

Zen Cart Certified hosting at myZenCartHost.com.

30 Apr 2012, 3:14 PM
#3
mcgill avatar

mcgill

Zen Follower

Join Date:
Aug 2005
Posts:
101
Plugin Contributions:
0

Re: Hide disply only attributes

Hi
I have installed the Numinix googlefroogle add on and it uses the attributes for google categories but the problem is the display only attributes show on the ad and I need to hide them. I am not the only one looking for a solution to this and numinix does not respond to posts about it.

http://velvetfreeway.com/aaaa/index.php?main_page=product_info&cPath=1&products_id=1

It would be great if you could help

Only a fool say's money doesn't matter. No rich man ever starved to death.

11 May 2012, 5:26 PM
#4
webchills avatar

webchills

Zen Follower

Join Date:
Sep 2005
Location:
Austria
Posts:
99
Plugin Contributions:
1

Re: Hide disply only attributes

You could hide these display only attributes via CSS:

Find in includes/modules/(YOURTEMPLATE)/attributes.php:

// Read Only - just for display purposes
                  if ($products_options_names->fields['products_options_type'] == PRODUCTS_OPTIONS_TYPE_READONLY) {
                    //            $tmp_html .= '<input type="hidden" name ="id[' . $products_options_names->fields['products_options_id'] . ']"' . '" value="' . stripslashes($products_options->fields['products_options_values_name']) . ' SELECTED' . '" />  ' . $products_options->fields['products_options_values_name'];
                    $tmp_html .= $products_options_details . '<br />';
                  } else {
                    $zv_display_select_option ++;
                  }

Assign an ID by changing to:

 // Read Only - just for display purposes
                  if ($products_options_names->fields['products_options_type'] == PRODUCTS_OPTIONS_TYPE_READONLY) {
                    //            $tmp_html .= '<input type="hidden" name ="id[' . $products_options_names->fields['products_options_id'] . ']"' . '" value="' . stripslashes($products_options->fields['products_options_values_name']) . ' SELECTED' . '" />  ' . $products_options->fields['products_options_values_name'];
                    $tmp_html .= '<div id="merchanthide">' . $products_options_details . '</div>';
                  } else {
                    $zv_display_select_option ++;
                  }

Now you can add the following to your includes/templates/YOURTEMPLATE/stylesheet.css:

#merchanthide{
	display:none;
}
1 Aug 2012, 12:09 PM
#5
mcgill avatar

mcgill

Zen Follower

Join Date:
Aug 2005
Posts:
101
Plugin Contributions:
0

Re: Hide disply only attributes

Thanks for that but for some reason it does not work

Only a fool say's money doesn't matter. No rich man ever starved to death.

20 May 2013, 1:16 AM
#6
ekles avatar

ekles

New Zenner

Join Date:
Aug 2005
Posts:
73
Plugin Contributions:
0

Re: Hide disply only attributes

Let me know if you still need a solution that works globally. In plain words NO read only attributes will show anywhere on the site. Works perfectly with Dynamic Filter and you only have to alter 2 lines in 1 file

Making sure we get the cost of freight back will drive us all mad at some stage.

20 May 2013, 2:53 AM
#7
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,849
Plugin Contributions:
18

Re: Hide disply only attributes

Since this forum is a venue to help those in need, how's about posting your solution just in case you're on a cruise when it's needed.:P

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

4 Jun 2013, 2:31 PM
#8
allthingsidleroy avatar

allthingsidleroy

New Zenner

Join Date:
May 2013
Posts:
38
Plugin Contributions:
0

Re: Hide disply only attributes

I've found this solution:

Edit your /includes/modules/<template>/attributes.php file. If it doesn't exist, copy the attributes.php file from /includes/modules/attributes.php and put it there.

Once in the file, locate these lines (this started on line 554 for me):

// READONLY
case ($products_options_names->fields['products_options_type'] == PRODUCTS_OPTIONS_TYPE_READONLY):
$options_name[] = $products_options_names->fields['products_options_name'];
$options_menu[] = $tmp_html . "\n";
$options_comment[] = $products_options_names->fields['products_options_comment'];
$options_comment_position[] = ($products_options_names->fields['products_options_comment_position'] == '1' ? '1' : '0');
break;

Comment the lines so it looks like this:

// READONLY
case ($products_options_names->fields['products_options_type'] == PRODUCTS_OPTIONS_TYPE_READONLY):
//$options_name[] = $products_options_names->fields['products_options_name'];
//$options_menu[] = $tmp_html . "\n";
//$options_comment[] = $products_options_names->fields['products_options_comment'];
//$options_comment_position[] = ($products_options_names->fields['products_options_comment_position'] == '1' ? '1' : '0');
break;

Make sure you leave the 'break;' uncommented so the switch statement knows to break.

I left the case uncommented because I personally don't like messing with code I didn't write all too much. While it probably won't hurt to just remove the above portion entirely, I like to just comment out what I don't need so I can just remove the comments if I need it later.

4 Jun 2013, 2:58 PM
#9
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Hide disply only attributes

dbltoe:

Since this forum is a venue to help those in need, how's about posting your solution just in case you're on a cruise when it's needed.:P

Too funny!!:laugh:

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

4 Jun 2013, 4:03 PM
#10
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Hide disply only attributes

How does googlefroogle use the read-only attributes? Does it look at your website at all, or does it just get a feed straight from you?

Giving read-only attributes an id means that if there is more than one, there will be duplicate ids on the page - an HTML/CSS no-no. Make it a class instead of an id to be safe. Better yet, base the class (or id in this case) on the options name id and you will get a unique tag that can be used to address just this kind of read-only attribute, leaving others alone. Of course, if every product has a different option name for its google attribute, that would be impractical to handle in styling.

4 Jun 2013, 4:59 PM
#11
allthingsidleroy avatar

allthingsidleroy

New Zenner

Join Date:
May 2013
Posts:
38
Plugin Contributions:
0

Re: Hide disply only attributes

gjh42:

How does googlefroogle use the read-only attributes? Does it look at your website at all, or does it just get a feed straight from you?

It queries the database rather than parsing the webpage itself.