protected static function build_url($action, $buyable, $params = [])
    {
        if (!$action || !$buyable) {
            return false;
        }

        if (SecurityToken::is_enabled() && !self::config()->disable_security_token) {
            $params[SecurityToken::inst()->getName()] = SecurityToken::inst()->getValue();
        }

        $className = get_class($buyable);

        $link = Controller::join_links(
            [
            self::config()->url_segment,
            $action,
            ShopTools::sanitiseClassName($className),
            $buyable->ID
            ]
        );

        return empty($params) ? $link : $link . '?' . http_build_query($params);
    }
protected static function build_url($action, $buyable, $params = [])
    {
        if (!$action || !$buyable) {
            return false;
        }

        if (SecurityToken::is_enabled() && !self::config()->disable_security_token) {
            $params[SecurityToken::inst()->getName()] = SecurityToken::inst()->getValue();
        }

        $className = get_class($buyable);

        $link = Controller::join_links(
            [
            self::config()->url_segment,
            $action,
            ShopTools::sanitiseClassName($className),
            $buyable->ID
            ]
        );

        return empty($params) ? $link : $link . '?' . http_build_query($params);
    }
protected static function build_url ( $ action , $ buyable , $ params = [ ] ) { if ( ! $ action || ! $ buyable ) { return false ; } if ( SecurityToken :: is_enabled ( ) && ! self :: config ( ) -> disable_security_token ) { $ params [ SecurityToken :: inst ( ) -> getName ( ) ] = SecurityToken :: inst ( ) -> getValue ( ) ; } $ className = get_class ( $ buyable ) ; $ link = Controller :: join_links ( [ self :: config ( ) -> url_segment , $ action , ShopTools :: sanitiseClassName ( $ className ) , $ buyable -> ID ] ) ; return empty ( $ params ) ? $ link : $ link . '?' . http_build_query ( $ params ) ; }
Helper for creating a url
Helper for creating a url