BigCommerce Stencil Start - bigcommerce

After initializing Stencil, I get the following error when I want to start Stencil:
The BigCommerce Store you are pointing to either does not exist or is not available at this time.
The store URL, usr, and pass are correct. The port is available.
Don't know what to do now.

Related

Spartacus: Wrong currency code in cart API parameters

We have implemented multisite configuration recently, but facing an issue after it.
When we have it configured (in both mode - Static/Dynamic configuration), we are getting error in cart API when refreshing the page. After analyzing it we found that it is happening due to wrong site context parameter(currency code) and it is happening only in case of non SSR build, when we use SSR it works fine. In case of normal build, it is adding “USD” as currency code in API call with dynamic site binding and if we are using static binding then it is picking the first currency code even if we are on secondary website. Spartacus framework is picking it from default list of currency codes when hitting cart API on page refresh.
Spartacus version:2.0
Screenshot
Error message
Please share a solution on this.
You can add currency in static configuration (e.g. adding currency: ['JPY'], inside context, currency will be JPY).
If your multiple sites using different "currency" (e.g. one site uses "USD" and the other one uses "JPY"), then you cannot use static configuration. Dynamic configuration loads all base sites data, and get the default currency from each site (the value is: the defaultCurrency of the first store in the site). So, you need make sure the site data is set correctly in backend.

How to use metafield value in Shopify APP

I have created metafield using API. Currently accessing those Metafield in shopify cart.liquid like given below -
{{shop.metafields.AnnexCloud.access_token}}
Getting correct value using above syntax.
But when I try to access Metafield through above syntax in APP files facing issue.
I am creating new shopify public APP using python. In that want access metafield using
{{shop.metafields.AnnexCloud.access_token}}
So, please help me out.
Thanks
I'm not 100% sure what you mean about accessing that metafield through your app - there are lots of places where you might be trying to use that value, so I'll try to cover a few of the bases here.
If you're trying to access the metafield in your Python code
Your app is not running on Shopify's servers and doesn't have any native concept of Liquid code. However, since your app is running on your servers with access to whatever database you've used to store the data you need, you shouldn't need to access this metafield - you should have all the information you need already saved.
That said, if your app's requirements have put you in a position where you need to read that live from the store, you can use your app's credentials to access [the-store-domain.myshopify.com]/admin/metafields.json to get metafield information into your app. You can refine your request as well - for example, [the-store-domain.myshopify.com]/admin/metafields.json?namespace=atuls-app would only return metafields where the namespace was atuls-app.
If you're trying to access the metafield in your app's front-end code
You unfortunately won't be able to put the liquid drop into any file inside of the store's /assets folder (if you're writing any files there), nor will you be able to put any Liquid inside of any assets your app loads through the content_for_header.
For the latter case, though, the scripts loaded through content_for_header would be coming from your server, so you could use any of the methods listed above to get that value injected into the script file through your server's code/logic.
For the former case, where you are adding a file to the /assets folder of a Shopify theme, you would only have access to a very limited number of Liquid variables (and unfortunately shop isn't one of them). To get around this, you would need your app's install to add a script tag to the layouts/theme.liquid file to save a global variable with the contents of your metafield. Any other scripts would then be able to access that global variable. (Note: this method comes with all the normal caveats/considerations about using global variables for things)
Hope this helps!

Vue history mode for non SPA

I'm working on a semi-SPA VUE- page.
By semi-SPA i mean that just a few parts of the page are SPA:s (using routing).
The problem is that it generates a #-sign in the URL and the customer really doesn't like that.
To get rid of it you can use history mode but from what I can find it's only possible in a "pure" SPA-solution since it need to point back to a starting point if it doesn't find the specific route.
Is it possible to remove the #-sign from the URL in this scenario?

Trying to create a GET request to pubgtracker

I am trying to practice my developing and wanna build my own desktop application using: https://pubgtracker.com/site-api
Before I even start the project I want to make sure that I manage to receive information from the PUBG api. Therefore I opened https://www.hurl.it/
and I try to enter the following:
GET request, and in the destination https://api.pubgtracker.com/v2/profile/pc/{pubg-nickname} (for example lucifini1 currently ranked #1)
In addition they request the API key as a header so I did the following:
+ ADD HEADER,
In the name field added TRN-Api-Key
and in the value I added my key.
When I launch request i get an: internal server error.
How can I debug it and know what I am missing?
Am I doing it correctly?
Thanks

How can I get store id in the bigcommerce theme?

I need the store id for an external js script that will be put in the theme's header and try to find the store based on this id (on our side).
If just trying to grab it manually, you can find it by logging in to the store. The URL will be https://store-XXXXXX.mybigcommerce.com/admin. XXXXXX is the store ID.
If trying to get it via the API, you will want to use the Store resource (https://developer.bigcommerce.com/api/stores/v2/store_information).
I am not aware of any supported way how to get Store ID.
Unsupported way (which theoretically can break anytime, but I believe it should work for quite long time) is to get it in Javascript from Fornax.configuration.defaultEventProperties.storeId variable.