src/ShopBundle/objects/db/TShopArticle.class.php
public function GetToBasketLink($bIncludePortalLink = false, $bRedirectToBasket = false, $bReplaceBasketContents = false, $bGetAjaxParameter = false, $sMessageConsumer = MTShopBasketCore::MSG_CONSUMER_NAME_MINIBASKET)
    {
        $sLink = '';
        $aParameters = $this->GetToBasketLinkParameters($bRedirectToBasket, $bReplaceBasketContents, $bGetAjaxParameter, $sMessageConsumer);
        // convert module_fnc to array to string
        $aIncludeParams = TdbShop::GetURLPageStateParameters();
        $oGlobal = TGlobal::instance();
        foreach ($aIncludeParams as $sKeyName) {
            if ($oGlobal->UserDataExists($sKeyName) && !array_key_exists($sKeyName, $aParameters)) {
                $aParameters[$sKeyName] = $oGlobal->GetUserData($sKeyName);
            }
        }

        return $this->generateLinkForToBasketParameters($aParameters, $bIncludePortalLink);
    }
public function GetToBasketLink($bIncludePortalLink = false, $bRedirectToBasket = false, $bReplaceBasketContents = false, $bGetAjaxParameter = false, $sMessageConsumer = MTShopBasketCore::MSG_CONSUMER_NAME_MINIBASKET)
    {
        $sLink = '';
        $aParameters = $this->GetToBasketLinkParameters($bRedirectToBasket, $bReplaceBasketContents, $bGetAjaxParameter, $sMessageConsumer);
        // convert module_fnc to array to string
        $aIncludeParams = TdbShop::GetURLPageStateParameters();
        $oGlobal = TGlobal::instance();
        foreach ($aIncludeParams as $sKeyName) {
            if ($oGlobal->UserDataExists($sKeyName) && !array_key_exists($sKeyName, $aParameters)) {
                $aParameters[$sKeyName] = $oGlobal->GetUserData($sKeyName);
            }
        }

        return $this->generateLinkForToBasketParameters($aParameters, $bIncludePortalLink);
    }
public function GetToBasketLink ( $ bIncludePortalLink = false , $ bRedirectToBasket = false , $ bReplaceBasketContents = false , $ bGetAjaxParameter = false , $ sMessageConsumer = MTShopBasketCore :: MSG_CONSUMER_NAME_MINIBASKET ) { $ sLink = '' ; $ aParameters = $ this -> GetToBasketLinkParameters ( $ bRedirectToBasket , $ bReplaceBasketContents , $ bGetAjaxParameter , $ sMessageConsumer ) ; // convert module_fnc to array to string $ aIncludeParams = TdbShop :: GetURLPageStateParameters ( ) ; $ oGlobal = TGlobal :: instance ( ) ; foreach ( $ aIncludeParams as $ sKeyName ) { if ( $ oGlobal -> UserDataExists ( $ sKeyName ) && ! array_key_exists ( $ sKeyName , $ aParameters ) ) { $ aParameters [ $ sKeyName ] = $ oGlobal -> GetUserData ( $ sKeyName ) ; } } return $ this -> generateLinkForToBasketParameters ( $ aParameters , $ bIncludePortalLink ) ; }
generates a link that can be used to add this product to the basket.

@param bool   $bIncludePortalLink     - include domain in link
@param bool   $bRedirectToBasket      - redirect to basket page after adding product
@param bool   $bReplaceBasketContents - set to true if you want the contents of the basket to be replaced by the product wenn added to basket
@param bool   $bGetAjaxParameter      - set to true if you want to get basket link for ajax call
@param string $sMessageConsumer       - set custom message consumer

@return string
generates a link that can be used to add this product to the basket .