MAGENTO - Display sub-category products in root category

前端 未结 5 689
夕颜
夕颜 2021-02-02 10:25

i havent been able to find the answer for this anywhere but i cant seen to display any of the products on the root categories page from its sub category members. When i click th

相关标签:
5条回答
  • 2021-02-02 10:34

    Every category has associated products.
    Just associate these products into the higher-level category too.
    They will show up on frontend in that category.

    0 讨论(0)
  • 2021-02-02 10:54

    First identify the attribute id of the is_anchor attribute:

    SELECT * FROM eav_attribute where attribute_code = 'is_anchor';
    

    we Get attribute id 51 in my database. Now run the following query

    UPDATE catalog_category_entity_int set value = 1 where attribute_id = 51;
    

    replace 51 with your own attribute id. And just rebuild these indexes

    0 讨论(0)
  • 2021-02-02 10:57

    Make sure you set "Is anchor" to "Yes" for your root category.

    0 讨论(0)
  • 2021-02-02 10:59
    <div class="category-grid-new">
        <?php $_columnCount; ?>
            <ul>
                <?php if($i++%$_columnCount==0): ?>
                <?php foreach ($this->getCurrentCategory()->getChildrenCategories() as $_subcat): ?>
                    <li class="item<?php if(($i-1)%$_columnCount==0): ?> first<?php elseif($i%$_columnCount==0):?> last<?php endif; ?>">
                        <a href="<?php echo $_subcat->getUrl() ?>">
                            <div class="category-img"><img src="<?php echo $_category->getImageUrl() ?>" alt="" width="100px" height="100px"/></div>
                            <div class="category-data"><?php echo Mage::helper('catalog/output')->categoryAttribute($_subcat, $_subcat->getName()) ?></div>
                        </a>
                    </li>
            <?php endforeach ?>
            </ul>
        <?php endif; ?>
    </div>
    
    0 讨论(0)
  • 2021-02-02 11:00

    Set anchor as YES and then reindex categories in index management.

    0 讨论(0)
提交回复
热议问题