Note that there are some explanatory texts on larger screens.

plurals
  1. POMagento- How do I echo selected product attribute (color)
    primarykey
    data
    text
    <p>I am running magento 1.4+.</p> <p>On the product view page, using a configurable product, How can I get the selected attribute to echo it's title.</p> <p>For example - I have color thumbnails and when you click it updates my dropdown, too. I would like to just echo text onclick, instead of changing the dropdown. Any tips? here is my 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="product-options-block"&gt; &lt;?php foreach($_attributes as $_attribute): ?&gt; &lt;dt&gt;&lt;label class="required"&gt;&lt;?php echo $_attribute-&gt;getLabel() ?&gt; &lt;em&gt;*&lt;/em&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 &lt;?php if($this-&gt;showIcons()):?&gt;style=""&lt;?php endif;?&gt; 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 style="clear:both;"&gt;&lt;/div&gt; &lt;/div&gt; &lt;/dd&gt; &lt;?php endforeach; ?&gt; &lt;/dl&gt; &lt;script type="text/javascript"&gt; var spConfig = new Product.Config(&lt;?php echo $this-&gt;getJsonConfig() ?&gt;, '', optionsPrice, &lt;?php echo $this-&gt;showIcons() ?&gt;, '&lt;?php echo $this-&gt;getIconsDir() ?&gt;', '&lt;?php echo $this-&gt;getIconExt() ?&gt;', &lt;?php echo $this-&gt;reloadeImage() ?&gt;); &lt;/script&gt; &lt;?php endif;?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload