Skip to content
This repository has been archived by the owner on Mar 9, 2023. It is now read-only.

fix for FilterUrls for sub-sub categories and store code #21

Merged
merged 1 commit into from
Oct 19, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/app/code/community/Flagbit/FilterUrls/Model/Catalog/Layer/Filter/Item.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,16 @@ public function getSpeakingFilterUrl($addOwnValue, $withoutFilter = FALSE, $addi
}
$url = preg_replace('/\?.*/', '', $url);

if($addOwnValue && $this->getFilter()->getRequestVar() == "cat") {
$category_url = Mage::getModel('catalog/category')->load($this->getValue())->getUrl();
$return = $category_url;
unset($query[$this->getFilter()->getRequestVar()]);
$url = str_replace(Mage::getStoreConfig('web/unsecure/base_url'), '', $return);
}

$storeCode = Mage::app()->getStore()->getCode();
$url = preg_replace('!^' . $storeCode . '/!', '', $url);

if (!empty($filterUrlString)) {
$configUrlSuffix = Mage::helper('filterurls')->getUrlSuffix();

Expand Down