我正在构建一个应用程序,允许管理员验证对其分析帐户的访问权限以供脱机使用,并将刷新令牌存储在数据库中.
现在,当我尝试在前端使用API时,它返回以下错误:
"Access Token Expired. There wan a general error : The OAuth 2.0 access token has expired, and a refresh token is not available. Refresh tokens are not returned for responses that were auto-approved."
Run Code Online (Sandbox Code Playgroud)
这是我到目前为止生成此错误的代码:
require_once "lib/google/Google_Client.php";
require_once "lib/google/contrib/Google_AnalyticsService.php";
$_analytics = new analytics();
$_googleClient = new Google_Client();
$_googleClient->setClientId($_analytics->gaClientId);
$_googleClient->setClientSecret($_analytics->gaClientSecret);
$_googleClient->setRedirectUri($_analytics->gaRedirectUri);
$_googleClient->setScopes($_analytics->gaScope);
$_googleClient->setAccessType($_analytics->gaAccessType);
// Returns last access token from the database (this works)
$_tokenArray['access_token'] = $_analytics->dbAccessToken($_agencyId);
$_googleClient->setAccessToken(json_encode($_tokenArray));
if($_googleClient->isAccessTokenExpired()) {
// Don't think this is required for Analytics API V3
//$_googleClient->refreshToken($_analytics->dbRefreshToken($_agencyId)); …Run Code Online (Sandbox Code Playgroud) 我可以使用Magento实现以下目标:
我正在使用价格与目的地的表费率系统.我有一个购物车价格规则免费送货的产品属性free_shipping - >设置是.
如果你在篮子里有正常的产品或在篮子里免费送货产品,这种方法很好.但是,如果您同时拥有正常产品和免费送货产品.它根据订单总额计算运费,包括免费送货的产品.
我该如何纠正这个问题,因此当这两种产品都存在于购物篮中时,运费仅适用于不包括免费送货的产品订单总数?
有没有Magento插件吗?提前致谢.
我正在使用Magento CE 1.7.0.2,最近从1.4.2.0升级.在后端编辑/创建客户地址时,国家/地区下拉字段为空白 - 没有可供选择的选项.它也不适用于前端地址下拉列表.
任何想法是什么造成的,我能找到的唯一代码提示是:"this.defaultCountries = [false,false];" 在页面上的JS中,而在新的Magento安装(相同版本,相同的默认国家/地区)上,它显示:this.defaultCountries = ['GB','GB'];