I would like to generate url keys with '/' of products. I have override the \Enterprise_Catalog_Model_Product_Attribute_Backend_Urlkey::beforeSave method and generated url key as per requirement.
My before save method is :
public function beforeSave($object)
 {
 $attributeName = $this->getAttribute()->getName();
 if ($object->getIsDuplicate()) {
 $object = $this->_generateNextUrlKeySuffix($object);
 }
 $brandLong = $object->getData('brand_long');
 $collection = $object->getData('collection');
 $urlKey = $object->formatUrlKey($brandLong).'/'.$object->formatUrlKey($collection).'/'.$object->formatUrlKey($object->getData('sku'));
 if (empty($urlKey)) {
 $object->setData($attributeName, $object->formatUrlKey($object->getName()));
 $object = $this->_generateNextUrlKeySuffix($object);
 } elseif (!empty($urlKey) && !$object->getIsDuplicate()) {
 $object->setData($attributeName, $urlKey);
 }
 $this->_validateEntityUrl($object);
 return $this;
 }
But generated url keys redirecting to 404.Url key is as below
attribute1-value/attribute2/sku
It redirecting to 404
- 
 Please try this magento.stackexchange.com/questions/244801/…1990rk4– 1990rk42018年10月09日 10:00:32 +00:00Commented Oct 9, 2018 at 10:00
 
1 Answer 1
Perhaps you can reference something such as this: https://github.com/Flagbit/Magento-FilterUrls
Explore related questions
See similar questions with these tags.