Skip to content

Commit

Permalink
Merge branch 'main' into CHECKOUT-8827
Browse files Browse the repository at this point in the history
  • Loading branch information
bc-traciporter authored Dec 20, 2024
2 parents a3ce3f3 + 69a6de1 commit 8c09dc1
Show file tree
Hide file tree
Showing 3 changed files with 155 additions and 7 deletions.
5 changes: 5 additions & 0 deletions docs/storefront/cart-checkout/guide/add-to-cart-url.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ URLs constructed with these parameters allow you to:

Below is a table of common scenarios and example URLs.


| **Scenario** | **URL** |
|--|-|
| Select a specific SKU on Product Detail page |`https://{{domain}}/{{page}}?sku={{sku}}` |
Expand All @@ -34,6 +35,10 @@ Below is a table of common scenarios and example URLs.
| Add product to cart by product id and set quantity |`https://{{domain}}/cart.php?action=add&product_id={{id}}&qty={{qty}}`|
| Add product to cart and set coupon code |`https://{{domain}}/cart.php?action=add&product_id={{id}}&couponcode={{code}}` |

<Callout type="info">
It is required to have a product ID or a sku within the URL to add a coupon code.
</Callout>

Once constructed, a URL can be inserted directly as text or as an HTML link:

```html showLineNumbers copy
Expand Down
6 changes: 3 additions & 3 deletions reference/customers.v3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,7 @@ paths:
Returns the global-level customer settings.
**Notes:**
* Global customer settings don't apply when the `default_customer_group_id` is present.
* Global customer settings don't apply on a channel when there are channel specific settings configured through [Channel Settings](/docs/rest-management/customers/channel-settings).
summary: Get Customer Settings
operationId: getCustomersSettings
Expand Down Expand Up @@ -888,8 +888,8 @@ paths:
**Notes:**
* `null` indicates that there is no override per given channel and values are inherited from the global level.
* Global customer settings don't apply when the `default_customer_group_id` is present.
* `null` value configuration indicates that there is no override provided for a given channel; thus, values are inherited from [Global Settings](/docs/rest-management/customers/global-settings).
summary: Get Customer Settings per Channel
operationId: getCustomersSettingsChannel
parameters:
Expand Down
151 changes: 147 additions & 4 deletions reference/promotions.v3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,10 @@ paths:
operationId: getPromotionCodes
parameters:
- $ref: '#/components/parameters/PromotionIdPath'
- $ref: '#/components/parameters/BeforeCursorQuery'
- $ref: '#/components/parameters/AfterCursorQuery'
- $ref: '#/components/parameters/DeprecatedPageQuery'
- $ref: '#/components/parameters/LimitQuery'
responses:
'200':
$ref: '#/components/responses/PromotionCodesCollectionResponse'
Expand Down Expand Up @@ -860,6 +864,19 @@ components:
**Money**
Represents a monetary value in the store’s default currency.
example: '12.95'
OptionalCursorCollectionMeta:
title: Collection Meta
type: object
properties:
pagination:
$ref: '#/components/schemas/DeprecatedPagination'
cursor_pagination:
$ref: '#/components/schemas/CursorPagination'
description: >
Contains data about paginating the response via cursors.
If no pagination details are specified, then both properties will be present.
When a 'before' or 'after' cursor is provided, only the 'cursor_pagination' property will be present.
When a 'page' parameter is provided, only the offset based 'pagination' property will be present.
CollectionMeta:
title: Collection Meta
type: object
Expand All @@ -879,7 +896,7 @@ components:
description: Total number of items in the collection response.
per_page:
type: integer
description: 'The amount of items returned in the collection per page, controlled by the limit of items per page parameter.'
description: The amount of items returned in the collection per page, controlled by the limit of items per page parameter.
current_page:
type: integer
description: The page you are currently on within the collection.
Expand All @@ -900,6 +917,91 @@ components:
description: Link to the next page returned in the response.
description: Pagination links for the previous and next parts of the whole collection.
description: 'Data about the response, including pagination and collection totals.'
DeprecatedPagination:
title: Pagination
type: object
deprecated: true
properties:
total:
type: integer
description: Total number of items in the result set.
count:
type: integer
description: Total number of items in the collection response.
per_page:
type: integer
description: 'The amount of items returned in the collection per page, controlled by the limit of items per page parameter.'
current_page:
type: integer
description: The page you are currently on within the collection.
total_pages:
type: integer
description: The total number of pages in the collection.
links:
type: object
properties:
previous:
type: string
description: Link to the previous page returned in the response.
current:
type: string
description: Link to the current page returned in the response.
next:
type: string
description: Link to the next page returned in the response.
description: Pagination links for the previous and next parts of the whole collection.
description: >
Data about the response, including pagination and collection totals.
This property has been deprecated and cursor_pagination should be used instead.
CursorPagination:
title: Cursor Pagination
type: object
required: [
count,
per_page,
links
]
properties:
count:
type: integer
description: Total number of items in the result set.
example: 12
per_page:
type: integer
description: 'The amount of items returned in the collection per page, controlled by the limit of items per page parameter.'
example: 12
start_cursor:
type: string
description: >
The cursor to the first item in the result set.
Can be used with the "before" query parameter to paginate backwards.
This property is omitted when the result set is empty.
example: 'eyJpZCI6IjIzNzU1NyJ9'
end_cursor:
type: string
description: >
The cursor to the last item in the result set.
Can be used with the "after" query parameter to paginate forwards.
This property is omitted when the result set is empty.
example: 'eyJpZCI6IjIzNzU1NyJ9'
links:
type: object
properties:
previous:
type: string

description: >
Link to the previous page returned in the response.
This property is omitted when the result set is empty or on the first page.
example: '?limit=5&before=eyJpZCI6IjIzNzU1NyJ9'
next:
type: string

description: >
Link to the next page returned in the response.
This property is omitted when the result set is empty.
example: '?limit=5&after=eyJpZCI6IjIzNzU1NyJ9'
description: Contains data about paginating the response via cursors.
ErrorResponse:
title: Error Response
type: object
Expand Down Expand Up @@ -1429,7 +1531,7 @@ components:
items:
$ref: '#/components/schemas/CouponCode'
meta:
$ref: '#/components/schemas/CollectionMeta'
$ref: '#/components/schemas/OptionalCursorCollectionMeta'
examples:
example-1:
value:
Expand All @@ -1441,6 +1543,13 @@ components:
current_uses: 0
created: '2019-01-20T22:00:00+00:00'
meta:
cursor_pagination:
count: 1
per_page: 50
start_cursor: 'eyJpZCI6IjIzNzU1NyJ9'
end_cursor: 'eyJpZCI6IjIzNzU1MyJ9'
links:
next: '?limit=5&after=eyJpZCI6IjIzNzU1NyJ9'
pagination:
total: 1
count: 1
Expand Down Expand Up @@ -1610,15 +1719,26 @@ components:
schema:
minimum: 1
type: integer
DeprecatedPageQuery:
name: page
in: query
description: >
Query parameter that specifies the page number in a paginated list of resources.
This field is deprecated and the 'before' and 'after' cursor parameters should be used instead.
deprecated: true
schema:
minimum: 1
type: integer
LimitQuery:
name: limit
in: query
description: Query parameter that limits the number of items displayed per page in a paginated list of resources.
description: >
Query parameter that limits the number of items displayed per page in a paginated list of resources.
When none is specified a default value of 50 is used.
schema:
maximum: 250
minimum: 1
type: integer
required: true
NameQuery:
name: name
in: query
Expand Down Expand Up @@ -1682,6 +1802,29 @@ components:
required: true
schema:
type: string
BeforeCursorQuery:
name: before
in: query
required: false
description: >
A cursor that can be used for backwards pagination.
Will fetch results before the position corresponding to the cursor.
Cannot be used with the 'page' query parameter.
Cannot be used with the 'after' query parameter.
schema:
type: string

AfterCursorQuery:
name: after
in: query
required: false
description: >
A cursor that can be used for forwards pagination.
Will fetch results after the position corresponding to the cursor.
Cannot be used with the 'page' query parameter.
Cannot be used with the 'before' query parameter.
schema:
type: string
ChannelQuery:
name: channels
in: query
Expand Down

0 comments on commit 8c09dc1

Please sign in to comment.