Приложение BigCommerce Hello World - использование приложения в магазине - PullRequest
0 голосов
/ 07 марта 2019

Я успешно установил приложение Hello World .

Я пытаюсь использовать приложение в витрине магазина. Следуя инструкциям, я добавил код, предоставленный диспетчеру скриптов:

<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: $ is notfined», которую я решил, включая jquery-3.3.1.

Но тогда я получаю ошибку 404 с запросом GET. Я пробовал разные значения для APP_URL , но все равно получаю эту ошибку. Вот запрос GET: https://www.marineff.com/rebates/load/storefront/STORE_HASH/customers/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJjdXN0b21lciI6eyJpZCI6MSwiZW1haWwiOiJqam9yaW9AaG90bWFpbC5jb20iLCJncm91cF9pZCI6IjAifSwiaXNzIjoiYmMvYXBwcyIsInN1YiI6Imt6N3Nma20yZHgiLCJpYXQiOjE1NTE5NDI5NTEsImV4cCI6MTU1MTk0Mzg1MSwidmVyc2lvbiI6MSwiYXVkIjoiNGZocWNvOTBha21qMzI5Z2lmMXY4dzFqdzRqN3FzZyIsImFwcGxpY2F0aW9uX2lkIjoiNGZocWNvOTBha21qMzI5Z2lmMXY4dzFqdzRqN3FzZyIsInN0b3JlX2hhc2giOiJrejdzZmttMmR4Iiwib3BlcmF0aW9uIjoiY3VycmVudF9jdXN0b21lciJ9.i7mguILu_jGue9nO5wZbtG8IhXqFkKuY71fAEsZTe27Tyxfjm4SAhUZUUxNvTbVhADP4Qm9kqY6BjU7I-SDgWA/recently_purchased.html

Есть идеи? Спасибо

...