[TYPO3-commerce] stay still on productpage after "add basket" action
Christopher Hlubek
hlubek at networkteam.com
Thu Jan 22 14:46:58 CET 2009
Hi Tom,
you don't have to change the commerce core. I wrote a small hook for
tx_commerce_pibase/singleview:
ext_localconf.php:
--------------------------------------------------
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['commerce/lib/class.tx_commerce_pibase.php']['singleview'][]
=
EXT:my_commerce_lib/class.tx_mycommercelib_hook_pi1_singleview.php:tx_mycommercelib_hook_pi1_singleview';
class.tx_mycommercelib_hook_pi1_singleview.php:
--------------------------------------------------
<?
class tx_mycommercelib_hook_pi1_singleview {
function additionalMarker(&$markerArray, $pObj) {
if (!is_array($markerArray)) $markerArray = array();
$markerArray['###CURRENT_URL###'] =
$pObj->pi_linkTP_keepPIvars_url(array(), 1);
return $markerArray;
}
}
?>
I haven't used pi_getPageLink($GLOBALS['TSFE']->id) since I need to stay
on the exact same page (with product and category parameter). I also
haven't overwritten the original marker but introduced a new one.
Greetings,
Christopher
tom schrieb:
> Hi Claudi,
>
> thanks a lot for your tip!
> But this extension would not work for me.
> At first, the extension uses the old marker "STARTFRM" which is
> deprecated. The extension must updated for Commerce version 9.3 and
> above ( $markerArray['ARTICLE_FORMACTION'] =
> $parent->pi_getPageLink($GLOBALS['TSFE']->id);)
>
> But I figure out what I can do that works for me:
> There is a marker GENERAL_FORM_ACTION which has to be changed from
>
> class.tx_commerce_pibase:1659
>
> $NewmarkerArray['GENERAL_FORM_ACTION'] =
> $this->pi_getPageLink($this->conf['basketPid']);
>
> $NewmarkerArray['GENERAL_FORM_ACTION'] =
> $this->pi_getPageLink($GLOBALS['TSFE']->id);
>
> I think there is no hook where I can change the beaviour without
> touching the code...
>
> Best
> Tom
More information about the TYPO3-project-commerce
mailing list