1

On a multi-site setup, I need to remove the parent category path from the child category URLs, but to do it for only 1 of the storeIDs.

The solution by Anshu Mishra linked below works, but it removes the paths from every store. I require it to only remove the paths from 1 store.

Remove parent categories from subcategory URLs

Is this possible?

2

For achieve ,need some customization at class Mage_Catalog_Model_Url at function getCategoryRequestPath()

On this function,you can get store id from $storeId = $category->getStoreId();

Change:

   if (null === $parentPath) {
        $parentPath = $this->getResource()->getCategoryParentPath($category);
    }
    elseif ($parentPath == '/') {
        $parentPath = '';
    }

to

/* Store id is not match Your certain store id   then do default */
if($storeId!='YOU_Store_id' ):
if (null === $parentPath) {
        $parentPath = $this->getResource()->getCategoryParentPath($category);
    }
    elseif ($parentPath == '/') {
        $parentPath = '';
}
endif;

Note: You need to rewrite class that class as good quality code and change code at this function

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.