I need to the something very similar to this but I can't get it to work.
I hope get some answers from the wise guys out her.
I need to get a attribute collection of the current category for example.
I have 4 custom attributes (images) that I would like to use for category slider
<?php $category = Mage::getSingleton('catalog/layer')->getCurrentCategory();
$categories =$category->getCollection()
->addAttributeToSelect(array('sliderimg1','sliderimg2','sliderimg3','sliderimg4'))
->addAttributeToFilter('is_active', 1)
->addIdFilter($category->getChildren())
->addAttributeToSort('position', ASC);?>
with this code I can get the attributes to show but, how can I add it to my slider?
please help.
I tried
<div id="capabilities" class="detail detail--capabilities">
<div class="gallery" data-flickity='{ "imagesLoaded": true, "wrapAround": true, "autoPlay": 10000}'>
<?php foreach ($categories as $category): ?>
<div class="gallery-row gallery-one-column">
<div class="gallery-item gallery-item--features gallery-item--left">
<div class="gallery-image"><img class="imgl" style="width:100%; height:100%; object-fit: cover; object-position: 69% 37%;" src="<?php echo Mage::getBaseUrl('media') . 'catalog' . '/' . 'category' . '/' . $category->getSliderimg1() ?>"></div>
<div class="gallery-features">
<p class="hro1"><i> <?php echo $category->getName() ?></i></p>
<h1 class="hro"><?php echo $category->getF_title1() ?></h1>
<!--<p><?php echo $category->getF_desc1() ?><p/>-->
<div class="hromsrp"><p>MSRP <span><strong><?php echo $category->getMsrp() ?></strong></span></p></div>
<button type="button" class="btn btn1 menu-btn-brp-default" onClick="location.href='<?php echo $category->getUrl(); ?>'">VIEW DETAILS <span class="glyphicon glyphicon-chevron-down"></span></button>
</div>
</div>
</div>
<?php endforeach; ?>
</div>
This gets the attribute image for each category...
but I need to create a slider for each category how can I get the other 3 attributes
(sliderimg2,sliderimg3,sliderimg4 ) in to my category slider for the current category only.