[TYPO3-commerce] RFC Feature: #28959: New hook in tx_commerce_pibase::makeBasketView()
Benny Schimmer
bschimmer at cross-content.com
Tue Aug 16 09:51:00 CEST 2011
+1 by reading
"Marcus Krause" <marcus#exp2011 at t3sec.info> schrieb im Newsbeitrag
news:mailman.1.1313231165.14512.typo3-team-commerce at lists.typo3.org...
> Hi!
>
>
> This is an SVN patch request.
>
>
> Type: Feature
>
>
> References: http://forge.typo3.org/issues/28959
>
>
> Problem:
> Currently there's no way to modify the rendered markup from
> tx_commerce_pibase::makeBasketView().
>
>
> Solution:
> Add a "post rendering" hook to this method. The parameters handled over
> to a hook implementation allow to completely drop the default rendered
> markup and to make a custom rendering.
>
>
> Notes:
> Due to the amount of arguments, they have been bundled in a parameter
> array (inspired by t3lib_PageRenderer hooks).
>
>
> Regards,
> Marcus.
>
> Index: lib/class.tx_commerce_pibase.php
> ===================================================================
> --- lib/class.tx_commerce_pibase.php (Revision 51043)
> +++ lib/class.tx_commerce_pibase.php (Arbeitskopie)
> @@ -797,7 +797,12 @@
> $content='';
> $template = $this->cObj->getSubpart($this->templateCode, $subpartMarker);
>
> -
> + $hookObjectsArr = array();
> + if (is_array
> ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['commerce/lib/class.tx_commerce_pibase.php']['makeBasketView']))
> {
> + foreach
> ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['commerce/lib/class.tx_commerce_pibase.php']['makeBasketView']
> as $classRef) {
> + $hookObjectsArr[] = &t3lib_div::getUserObj($classRef);
> + }
> + }
>
> if(!is_array($lineTemplate)) {
> $temp = $lineTemplate;
> @@ -855,6 +860,18 @@
> $content =
> $this->cObj->substituteSubpart($template,'###LISTING_ARTICLE###','');
> }
>
> + foreach($hookObjectsArr as $hookObj) {
> + if (method_exists($hookObj, 'postBasketView')) {
> + $params = array(
> + 'basketObj' => &$basketObj,
> + 'articletypes' => $articletypes,
> + 'lineTemplate' => $lineTemplate,
> + 'template' => $template,
> + );
> + $content = $hookObj->postBasketView($content, $params, $this);
> + }
> + }
> +
> $content = $this->cObj->substituteSubpart(
> $content,
> '###LISTING_BASKET_WEB###',
>
More information about the TYPO3-team-commerce
mailing list