-
- tweidt

-
Total Posts: 2
Joined: 2011-09-20
|
Hello,
i have a problem, to display the available options from a dropdown attribute in the category-view.
I have a configurable atricle with a dropdown color list. For the product, i add 10 products for the colors red and black.
On the article detail page, the selectbox is visible whit the options red and black.
i want this two options now in the category-view, because, i want filter the procuts with jquery and i need the possible colors.
in my categoryview i show all products, grouped by subcatgories. The code show like this
<?php $_category = $this->getLayer()->getCurrentCategory(); $subs = $_category->getAllChildren(true); $show_parent = false; ?> <?php if (count($subs) == 1 && $subs[0] == $_category->getId()) $show_parent = true; ?> <?php foreach($subs as $cat_id) : if ($cat_id == $_category->getId() && !$show_parent) continue;
$category = new Mage_Catalog_Model_Category(); $category->load($cat_id); ?> <div class="category-item"> <div class="category-headline"> <div class="bg"></div> <div class="label"><h1><?php echo $category->getName();?></h1></div> <div class="clearer"></div> </div> </h1> <div class="products"> <ul> <?php $collection = $category->getProductCollection(); $collection->setOrder('price', 'asc') ; foreach ($collection as $_product) : $product = new Mage_Catalog_Model_Product(); $product->load($_product->getId()); ?> <li class="item" data-price="<?php echo number_format($product->getFinalPrice(), 2) ?>"> <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image"> <img src="<?php echo $this->helper('catalog/image')->init($product, 'small_image')->resize(236); ?>" width="236" height="236" alt="<?php echo $this->stripTags($this->getImageLabel($product, 'small_image'), null, true) ?>" /> </a> <div class="short-description"> <?php echo $product->getName(); ?><br/> <?php echo number_format($product->getFinalPrice(), 2) ?> € </div> <?php ?> </li> <?php endforeach;?> </ul> <div class="clearer"></div> </div> </div> <?php endforeach;?>
I tried
$product->getAttributeText('shirt_color');
but this returned false. its not available.
i tried many other thinks, i founded by google, but the results were in generell, NULL, false or a fatal error. :(
i hope anyone can help.
Greets Tommy
|