I have disable product in back end then product is redirect to here parent category. I clearly say product is not and deleted only disable product can redirect to here parent category.

  • Your problem is not very clear. What is it exactly that you are trying to accomplish? Can you try explain in steps? – Niels Dec 27 '17 at 9:05
  • Ya sure i have explain you, first of all i have going at back end and goto catalog > product and open the 1product,after that i have disable this product and clear the cache after that i have move on front end and search this product that time product not redirect to 404 error page,but this product can redirect to his parent category.do you understand? – meet Dec 27 '17 at 9:30

You can do this using an Observer.

Use an observer to watch the event controller_action_predispatch_catalog_product_view. You can check if product has status Disabled and redirect to the last category.

More info and a code example here: http://evgv.github.io/magento/redirect/categories/product/observer/2016/04/27/redirect-from-disabled-product-to-last-product-category.html

| 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.