public function getReference($client = false)
    {
        if (empty($this->reference)) {

            $reference = $this->createReference();

            if ($client) {
                if (isset($_COOKIE[$client->getCookieCartName()])) {
                    $reference = $_COOKIE[$client->getCookieCartName()];
                } else {
                    setcookie($client->getCookieCartName(), $reference, strtotime($client->getCookieLifetime()), '/');
                }
            }
            $this->setReference($reference);
        }

        return $this->reference;
    }
public function getReference($client = false)
    {
        if (empty($this->reference)) {

            $reference = $this->createReference();

            if ($client) {
                if (isset($_COOKIE[$client->getCookieCartName()])) {
                    $reference = $_COOKIE[$client->getCookieCartName()];
                } else {
                    setcookie($client->getCookieCartName(), $reference, strtotime($client->getCookieLifetime()), '/');
                }
            }
            $this->setReference($reference);
        }

        return $this->reference;
    }
public function getReference ( $ client = false ) { if ( empty ( $ this -> reference ) ) { $ reference = $ this -> createReference ( ) ; if ( $ client ) { if ( isset ( $ _COOKIE [ $ client -> getCookieCartName ( ) ] ) ) { $ reference = $ _COOKIE [ $ client -> getCookieCartName ( ) ] ; } else { setcookie ( $ client -> getCookieCartName ( ) , $ reference , strtotime ( $ client -> getCookieLifetime ( ) ) , '/' ) ; } } $ this -> setReference ( $ reference ) ; } return $ this -> reference ; }
Get the cart reference
If it isn't set or does not exist in storage, we will create a new one and add it

@return string
Get the cart reference If it isn t set or does not exist in storage we will create a new one and add it