以下は、bigcommerce API経由で製品を入手するために使用されますが、クロスドメインエラーのためステンシル環境内では動作しません...テーマ内でいくつかの形式のAPIコールを動作させる方法はありますか?たぶんapiに相対URLエンドポイントがありますか?bigcommerce APIをステンシルテーマファイルで使用できますか?
私はカタログは、私はあなたがあなたのテーマ/店頭からのAPI呼び出しを行うべきではありません
<script type="text/javascript">
var settings = {
"async": true,
"crossDomain": true,
"url": "https://api.bigcommerce.com/stores/***/v3/catalog/products?include=variants%2Ccustom_fields",
"method": "GET",
"headers": {
"x-auth-client": "d8zpoak96***",
"x-auth-token": "i64oipln27l***",
"cache-control": "no-cache",
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
</script>