Re: How to modify your template to not show display only attributes
Quote:
Originally Posted by
AvaAdorn
When I add the code, it does nothing. Where are you adding the code? I added it in 3 places. I searched for TABLE_PRODUCTS_ATTRIBUTES, and then added the code underneath that.
Yep thats right there are 3 places
I tried a few permutations but none worked
Re: How to modify your template to not show display only attributes
Just wanted to see if you guys ever found a solution to your question and not being able to "hide" the section when set to Display Only.
As the code from the ZenCart fellow mentioned, there are 3 places where you need to add in the mySQL line of code:
for each SQL query for TABLE_PRODUCTS_ATTRIBUTES you need to add:
and patrib.attributes_display_only = 0
Code:
$sql = "select count(*) as total
from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib
where patrib.products_id='" . (int)$_GET['products_id'] . "'
and patrib.options_id = popt.products_options_id
and patrib.attributes_display_only = 0
and popt.language_id = '" . (int)$_SESSION['languages_id'] . "'" .
" limit 1";
Code:
$sql = "select distinct popt.products_options_id, popt.products_options_name, popt.products_options_sort_order,
popt.products_options_type, popt.products_options_length, popt.products_options_comment,
popt.products_options_size,
popt.products_options_images_per_row,
popt.products_options_images_style,
popt.products_options_rows
from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib
where patrib.products_id='" . (int)$_GET['products_id'] . "'
and patrib.options_id = popt.products_options_id
and patrib.attributes_display_only = 0
and popt.language_id = '" . (int)$_SESSION['languages_id'] . "' " .
$options_order_by;
EXCEPT THERE IS ONE SQL QUERY that you need to slightly change the line that you add, use this on the 3rd change:
Code:
$sql = "select pov.products_options_values_id,
pov.products_options_values_name,
pa.*
from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov
where pa.products_id = '" . (int)$_GET['products_id'] . "'
and pa.options_id = '" . (int)$products_options_names->fields['products_options_id'] . "'
and pa.options_values_id = pov.products_options_values_id
and pa.attributes_display_only = 0
and pov.language_id = '" . (int)$_SESSION['languages_id'] . "' " .
$order_by;
Re: How to modify your template to not show display only attributes
Quote:
Originally Posted by
jtincher
Just wanted to see if you guys ever found a solution to your question and not being able to "hide" the section when set to Display Only.
Thank you for submitting this code. It was helpful. However, I tried this and added the 3 lines of code exactly as you stated to my attributes.php file. My attributes that I set as Read Only still show up. Not sure what I am doing wrong.