protected function setRelatedCartItem($product, $cartItemId)
    {
        $cartItemIdList = $this->facade->getRequest()->getSession()->get(
            $this->getSessionVarName(),
            array()
        );

        if (! \is_array($cartItemIdList)) {
            $cartItemIdList = array();
        }

        $cartItemIdList[$product->getId()] = $cartItemId;

        $this->facade->getRequest()->getSession()->set(
            $this->getSessionVarName(),
            $cartItemIdList
        );
    }
protected function setRelatedCartItem($product, $cartItemId)
    {
        $cartItemIdList = $this->facade->getRequest()->getSession()->get(
            $this->getSessionVarName(),
            array()
        );

        if (! \is_array($cartItemIdList)) {
            $cartItemIdList = array();
        }

        $cartItemIdList[$product->getId()] = $cartItemId;

        $this->facade->getRequest()->getSession()->set(
            $this->getSessionVarName(),
            $cartItemIdList
        );
    }
protected function setRelatedCartItem ( $ product , $ cartItemId ) { $ cartItemIdList = $ this -> facade -> getRequest ( ) -> getSession ( ) -> get ( $ this -> getSessionVarName ( ) , array ( ) ) ; if ( ! \ is_array ( $ cartItemIdList ) ) { $ cartItemIdList = array ( ) ; } $ cartItemIdList [ $ product -> getId ( ) ] = $ cartItemId ; $ this -> facade -> getRequest ( ) -> getSession ( ) -> set ( $ this -> getSessionVarName ( ) , $ cartItemIdList ) ; }
Set the cart item id which contains the free product related to a given product

@param Product  $product    the product in the cart which triggered the discount
@param bool|int $cartItemId the cart item ID which contains the free product, or just true if the free product is not yet added.
Set the cart item id which contains the free product related to a given product