0
以下是用于通过bigcommerce api获取产品,但由于跨域错误而无法在模板环境中工作......有没有办法在主题内使某种形式的api调用工作?也许有相对的API端点的API?可以在模板主题文件中使用bigcommerce 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>