//check
if product is a configurable type or not
if
($cProduct->getData('type_id') == "configurable")
{
//get
the configurable data from the product
$config
= $cProduct->getTypeInstance(true);
//loop
through the attributes
foreach($config->getConfigurableAttributesAsArray($cProduct)
as $attributes)
{
?>
<dl>
<dt><label
class="required"><em>*</em><?php echo
$attributes["label"]; ?></label></dt>
<dd>
<div
class="input-box">
<select
name="super_attribute[<?php echo $attributes['weightnew']
?>]" id="attribute<?php echo $attributes['weightnew']
?>">
<?php
foreach($attributes["values"]
as $values)
{
echo
"<option>".$values["label"]."</option>";
}
?>
</select>
</div>
</dd>
</dl>
<?php
}
}
No comments:
Post a Comment