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

Commit

Permalink
Expanded event definitions for urlbuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
Edwin Jacobs committed Sep 3, 2019
1 parent 489e0cc commit e56f4ce
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions app/code/community/Emico/Tweakwise/Model/UrlBuilder/UrlBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,16 @@ public function buildUrl(Emico_Tweakwise_Model_Bus_Type_Facet $facet = null, Emi
$url = $strategy->buildUrl($state, $facet, $attribute);
if ($url !== null) {
$url = new Varien_Object(['url' => $url]);
Mage::dispatchEvent('tweakwise_urlbuilder_buildurl', ['strategy' => $strategy, 'url' => $url]);
Mage::dispatchEvent(
'tweakwise_urlbuilder_buildurl',
[
'url' => $url,
'state' => $state,
'facet' => $facet,
'attribute' => $attribute,
'strategy' => $strategy
]
);
return $url->getData('url');
}
}
Expand Down Expand Up @@ -54,6 +63,10 @@ public function getClearUrl()
return Mage::getUrl('*/*/*', $params) . '#no-ajax';
}

/**
* @return mixed
* @throws Emico_Tweakwise_Model_Exception
*/
public function buildCanonicalUrl()
{
/** @var Emico_Tweakwise_Helper_UriStrategy $helper */
Expand All @@ -64,7 +77,14 @@ public function buildCanonicalUrl()
$url = $strategy->buildCanonicalUrl($state);
if ($url !== null) {
$url = new Varien_Object(['url' => $url]);
Mage::dispatchEvent('tweakwise_urlbuilder_buildurl', ['strategy' => $strategy, 'url' => $url]);
Mage::dispatchEvent(
'tweakwise_urlbuilder_build_canonical_url',
[
'url' => $url,
'state' => $state,
'strategy' => $strategy
]
);
return $url->getData('url');
}
}
Expand Down

0 comments on commit e56f4ce

Please sign in to comment.