For my store I want to create the situation where children of Configurable Products that are set to 'Not Visible Individually' are accessable anyway, when the direct URL is provided. Currently it returns a 404-error.
The purpose of this is, so we can only load the direct URLs in Google Shopping using Product Feeds, but not display the products in either Search or Catalog on the site.
I have no idea where to start. Can anyone help me out?
Update:
Using Marius' code from [another question](httphttps://magento.stackexchange.com/questions/104492/how-redirect-simple-products-of-configurable-product?rq=1) I created a module with the following code in /Namespace/Modulename/Model/Observer.php<?php
class Namespace_Modulename_Model_Observer {
public function redirectToUrl($observer) {
$id = Mage::app()->getRequest()->getParam('id');
$_product = Mage::getModel('catalog/product')->load($id);
$urlKey = $_product->getProductUrl($id);
if (isset($urlKey)) {
Mage::app()->getResponse()->setRedirect($urlKey, 301);
Mage::app()->getResponse()->sendResponse();
exit;
}
return $this;
}
} ?>
This (obviously) sends the server in a loop, as I'm trying to send it to the simple product's page and Magento is trying to send it back to 404.
I think I'm very close to a solution, because all that needs to be done now (I think) is a way to overwrite Magento's default behavior of sending it to 404.
Any ideas?
Update #2
It's starting to seem that what I want is impossible and I can't find anything on the internet that can help me out.