Skip to content

Commit

Permalink
Merge branch 'main' into DEVDOCS-5575-categories
Browse files Browse the repository at this point in the history
  • Loading branch information
Sarah Riehl committed Jan 14, 2024
2 parents 8ff9599 + 5a7ed86 commit bbd5ff4
Show file tree
Hide file tree
Showing 13 changed files with 180 additions and 234 deletions.
8 changes: 1 addition & 7 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@ on:
branches:
- main
workflow_dispatch:
inputs:
buildWithCache:
description: 'Build with cache'
default: true
required: false
type: boolean

jobs:
build:
Expand All @@ -22,4 +16,4 @@ jobs:

- name: Trigger Vercel Deploy Hook
run: |
curl -X POST ${{ secrets.VERCEL_DEPLOY_HOOK_URL }}?buildCache=${{ inputs.buildWithCache }}
curl -X POST ${{ secrets.VERCEL_DEPLOY_HOOK_URL }}?buildCache=false
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The following is a set of guidelines for contributing to BigCommerce's Developer

The easiest way to edit a file is using GitHub's web interface:

1. Navigate to the file in GitHub. For example, [making-requests.md](https://github.com/bigcommerce/dev-docs/blob/main/docs/api-docs/getting-started/making-requests.mdx).
1. Navigate to the file in GitHub. For example, [store-logs.mdx](https://github.com/bigcommerce/docs/blob/main/docs/api-docs/store-logs/store-logs.mdx).

2. Click the **pencil** icon to **Edit This File**.
3. Make the edit.
Expand All @@ -32,15 +32,15 @@ That's it! You're done.

For more complex changes, fork and edit locally:

1. Fork `bigcommerce/dev-docs`.
1. Fork `bigcommerce/docs`.

2. `git clone` the fork to your local machine.

3. Make edits on a new branch in your IDE of choice.

4. Commit and push changes to your remote repo.

5. Create a [pull request](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork) to `bigcommerce:dev-docs/main`.
5. Create a [pull request](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork) to `bigcommerce:docs/main`.


## Commit Messages
Expand Down
110 changes: 54 additions & 56 deletions docs/api-docs/cart-and-checkout/embedded-checkout-tutorial.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,83 +27,81 @@ For more information, see [OAuth Scopes](/docs/start/authentication/api-accounts

## Creating a channel

To allow an external website to serve the BigCommerce checkout, create a new channel by sending a `POST` request to the `/channels` endpoint.

**`POST`** `https://api.bigcommerce.com/stores/{{store_hash}}/v3/channels`

**Create a Channel POST request**

```json showLineNumbers copy
{
"type": "storefront",
"platform": "custom",
"name": "https://{your-site}.com"
}
```

The response will contain an `id` which we will use as the `channel_id` in future requests.

**Create Channel response**

```json showLineNumbers copy

{
"data": {
To allow an external website to serve the BigCommerce checkout, create a new channel by sending a request to the [Create a channel](/docs/rest-management/channels#create-a-channel) endpoint. A successful response contains an `id` that you can use as the `channel_id` in future requests.

<Tabs items={['Request', 'Response']}>
<Tab>
```http filename="Request: Create a channel" showLineNumbers copy
POST https://api.bigcommerce.com/stores/{{store_hash}}/v3/channels
X-Auth-Token: {{access_token}}
Accept: application/json
Content-Type: application/json
{
"type": "storefront",
"platform": "custom",
"name": "My Custom Store"
}
```
</Tab>
<Tab>
```json filename="Response: Create a channel" showLineNumbers copy
{
"data": {
"id": 20266,
"name": "https://www.{your-site}.com",
"name": "My Custom Store",
"platform": "custom",
"type": "storefront",
"date_created": "2019-09-18T22:28:36Z",
"date_modified": "2019-09-18T22:28:36Z",
"external_id": "",
"is_enabled": true
},
"meta": {}
}
```
},
"meta": {}
}
```
</Tab>
</Tabs>

<Callout type="info">
Channels created via API are visible in the BigCommerce store's Control Panel in **Products** > **Listed On**. The Orders section will now also include a filter for your channel.
Channels created by API are visible in the store control panel's [channel manager](https://login.bigcommerce.com/deep-links/manage/channel-manager). You can also use the [advanced search feature on the products view page](https://login.bigcommerce.com/deep-links/manage/products/search), [sort customers by channel](https://login.bigcommerce.com/deep-links/manage/customers?limit=20&page=1&sortField=channel), and [create custom views of orders](https://login.bigcommerce.com/deep-links/manage/orders/create-view) to group or filter those entities by channel.
</Callout>



## Creating a site

Next, create a site for the channel by sending a `POST` request to the `/channels/id/site` endpoint.

**`POST`** `https://api.bigcommerce.com/stores/{{store_hash}}/v3/channels/{{channel_id}}/site`

**Create Site POST**

```js showLineNumbers copy
{
"channel_id": 20266,
"url": "https://www.{your-site}.com"
}
```

This returns `id` which you will use as the `site_id` in future requests. The `url` value is the base path for all other routes you define for the site.

**Create Site response**
Next, create a site for the channel by sending a request to the [Create a channel site](/docs/rest-management/channels/channel-site#create-a-channel-site) endpoint. This returns an `id` that you can use as the `site_id` in future requests. The `url` value is the base path for all other routes you define for the site.

```js showLineNumbers copy
{
<Tabs items={['Request', 'Response']}>
<Tab>
```http filename="Request: Create a site" showLineNumbers copy
POST https://api.bigcommerce.com/stores/{{store_hash}}/v3/channels/{{channel_id}}/site
X-Auth-Token: {{access_token}}
Accept: application/json
Content-Type: application/json
{
"data": {
"channel_id": 20266,
"url": "https://store.example.com"
}
```
</Tab>
<Tab>
```json filename="Response: Create a site" showLineNumbers copy
{
"data": {
"id": 6,
"url": "https://www.{your-site}.com",
"url": "https://store.example.com",
"channel_id": 20266,
"created_at": "2019-09-19T17:08:44Z",
"updated_at": "2019-09-19T17:08:44Z"
},
"meta": {}
},
"meta": {}
}
}
```
```
</Tab>
</Tabs>

## Creating a cart

To proceed to checkout, we'll need an active cart. To create one, send a request to the REST Management API's [Create a cart](/docs/rest-management/carts) endpoint.
To proceed to checkout, you need an active cart. To create one, send a request to the REST Management API's [Create a cart](/docs/rest-management/carts) endpoint.


```http filename="Example request: Create a cart" showLineNumbers copy
Expand Down Expand Up @@ -174,7 +172,7 @@ You will first need to use JSON Web Token Standard to create a new token. Use a

Next, include the `embedded_checkout_url` as part of the request payload you send to BigCommerce.

```json filename="Example Customer Login JWT payload" showLineNumbers copy
```js filename="Example Customer Login JWT payload" showLineNumbers copy
{
"iss": {{client_id}},
"iat": 1535393113,
Expand Down
16 changes: 6 additions & 10 deletions docs/stencil-docs/installing-stencil-cli/installing-stencil.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ This article contains detailed instructions on installing and configuring Stenci
To install Stencil CLI and its dependencies on Mac, open a terminal and run the following commands. Refer to [Stencil CLI README.MD](https://github.com/bigcommerce/stencil-cli) for latest `node` version supported.


<Callout type="info">
These instructions have been tested on **Mac OS X Yosemite**.
</Callout>

```shell showLineNumbers copy
# For ARM based macs
arch -x86_64 /bin/zsh
Expand All @@ -30,10 +26,10 @@ arch -x86_64 /bin/zsh
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash

# Install Stencil CLI supported version of Node.js
nvm install 20.10.0
nvm install 18.15.0

# Switch to Stencil CLI supported version of Node.js:
nvm use 20.10.0
nvm use 18.15.0

# Install Stencil CLI
npm install -g @bigcommerce/stencil-cli
Expand All @@ -56,7 +52,7 @@ choco install git

# Install nvm windows and stencil-compatible node.js

choco install nvm; nvm install 20.10.0; nvm use 20.10.0
choco install nvm; nvm install 18.15.0; nvm use 18.15.0

# Install Stencil CLI
npm install -g @bigcommerce/stencil-cli
Expand All @@ -78,7 +74,7 @@ If you're a pro at installing and configuring Python and Node.js environments on

**Required Dependencies:**
* [Git](https://git-scm.com/downloads) - required to run npm install
* [Node.js 20.10.0 and npm](https://nodejs.org/en/download/releases/)
* [Node.js 18.15.0 and npm](https://nodejs.org/en/download/releases/)

Once they're installed and configured, use `npm` to install Stencil CLI:

Expand All @@ -103,9 +99,9 @@ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.36.0/install.sh | bash
source ~/.bashrc

# Explicitly install and use supported node version
nvm install 20.10.0
nvm install 18.15.0

nvm use 20.10.0
nvm use 18.15.0

# Install stencil
npm install -g @bigcommerce/stencil-cli
Expand Down
4 changes: 2 additions & 2 deletions docs/stencil-docs/installing-stencil-cli/node-sass.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ stencil bundle
a. Use the "dry run" option to see potential changes without making or saving those changes.

```shell copy
stencil -scss-autofix.js --dry
stencil scss-autofix --dry
```

b. To make the changes and revalidate, run the following:

```shell copy
stencil -scss-autofix.js
stencil scss-autofix
```

```shell copy
Expand Down
15 changes: 13 additions & 2 deletions docs/stencil-docs/reference-docs/front-matter-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,20 @@ product:
limit: 10 # limits similar products by views to 10
```

<Callout type="info">
NOTE: The `similar_by_views` property is not currently active.
</Callout>



| Property | Description |
|:---------|:------------|
|`product`|When filtering/limiting, products' default sorting is by order id, from lowest to highest.|
|`videos`|If `product.videos` is not defined, you will not return videos. If you define `product.videos`, the default behavior is to return all videos. If you define `product.videos.limit`, this sets the maximum number of videos returned.|
|`images`|If `product.images` is not defined, you will not return images. If `product.images` is defined, you must also define `product.images.limit`, which throttles the number of images returned. The maximum allowable value for this parameter is five images.|
|`reviews`|Boolean indicating whether to display product reviews. If `product.reviews` is present and is not explicitly set to `false`, reviews will appear. If not defined, defaults to 10 reviews. When filtering/limiting reviews, the default sorting is by review id, from lowest to highest. If a product has over 250 reviews, you can fetch the rest using the GraphQL Storefront API. See the example GraphQL query below.|
|`related_products`|Displays products that are related by name. If `limit` absent or undefined, the default behavior is to display all related products. Inserting `limit` with no integer will display 0 products.|
|`similar_by_views`|Displays products similar to those displayed in the current page context. If `limit` absent or undefined, the default is to display four products.|
|`similar_by_views`|Displays products similar to those displayed in the current page context. If `limit` absent or undefined, the default is to display four products. Currently disabled on the platform. |

Sample GraphQL query for product reviews over the limit.

Expand Down Expand Up @@ -255,7 +261,12 @@ gql: "query productById($productId: Int!) {
}
}"
```


<Callout type="info">
NOTE: The `similar_by_views` property is not currently active.
</Callout>


We suggest testing GraphQL queries using the [storefront API playground](https://developer.bigcommerce.com/graphql-playground) to refine them before adding them to your template. If your query contains double quotes `"`, replace them with single quotes `'` or escape the double-quotes `\"`. You can launch the playground from your store by going to **Settings** > **API** > **Storefront API Playground** in your store control panel.


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ products:

```

<Callout type="info">
NOTE: The `similar_by_views` property is not currently active.
</Callout>

<Callout type="info">
#### Filtering for Faster Page Loads
To keep your pages lightweight, specify only the attributes you need per page. Also, use the limit key (with appropriate values) for attributes that accept it.
Expand Down
2 changes: 1 addition & 1 deletion reference/catalog/products_catalog.v3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6981,7 +6981,7 @@ components:
metafield_Base:
title: metafield_Base
type: object
description: 'Metafield for products, categories, variants, and brands; the max number of metafields allowed on each is 50. For more information, see [Platform Limits](https://support.bigcommerce.com/s/article/Platform-Limits) in the Help Center.'
description: 'Metafield for products, categories, variants, and brands; the max number of metafields allowed on each is 250. For more information, see [Platform Limits](https://support.bigcommerce.com/s/article/Platform-Limits) in the Help Center.'
x-internal: false
properties:
key:
Expand Down
1 change: 0 additions & 1 deletion reference/price_lists.v3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1929,7 +1929,6 @@ paths:
in: query
description: |
Sub-resources to include on a price record, in a comma-separated list. Valid expansions currently include `bulk_pricing_tiers` and `sku`. Other values will be ignored.
Sub-resources to include on a price record, in a comma-separated list. Valid expansions currently include `bulk_pricing_tiers` and `sku`. Other values will be ignored.
explode: false
schema:
type: array
Expand Down
Loading

0 comments on commit bbd5ff4

Please sign in to comment.