0

Using Magmi to upload a CSV to set simple products to be Not Visible Individually.

After clearing Magento Cache and Reindexing, the products still show on the category page however clicking on the simple products give you a 404 page.

Is there anyway to stop these products showing on the category page.

Example of were this happens http://boxchilli.co/s2as/kayaks-1.html

PROTEC ACE WATER HELMET - WHITE at the top isn't ment to show but the PROTEC ACE WATER HELMET - WHITE2 is

Code for list.phtml added below

<?php
    $_productCollection=$this->getLoadedProductCollection();
    $_helper = $this->helper('catalog/output');

?>
<?php if(!$_productCollection->count()): ?>
<p class="note-msg"><?php echo $this->__('There are no products matching the selection.') ?></p>
<!--<script type="text/javascript">
jQuery(window).load(function() {
    jQuery('.page').css('background-image','none');
});
</script>-->
<?php else: ?>
<div class="category-products">
<?php $position = 'top'; ?>
    <?php echo $this->getToolbarHtml($position) ?>
    <?php // List mode ?>
    <?php if($this->getMode()!='grid'): ?>
    <?php $_iterator = 0; ?>
    <ol class="products-list" id="products-list">
    <?php foreach ($_productCollection as $_product): ?>
        <li class="item<?php if( ++$_iterator == sizeof($_productCollection) ): ?> last<?php endif; ?>">
            <?php // Product Image ?>
            <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(130); ?>" width="130" height="130" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" /></a>
            <?php // Product description ?>
            <div class="product-shop">
                <div class="f-fix">
                    <?php $_productNameStripped = $this->stripTags($_product->getName(), null, true); ?>
                    <h2 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $_productNameStripped; ?>"><?php echo $_helper->productAttribute($_product, $_product->getName() , 'name'); ?></a></h2>
                    <?php if($_product->getRatingSummary()): ?>
                    <?php echo $this->getReviewsSummaryHtml($_product) ?>
                    <?php endif; ?>
                    <?php echo $this->getPriceHtml($_product, true) ?>
                    <?php if($_product->isSaleable()): ?>
                        <p><button type="button" title="<?php echo $this->__('BUY NOW') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><span><?php echo $this->__('BUY NOW') ?></span></span></button></p>
                    <?php else: ?>
                        <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
                    <?php endif; ?>
                    <div class="desc std">
                        <?php $shortened = truncateText($_product['description'],250,'.'); ?>
                        <?php 
                        $product_data = $_product->getData();
                        if($_product->getName() == 'Mystic Warrior III (3) Kitesurf Waist Harness 2012 - Black'){print_r($product_data);} 
                        ?>
                        <?php print_r($_product['description']); ?>
                        <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $_productNameStripped ?>" class="link-learn"><?php echo $this->__('Learn More') ?></a>
                    </div>
                    <ul class="add-to-links">
                        <?php if ($this->helper('wishlist')->isAllow()) : ?>
                            <li><a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
                        <?php endif; ?>
                    </ul>
                </div>
            </div>
        </li>
    <?php endforeach; ?>
    </ol>
    <script type="text/javascript">decorateList('products-list', 'none-recursive')</script>

    <?php else: ?>

    <?php // Grid Mode ?>

    <?php $_collectionSize = $_productCollection->count() ?>
    <?php $_columnCount = $this->getColumnCount(); ?>
    <?php $_columnCount = 4; ?>
    <?php $i=0; foreach ($_productCollection as $_product): ?>
        <?php if ($i++%$_columnCount==0): ?>
        <ul class="products-grid">
        <?php endif ?>
            <li class="item<?php if(($i-1)%$_columnCount==0): ?> first<?php elseif($i%$_columnCount==0): ?> last<?php endif; ?>">
                <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(158); ?>" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" /></a>
                <?php $shortened = truncateText($_product->getName(),250,'.'); ?>
                <h2 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($shortened, null, true) ?>"><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></a></h2>
                <?php if($_product->getRatingSummary()): ?>
                <?php echo $this->getReviewsSummaryHtml($_product, 'short') ?>
                <?php endif; ?>
                <?php echo $this->getPriceHtml($_product, true) ?>
                <div class="actions">
                    <?php if($_product->isSaleable()): ?>
                        <button type="button" title="<?php echo $this->__('BUY NOW') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><span><?php echo $this->__('BUY NOW') ?></span></span></button>
                    <?php else: ?>
                        <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
                    <?php endif; ?>
                    <ul class="add-to-links">
                        <?php if ($this->helper('wishlist')->isAllow()) : ?>
                            <li><a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
                        <?php endif; ?>
                    </ul>
                </div>
            </li>
        <?php if ($i%$_columnCount==0 || $i==$_collectionSize): ?>
        </ul>
        <?php endif ?>
        <?php endforeach ?>
        <script type="text/javascript">decorateGeneric($$('ul.products-grid'), ['odd','even','first','last'])</script>
    <?php endif; ?>
    <?php $position = 'bottom'; ?>
    <div class="toolbar-bottom">
        <?php  echo $this->getToolbarBlock()->setTemplate('catalog/product/list/toolbar_bottom.phtml')->toHtml(); ?> 
    </div>
</div>
<?php endif; ?>
lee murphy
  • 134
  • 1
  • 11
  • Make sure it actually says "Not Visible Individually" in the visibility for these products. Also, how are you retrieving the products for this page? Please post the template .phtml you are using to render the product list if it is not the default `base/default/template/catalog/product/list.phtml`. Or at least just how you are pulling the product collection on this page. – Jason Aug 20 '13 at 17:33
  • @Jason Added the code requested in the question, I've also double checked the products in magento and they are set to Not Visible Individually – lee murphy Aug 21 '13 at 08:03

2 Answers2

0

Resolved the issue.

Indexing was erroring without reporting back and nothing on the error log. By doing each reindex one by one it resolved the problem.

lee murphy
  • 134
  • 1
  • 11
  • Glad you got it figured out, commonly if the reindex process succeeds and they still show up it's due to how the collection is called, but I see now you're using the standard `getLoadedProductCollection()` method. Sometimes the products are called using the direct `Mage::getModel( 'catalog/product' )->getCollection()` without adding visibility as a filter, which is why I originally asked to see the template code ;D – Jason Aug 21 '13 at 17:42
0

Make sure the products aren't assigned to a category too. I had the same issue with an inherited site.

Hemogoblin
  • 33
  • 4