我成功安装了Hello World app。
我正在尝试在店面中使用该应用程序。 按照说明,我将提供的代码添加到脚本管理器中:
<script>
var appClientId = "**BC_CLIENT_ID**"; // TODO: Fill this in with your app's client ID.
var storeHash = "**TEST_STORE_HASH**"; // TODO: Fill this in wit the test store's store hash (found in base url before the `store-` part)
var appUrl = "**APP_URL**"; // TODO: Replace this with the URL to your app.
// Get the JWT token from the BC server signed first.
$.get('/customer/current.jwt?app_client_id=' + appClientId, function(jwtToken) {
// Now that we have the JWT token, use it to get the recent purchases block.
$.get(appUrl + '/storefront/' + storeHash + '/customers/' + jwtToken + '/recently_purchased.html', function(htmlContent) {
$('#recent_purchases_block').html(htmlContent, true);
});
});
</script>
我首先遇到了“ Uncaught ReferenceError:未定义$”错误,我解决了该错误,包括jquery-3.3.1。
有什么主意吗? 谢谢