3

I have some products I want to delete from my website. It means I don't want them in catalog nor in search results.

In the same time I don't want 404 error page for these url products. Best solution for me would be: set stock availability to "No longer available" and set visibility "show only individually".

Is possible to achieve similar result?

4

If you set the product to "catalog only", but remove all of it's categorisations, then the product will still be available (i.e. /product-one/) - and then just set it's stock options/layout to have a discontinued message.

|improve this answer|||||
2

For anybody who doesn't know how to add discontinued message for product.

I created attribute Yes/no called discontinued with Visible on Product View Page on Front-end

In template/catalog/product/view.phtml I changed line around Out of stock message.

It might not be the greatest solution but it works. Thanks Douglas Radburn for idea.

            <?php if($_product->getData('discontinued')==1): ?>
                <p class="availability out-of-stock"><span><?php echo $this->__('No longer available') ?></span></p>
        <?php else: ?>

        <?php if ($this->displayProductStockStatus()): ?>
            <?php if ($_product->isAvailable()): ?>
                <?php else: ?>
                <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>

            <?php endif; ?>
        <?php endif; ?> 
    <?php endif; ?> 

And if you don't want to show prices.. You can replace lines in view.phtml for these lines which doesn't show price if 0.

<?php if($_product->price==0): ?>
<?php else: ?>
            <?php echo $this->getChildHtml('product_type_data') ?>
            <?php echo $this->getTierPriceHtml() ?>
<?php endif; ?>

EDIT: And if you don't want to delete all categories which items belong, just find in template/catalog/product/list.phtml

<li class="item<?php if( ++$_iterator == sizeof($_productCollection) ): ?> last<?php endif; ?><?php if ($_product->isSaleable()): ?><?php else: ?> sold-out<?php endif; ?>">

and add before

<?php if($_product->getData('discontinued')==1): ?><?php else: ?>

and after add <?php endif; ?> so it will looks like this

<?php if($_product->getData('skonceno')==1): ?>
<?php else: ?>
  <li class="item<?php if( ++$_iterator == sizeof($_productCollection) ): ?> last<?php endif; ?><?php if ($_product->isSaleable()): ?><?php else: ?> sold-out<?php endif; ?>">
.
.
.
  </li>
<?php endif; ?>
|improve this answer|||||
1

You should use the Url rewrite management in Catalog menu. I think this is the best solution to permanently delete the products from your catalog and redirect the user to an alternative product. Also, it improves SEO, because search engine will update those urls with the new ones.

|improve this answer|||||
1

what i will do. if i want to delete product from magento without 404. then i just delete product from magento backend and set redirect in .htaccess to where i want ( any alternative product )

because i don't want if product is not available or not for sale user visit that product ( its wastage of time user load magento then nothing happen ) i don't want to waste user time ( some time user left if product not available ) its better to redirect user to other alternative product.

better redirect user from .htaccess without loading magento ( means if we redirect user from core url or from observer then we load magento then redirect then on target alternative product again load magento i.e. two time load magento waste time which is not visitor friendly ).

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.