I had the same problem and found an alternative solution. My aim was to hide the entire attributes section because showing the option will just be confusing to the customer.
In this particular case there is only a single attribute with one single option. It only serves to enable the download and IMO should not be displayed at all:
- Create a new class hidden in your stylesheet.css
.hidden{ position:absolute; visibility:hidden; }
- Open the file tpl_modules_attributes.php in a text editor
- Now find the line:
<div id="productAttributes">
and replace it with
<div id="productAttributes" class="hidden">
While the attributes section is now hidden it will still be evaluated when the add to cart button is submitted.
Note: In my case I needed to hide the attributes section only for a single product category. I achieved this by replacing the line
<div id="productAttributes">
with this conditional statement:
<?php
if( $cPath == '3' ){
echo '<div id="productAttributes" class="hidden">';
}else{
echo '<div id="productAttributes">';
}
?>
Andreas