title: Hiding some configurable attribute in the front-end - magento
body: <p>Please help...anyone</p>
  
  <p>I have a problem with hiding some configurable attributes:</p>
  
  <p>These are my configurable attributes at the back-end:</p>
  
  <ul>
  <li>Shape/Type</li>
  <li>Grit &amp; Colour</li>
  <li>Shank</li>
  <li>Items pack</li>
  <li>Diameter</li>
  <li>Supplier</li>
  </ul>
  
  <p>My client wants to hide the "Manufacturer" attribute on the front-end
  but wants to import the supplier at the back-end.</p>
  
  <p>Please see the website I am working:</p>
  
  <p><a href="http://ridental.com.au/newsite/polishers.html/" rel="nofollow">http://ridental.com.au/newsite/polishers.html/</a></p>
  
  <p>I managed to hide it from front-end by just adding some if statement 
  like this: in the <code>app\design\frontend\default\MYTEMPLATE\template\catalog\product\view\type\options\configurable.phtml</code></p>
  
  <pre><code>&lt;?php
  $_product    = $this-&gt;getProduct();
  $_attributes = Mage::helper('core')-&gt;decorateArray($this-&gt;getAllowAttributes());
  ?&gt;
  &lt;?php if ($_product-&gt;isSaleable() &amp;&amp; count($_attributes)):?&gt;
  &lt;dl class="outer"&gt;
  &lt;dl class="inner"&gt;
  &lt;?php foreach($_attributes as $_attribute): ?&gt;
  &lt;?php $attCode =   $_attribute-&gt;getProductAttribute()-&gt;getFrontend()-&gt;getAttribute()-&gt;getAttributeCode(); ?&gt;
  
     &lt;?php if($attCode != "manufacturer"):?&gt;
      &lt;div class="dtdd-wrapper&lt;?php if ($_attribute-&gt;decoratedIsLast){echo " last";}?&gt;"&gt;
      &lt;dt&gt;&lt;label class="required"&gt;&lt;em&gt;*&lt;/em&gt;&lt;?php echo $_attribute-&gt;getLabel() ?&gt;&lt;/label&gt;&lt;/dt&gt;
      &lt;dd&lt;?php if ($_attribute-&gt;decoratedIsLast){?&gt; class="last"&lt;?php }?&gt;&gt;
          &lt;div class="input-box"&gt;
              &lt;select name="super_attribute[&lt;?php echo $_attribute-&gt;getAttributeId() ?&gt;]" id="attribute&lt;?php echo $_attribute-&gt;getAttributeId() ?&gt;" class="required-entry super-attribute-select"&gt;
                  &lt;option&gt;&lt;?php echo $this-&gt;__('Choose an Option...') ?&gt;&lt;/option&gt;
                &lt;/select&gt;
      &lt;/div&gt;
      &lt;/dd&gt;
      &lt;/div&gt;
    &lt;?php endif; ?&gt;
  &lt;?php endforeach; ?&gt;
  &lt;/dl&gt;
  &lt;/dl&gt;
  &lt;script type="text/javascript"&gt;
      [b]var spConfig = new Product.Config(&lt;?php echo $this-&gt;getJsonConfig() ?&gt;);[/b]
  &lt;/script&gt;
  </code></pre>
  
  <p>The Manufacturer will not be displayed on the front-end.</p>
  
  <p>But when I click Add to Cart button I got the error:</p>
  
  <p><em>Please specify the product's option(s).</em> </p>
  
  <p>I noticed that in:</p>
  
  <p><code>var spConfig = new Product.Config(&lt;?php echo $this-&gt;getJsonConfig()</code></p>
  
  <p>It is still referring to the attribute "supplier" and waiting for the user response to choose Manufacturer in the drop down.</p>
  
  <p>that's why I get the error: Please specify the product's option(s).</p>
  
  <p><strong>My question:</strong> </p>
  
  <p>Is it possible to filter the function <code>getJsonConfig()</code>? 
     let say not include the:</p>
  
  <p>if  ($attributecode != 'manufacturer'){
         do some stuff.....
      }</p>
  
  <p>I copied a local version of this function and now found in: <code>app\code\local\Mage\Catalog\Block\Product\View\Type\Configurable.php</code></p>
  
  <p>Please help...if anyone accomplished this kind of problem.
  I tried extending <code>getJsonConfig()</code> to filter some attribute like "supplier" but to no avail.</p>
  
  <p>Am I doing the right thing?</p>