Skip to content
This repository has been archived by the owner on Oct 19, 2022. It is now read-only.

Fix problem with magento ordering on #52

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,24 @@ public function buildUrl(Emico_Tweakwise_Model_Catalog_Layer $state, Emico_Tweak
// Add the attribute filters to the URL path
$url .= '/' . $this->buildAttributeUriPath($state, $facet, $attribute);

// Make sorter work
$url = $this->addSorterParam($url);

return $url;
}

protected function addSorterParam($url)
{
$direction = Mage::app()->getRequest()->getParam('dir');
$order = Mage::app()->getRequest()->getParam('order');
$helper = Mage::helper('core');
if ($direction && $order) {
$url .= '?dir=' . urlencode($helper->stripTags($direction)) . '&order=' . urlencode($helper->stripTags($order));
}

return $url;
}

/**
* @param Emico_Tweakwise_Model_Catalog_Layer $state
* @param Emico_Tweakwise_Model_Bus_Type_Facet $facet
Expand Down Expand Up @@ -369,4 +384,4 @@ protected function buildIndexableAttributePath(Emico_Tweakwise_Model_Catalog_Lay

return $this->getPathFromSlugs($slugs, $state);
}
}
}