문제

can you change subnavigation subcategory urls to SEO friendly? if so how?

ie:

existing = store.com/apparel.html?cat=4

desired = store.com/apparel/shirts.html or anything close to that.

도움이 되었습니까?

해결책

Let me explain first why is this difference. In the first case you are viewing the 'apparel' category and filtering the results buy subcategory with id 4 (probably shirts). In the second case you are viewing the apparel->shirts category directly.

If you have special settings for the apparel category (like different design, different layout or sidebars) you will still be able to see those settings in the first case (?cat=4).

In the second case you will see the settings for the shirts category.

If you still want to use the friendly urls for filtering you can use an extension.
I recommend Manadev Seo Layered Navigation and Amasty improved Navigation Both of them can be configured to behave like you want and even more.

다른 팁

I created a module that solves this error.

https://github.com/jruzafa/Devopensource_LayerCatSeo

Thanks,

This can be fixed quite easily by overriding the getUrl() method in the Mage_Catalog_Model_Layer_Filter_Item class

(Go to /app/code/core/Mage/Catalog/Model/Layer/Filter/Item.php)

Locate the function at line 57, it should look like this:

 public function getUrl()
 {
        $query = array(
        $this->getFilter()->getRequestVar()=>$this->getValue(),
        Mage::getBlockSingleton('page/html_pager')->getPageVarName() => null // exclude current page from urls);
        return Mage::getUrl('*/*/*', array('_current'=>true, '_use_rewrite'=>true, '_query'=>$query));
  }

Change to :

public function getUrl()
{
    if($this->getFilter()->getRequestVar() == "cat"){
        $category_url = Mage::getModel('catalog/category')->load($this->getValue())->getUrl();
        $return = $category_url;
        $request = Mage::getUrl('*/*/*', array('_current'=>true, '_use_rewrite'=>true));
        if(strpos($request,'?') !== false ){
            $query_string = substr($request,strpos($request,'?'));
        }
        else{
            $query_string = '';
        }
        if(!empty($query_string)){
            $return .= $query_string;
        }
        return $return;
    }
    else{
        $query = array(
            $this->getFilter()->getRequestVar()=>$this->getValue(),
            Mage::getBlockSingleton('page/html_pager')->getPageVarName() => null // exclude current page from urls
        );

        return Mage::getUrl('*/*/*', array('_current'=>true, '_use_rewrite'=>true, '_query'=>$query));
    }
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 magento.stackexchange
scroll top