2

We tried to implement this scenario in ee 1.13: we have a custom product attribute (new_edition_id), when a product is saved, if this attribute is set, we want to create a url rewrite from current product to the product with attribute id equals to new_edition_id. We've implemented it in an observer using this snippet of code:

$rewrite = Mage::getModel('enterprise_urlrewrite/url_rewrite');
      $rewrite->setStoreId($storeId)
        ->setOptions('RP')
        ->setIdentifier($requestPath)
        ->setTargetPath($targetPath)
        ->setRequestPath($requestPath)
        ->setDescritpion('Nuova Edizione plugin')
        ->setProductId($product->getId())
        ->save(); 

The result is that some records are inserted in enterprise url rewrite tables, but from the front end redirections doesn't work. Any suggestion?

Thanks Ruggero

  • Did you tried reindexing after the process? You can also add the reindex to the observer if it works. – mbalparda Feb 6 '15 at 16:55
  • Yes, I tried; I've also disabled Magento Cache – Ruggero Rossi Feb 7 '15 at 18:01

Your Answer

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

Browse other questions tagged or ask your own question.