diff --git a/docs/store-operations/catalog/graphql-admin/product-modifier-options.mdx b/docs/store-operations/catalog/graphql-admin/product-modifier-options.mdx index 914e724f0..a3bab225c 100644 --- a/docs/store-operations/catalog/graphql-admin/product-modifier-options.mdx +++ b/docs/store-operations/catalog/graphql-admin/product-modifier-options.mdx @@ -10,12 +10,13 @@ Using the Catalog features of the Admin API, you can set and query information about a product modifier options, for example, option name and values. You can perform the following: -- [Set global modifier option information](#set-product-modifier-options-at-the-global-level) for the catalog. Channels inherit these by default. -- [Create overrides for a channel locale](#set-product-modifier-options-for-a-locale) using the `overridesForLocale` mutation. -- [Remove overrides for a channel locale](#remove-product-modifier-options-for-a-locale) +- [Set modifier option information](#set-product-modifier-options): You can set global modifier information for the catalog. Channels inherit global information by default. You can also create overrides for a channel locale using the `overridesForLocale` mutation. These override global store information. +- [Remove overrides for a channel locale](#remove-product-modifier-options-for-a-locale). - [Query modifier option information](#query-modifier-options), those set at the global level and the overrides. -You can also set and remove information for [shared modifiers](https://support.bigcommerce.com/s/article/Product-Options-v3?language=en_US#smo). The changes affect all products that you assign to the shared modifier. [Querying modifier options](#query-modifier-options) returns all modifiers, including shared ones. +You can also set and remove information for [shared modifiers](https://support.bigcommerce.com/s/article/Product-Options-v3?language=en_US#smo). Changing a shared modifier option affects all products that you assign to the shared modifier option. You cannot customize shared modifier options on a product level. + +[Querying modifier options](#query-modifier-options) returns all modifiers, including shared ones. For a full schema, see the [GraphQL Admin API reference](https://developer.bigcommerce.com/graphql-admin/reference). @@ -23,24 +24,22 @@ For a full schema, see the [GraphQL Admin API reference](https://developer.bigco Setting or removing information requires that you specify ID fields in the input. For more information on how to specify ID fields, see [Input fields](/docs/store-operations/catalog/msf-international-enhancements#input-fields). -## Set product modifier options - -Set information about a product modifier option for a store or a locale within a storefront channel. +## Product modifier options -The following mutations let you set the name and values for existing modifier options. You must first create the modifier option for the product through the control panel or the REST [Create a product modifier](/docs/rest-catalog/product-modifiers#create-a-product-modifier) endpoint. +Set information about a product modifier option for a store or a locale within a storefront channel. You must first create the modifier option for the product through the control panel or the REST [Create a product modifier](/docs/rest-catalog/product-modifiers#create-a-product-modifier) endpoint. The responses may include all modifier options, including those that are shared. However, to _set_ shared modifier options, use the mutations in [Set shared modifier options](#set-shared-modifier-options). -### Set product modifier options at the global level +### Set product modifier options -The following example sets global product modifier information for the store, from which channels inherit by default. You can set the modifier name and values. +The following mutation lets you sets information for a channel locale. To set information for the global store, don't include the `localeContext` field in the `input`. - ```graphql filename="Example mutation: Set product modifier options at the global level" showLineNumbers copy + ```graphql filename="Example mutation: Set product modifier options for a channel locale" showLineNumbers copy POST https://api.bigcommerce.com/stores/{{STORE_HASH}}/graphql X-Auth-Token: {{ACCESS_TOKEN}} Content-Type: application/json @@ -48,7 +47,7 @@ The following example sets global product modifier information for the store, fr mutation ($input: SetProductModifiersInformationInput!) { product { - setProductModifiersInformation (input: $input) { + setProductModifiersInformation(input: $input) { product { id modifiers { @@ -56,47 +55,24 @@ The following example sets global product modifier information for the store, fr node { id displayName - isRequired - isShared - ... on CheckboxProductModifier { - checkedByDefault - fieldValue - } - ... on TextFieldProductModifier { - defaultValue - } - ... on MultilineTextFieldProductModifier { - defaultValue - } - ... on NumbersOnlyTextFieldProductModifier { - defaultValueFloat: defaultValue - } - ... on DropdownProductModifier { - values { - id - label - isDefault - } - } - ... on RadioButtonsProductModifier { - values { - id - label - isDefault - } - } + ... on RectangleListProductModifier { - values { - id - label - isDefault - } - } - ... on SwatchProductModifier { - values { - id - label - isDefault + overrides(context: { channelId: "bc/store/channel/2", locale: "fr" }) { + edges { + node { + ... on RectangleListProductModifierOverridesForChannelLocale { + context { + channelId + locale + } + displayName + values { + id + label + } + } + } + } } } } @@ -112,21 +88,25 @@ The following example sets global product modifier information for the store, fr { "input": { "productId": "bc/store/product/111", + "localeContext": { + "channelId": "bc/store/channel/2", + "locale": "fr" + }, "data": { "modifiers": [ { "modifierId": "bc/store/productModifier/121", "data": { "rectangleList": { - "displayName": "Holiday Theme", + "displayName": "Thème de vacances", "values": [ { "valueId": "bc/store/productModifierValue/113", - "label": "Birthday" + "label": "Anniversaire" }, { "valueId": "bc/store/productModifierValue/114", - "label": "Christmas" + "label": "Noël" } ] } @@ -141,7 +121,7 @@ The following example sets global product modifier information for the store, fr - ```json filename="Example mutation: Set product modifier options at the global level" showLineNumbers copy + ```json filename="Example mutation: Set product modifier options for a channel locale" showLineNumbers copy { "data": { "product": { @@ -153,134 +133,84 @@ The following example sets global product modifier information for the store, fr { "node": { "id": "bc/store/productModifier/118", - "displayName": "Include Insurance?", - "isRequired": true, - "isShared": false, - "checkedByDefault": true, - "fieldValue": "Yes" + "displayName": "Include Insurance?" } }, { "node": { "id": "bc/store/productModifier/119", - "displayName": "Custom Message", - "isRequired": false, - "isShared": false, - "defaultValue": "Enjoy your gift" + "displayName": "Custom Message" } }, { "node": { "id": "bc/store/productModifier/121", "displayName": "Holiday Theme", - "isRequired": false, - "isShared": false, - "values": [ - { - "id": "bc/store/productModifierValue/113", - "label": "Birthday", - "isDefault": true - }, - { - "id": "bc/store/productModifierValue/114", - "label": "Christmas", - "isDefault": true - } - ] + "overrides": { + "edges": [ + { + "node": { + "context": { + "channelId": "bc/store/channel/2", + "locale": "fr" + }, + "displayName": "Thème de vacances", + "values": [ + { + "id": "bc/store/productModifierValue/113", + "label": "Anniversaire" + }, + { + "id": "bc/store/productModifierValue/114", + "label": "Noël" + } + ] + } + } + ] + } } }, { "node": { "id": "bc/store/productModifier/122", - "displayName": "Hood Color", - "isRequired": true, - "isShared": false, - "values": [ - { - "id": "bc/store/productModifierValue/115", - "label": "Red Hood", - "isDefault": false - }, - { - "id": "bc/store/productModifierValue/116", - "label": "Blue Hood", - "isDefault": false - } - ] + "displayName": "Hood Color" } }, { "node": { "id": "bc/store/productModifier/123", - "displayName": "Pattern", - "isRequired": false, - "isShared": false, - "values": [ - { - "id": "bc/store/productModifierValue/117", - "label": "Plain", - "isDefault": true - }, - { - "id": "bc/store/productModifierValue/118", - "label": "Checkered", - "isDefault": true - } - ] + "displayName": "Pattern" } }, { "node": { "id": "bc/store/productModifier/124", - "displayName": "Fit Type", - "isRequired": false, - "isShared": false, - "values": [ - { - "id": "bc/store/productModifierValue/119", - "label": "Regular fit", - "isDefault": false - }, - { - "id": "bc/store/productModifierValue/120", - "label": "Loose fit", - "isDefault": false - } - ] + "displayName": "Fit Type" } }, { "node": { - "id": "bc/store/productModifier/125", - "displayName": "Optional details", - "isRequired": false, - "isShared": false, - "defaultValue": "" + "id": "bc/store/productModifier/125", + "displayName": "Optional details" } }, { "node": { - "id": "bc/store/productModifier/127", - "displayName": "Number of Pockets", - "isRequired": true, - "isShared": false, - "defaultValueFloat": 1 + "id": "bc/store/productModifier/126", + "displayName": "Closure Type" } }, { "node": { - "id": "bc/store/productModifier/128", - "displayName": "Anniversary Date", - "isRequired": false, - "isShared": false + "id": "bc/store/productModifier/127", + "displayName": "Number of Pockets" } }, { "node": { - "id": "bc/store/productModifier/129", - "displayName": "Custom-printed Image", - "isRequired": false, - "isShared": false + "id": "bc/store/productModifier/128", + "displayName": "Anniversary Date" } } ] @@ -295,288 +225,6 @@ The following example sets global product modifier information for the store, fr -### Set product modifier options for a locale - -The following example sets product modifier option information for the locale within the specified storefront channel. These will override global store information. You can set the modifier option name and values. - - - - - ```graphql filename="Example mutation: Set product modifier options for a locale" showLineNumbers copy - POST https://api.bigcommerce.com/stores/{{STORE_HASH}}/graphql - X-Auth-Token: {{ACCESS_TOKEN}} - Content-Type: application/json - Accept: application/json - - mutation ($input: SetProductModifiersInformationInput!) { - product { - setProductModifiersInformation (input: $input) { - product { - id - modifiers { - edges { - node { - id - displayName - ... on CheckboxProductModifier { - overridesForLocale (localeContext: { channelId: "bc/store/channel/2", locale: "fr"}) { - displayName - fieldValue - } - } - ... on TextFieldProductModifier { - overridesForLocale (localeContext: { channelId: "bc/store/channel/2", locale: "fr"}) { - displayName - defaultValue - } - } - ... on MultilineTextFieldProductModifier { - overridesForLocale (localeContext: { channelId: "bc/store/channel/2", locale: "fr"}) { - displayName - defaultValue - } - } - ... on NumbersOnlyTextFieldProductModifier { - overridesForLocale (localeContext: { channelId: "bc/store/channel/2", locale: "fr"}) { - displayName - defaultValueFloat: defaultValue - } - } - ... on DropdownProductModifier { - overridesForLocale (localeContext: { channelId: "bc/store/channel/2", locale: "fr"}) { - displayName - values { - id - label - } - } - } - ... on RadioButtonsProductModifier { - overridesForLocale (localeContext: { channelId: "bc/store/channel/2", locale: "fr"}) { - displayName - values { - id - label - } - } - } - ... on RectangleListProductModifier { - overridesForLocale (localeContext: { channelId: "bc/store/channel/2", locale: "fr"}) { - displayName - values { - id - label - } - } - } - ... on SwatchProductModifier { - overridesForLocale (localeContext: { channelId: "bc/store/channel/2", locale: "fr"}) { - displayName - values { - id - label - } - } - } - ... on FileUploadProductModifier { - overridesForLocale (localeContext: { channelId: "bc/store/channel/2", locale: "fr"}) { - displayName - } - } - ... on DateFieldProductModifier { - overridesForLocale (localeContext: { channelId: "bc/store/channel/2", locale: "fr"}) { - displayName - } - } - } - } - } - } - } - } - } - ``` - - ```json filename="GraphQL variables" showLineNumbers copy - { - "input": { - "productId": "bc/store/product/111", - "localeContext": { - "channelId": "bc/store/channel/2", - "locale": "fr" - }, - "data": { - "modifiers": [ - { - "modifierId": "bc/store/productModifier/121", - "data": { - "rectangleList": { - "displayName": "Thème de vacances", - "values": [ - { - "valueId": "bc/store/productModifierValue/113", - "label": "Anniversaire" - }, - { - "valueId": "bc/store/productModifierValue/114", - "label": "Noël" - } - ] - } - } - } - ] - } - } - } - ``` - - - - - ```json filename="Example mutation: Set product modifier options for a locale" showLineNumbers copy - { - "data": { - "product": { - "setProductModifiersInformation": { - "product": { - "id": "bc/store/product/111", - "modifiers": { - "edges": [ - { - "node": { - "id": "bc/store/productModifier/118", - "displayName": "Include Insurance?", - "overridesForLocale": null - } - }, - { - "node": { - "id": "bc/store/productModifier/119", - "displayName": "Custom Message", - "overridesForLocale": null - } - }, - { - "node": { - "id": "bc/store/productModifier/121", - "displayName": "Holiday Theme", - "overridesForLocale": { - "displayName": "Thème de vacances", - "values": [ - { - "id": "bc/store/productModifierValue/113", - "label": "Anniversaire" - }, - { - "id": "bc/store/productModifierValue/114", - "label": "Noël" - } - ] - } - } - }, - { - "node": { - "id": "bc/store/productModifier/122", - "displayName": "Hood Color", - "overridesForLocale": { - "displayName": "Couleur du capot", - "values": [ - { - "id": "bc/store/productModifierValue/115", - "label": "Rouge" - }, - { - "id": "bc/store/productModifierValue/116", - "label": "Bleu" - } - ] - } - } - }, - { - "node": { - "id": "bc/store/productModifier/123", - "displayName": "Pattern", - "overridesForLocale": { - "displayName": "Modèle", - "values": [ - { - "id": "bc/store/productModifierValue/117", - "label": "Ordinaire" - }, - { - "id": "bc/store/productModifierValue/118", - "label": "A carreaux" - } - ] - } - } - }, - { - "node": { - "id": "bc/store/productModifier/124", - "displayName": "Fit Type", - "overridesForLocale": { - "displayName": "Type d'ajustement", - "values": [ - { - "id": "bc/store/productModifierValue/119", - "label": "Régulière" - }, - { - "id": "bc/store/productModifierValue/120", - "label": "Ample" - } - ] - } - } - }, - { - "node": { - "id": "bc/store/productModifier/125", - "displayName": "Optional details", - "overridesForLocale": null - } - }, - { - "node": { - "id": "bc/store/productModifier/127", - "displayName": "Number of Pockets", - "overridesForLocale": null - } - }, - { - "node": { - "id": "bc/store/productModifier/128", - "displayName": "Anniversary Date", - "overridesForLocale": { - "displayName": "Date d'anniversaire" - } - } - }, - { - "node": { - "id": "bc/store/productModifier/129", - "displayName": "Custom-printed Image", - "overridesForLocale": { - "displayName": "Image personnalisée" - } - } - } - ] - } - } - } - } - } - } - ``` - - - - ### Remove product modifier options for a locale The following example removes product modifier option information for the locale within the specified storefront channel. @@ -592,7 +240,7 @@ The following example removes product modifier option information for the locale mutation ($input: RemoveProductModifiersOverridesInput!) { product { - removeProductModifiersOverrides (input: $input) { + removeProductModifiersOverrides(input: $input) { product { id modifiers { @@ -600,8 +248,23 @@ The following example removes product modifier option information for the locale node { id displayName + ... on CheckboxProductModifier { + overrides(context: { channelId: "bc/store/channel/2", locale: "fr" }) { + edges { + node { + ... on CheckboxProductModifierOverridesForChannelLocale { + context { + channelId + locale + } + displayName + } + } + } + } + } } - } + } } } } @@ -650,7 +313,10 @@ The following example removes product modifier option information for the locale { "node": { "id": "bc/store/productModifier/118", - "displayName": "Include Insurance?" + "displayName": "Include Insurance?", + "overrides": { + "edges": [] + } } }, { @@ -691,20 +357,20 @@ The following example removes product modifier option information for the locale }, { "node": { - "id": "bc/store/productModifier/127", - "displayName": "Number of Pockets" + "id": "bc/store/productModifier/126", + "displayName": "Closure Type" } }, { "node": { - "id": "bc/store/productModifier/128", - "displayName": "Anniversary Date" + "id": "bc/store/productModifier/127", + "displayName": "Number of Pockets" } }, { "node": { - "id": "bc/store/productModifier/129", - "displayName": "Custom-printed Image" + "id": "bc/store/productModifier/128", + "displayName": "Anniversary Date" } } ] @@ -719,95 +385,18 @@ The following example removes product modifier option information for the locale -## Set shared modifier options - -You can set information about a shared modifier option for a store or a locale within a storefront channel. You must first create the shared modifier options through the control panel. Changing a shared modifier option affects all products that you assign to the shared modifier option. You cannot customize shared modifier options on a product level. - -The following mutations let you set the name and values for existing shared modifiers. - -### Set shared modifier options at the global level - -The following example sets global shared modifier information for the store, from which channels inherit by default. You can set the name and values for existing modifiers. - - - - - ```graphql filename="Example mutation: Set shared modifier options at the global level" showLineNumbers copy - POST https://api.bigcommerce.com/stores/{{STORE_HASH}}/graphql - X-Auth-Token: {{ACCESS_TOKEN}} - Content-Type: application/json - Accept: application/json - - mutation ($input: SetSharedProductModifiersInformationInput!) { - sharedProductModifiers { - setSharedProductModifiersInformation (input: $input) { - sharedProductModifiers { - id - } - } - } - } - ``` - - ```json filename="GraphQL variables" showLineNumbers copy - { - "input": { - "data": { - "modifiers": [ - { - "modifierId": "bc/store/sharedProductModifier/2", - "data": { - "rectangleList": { - "displayName": "Button type", - "values": [ - { - "valueId": "bc/store/sharedProductModifierValue/107", - "label": "Large buttons" - }, - { - "valueId": "bc/store/sharedProductModifierValue/108", - "label": "Small buttons" - } - ] - } - } - } - ] - } - } - } - ``` - - - - - ```json filename="Example mutation: Set shared modifier options at the global level" showLineNumbers copy - { - "data": { - "sharedProductModifiers": { - "setSharedProductModifiersInformation": { - "sharedProductModifiers": [ - { - "id": "bc/store/sharedProductModifier/2" - } - ] - } - } - } - } - ``` +## Shared modifier options - - +You can set information about a shared modifier option for a store or a locale within a storefront channel. You must first create the shared modifier options through the control panel. -### Set shared modifier options for a locale +### Set shared modifier options -The following example sets shared modifier information for the locale within the specified storefront channel. These override global store information. You can set the name and values for existing modifiers. +The following example sets shared modifier information for the locale within the specified storefront channel. To set global store values, don't include the `localeContext` field in the input. - ```graphql filename="Example mutation: Set shared modifier options for a locale" showLineNumbers copy + ```graphql filename="Example mutation: Set shared modifier options for a channel locale" showLineNumbers copy POST https://api.bigcommerce.com/stores/{{STORE_HASH}}/graphql X-Auth-Token: {{ACCESS_TOKEN}} Content-Type: application/json @@ -860,7 +449,7 @@ The following example sets shared modifier information for the locale within the - ```json filename="Example mutation: Set shared modifier options for a locale" showLineNumbers copy + ```json filename="Example mutation: Set shared modifier options for a channel locale" showLineNumbers copy { "data": { "sharedProductModifiers": { @@ -963,9 +552,9 @@ The following example retrieves modifier information. You can retrieve global in query { store { - product (id: "bc/store/product/111") { + product(id: "bc/store/product/111") { id - modifiers (first: 10) { + modifiers(first: 10) { edges { node { __typename @@ -973,108 +562,62 @@ The following example retrieves modifier information. You can retrieve global in displayName isShared isRequired - ... on CheckboxProductModifier { - checkedByDefault - fieldValue - overridesForLocale (localeContext: { channelId: "bc/store/channel/2", locale: "fr" }) { - displayName - fieldValue - } - } - ... on TextFieldProductModifier { - defaultValue - overridesForLocale (localeContext: { channelId: "bc/store/channel/2", locale: "fr" }) { - displayName - defaultValue - } - } - ... on MultilineTextFieldProductModifier { - defaultValue - overridesForLocale (localeContext: { channelId: "bc/store/channel/2", locale: "fr" }) { - displayName - defaultValue - } - } - ... on NumbersOnlyTextFieldProductModifier { - defaultValueFloat: defaultValue - overridesForLocale (localeContext: { channelId: "bc/store/channel/2", locale: "fr" }) { - displayName - defaultValueFloat: defaultValue - } - } + ... on DropdownProductModifier { values { id label isDefault } - overridesForLocale (localeContext: { channelId: "bc/store/channel/2", locale: "fr" }) { - displayName - values { - id - label + overrides(context: { channelId: "bc/store/channel/2", locale: "fr" }) { + edges { + node { + ... on DropdownProductModifierOverridesForChannelLocale { + context { + channelId + locale + } + displayName + values { + id + label + } + } } - } - } - ... on RadioButtonsProductModifier { - values { - id - label - isDefault - } - overridesForLocale (localeContext: { channelId: "bc/store/channel/2", locale: "fr" }) { - displayName - values { - id - label - } - } - } - ... on RectangleListProductModifier { - values { - id - label - isDefault - } - overridesForLocale (localeContext: { channelId: "bc/store/channel/2", locale: "fr" }) { - displayName - values { - id - label } } } + ... on SwatchProductModifier { values { id label isDefault } - overridesForLocale (localeContext: { channelId: "bc/store/channel/2", locale: "fr" }) { - displayName - values { - id - label + overrides(context: { channelId: "bc/store/channel/2", locale: "fr" }) { + edges { + node { + ... on SwatchProductModifierOverridesForChannelLocale { + context { + channelId + locale + } + displayName + values { + id + label + } + } + } } } } - ... on FileUploadProductModifier { - overridesForLocale (localeContext: { channelId: "bc/store/channel/2", locale: "fr" }) { - displayName - } - } - ... on DateFieldProductModifier { - overridesForLocale (localeContext: { channelId: "bc/store/channel/2", locale: "fr" }) { - displayName - } - } } } } } } } - ``` @@ -1093,13 +636,7 @@ The following example retrieves modifier information. You can retrieve global in "id": "bc/store/productModifier/118", "displayName": "Include Insurance?", "isShared": false, - "isRequired": true, - "checkedByDefault": true, - "fieldValue": "Yes", - "overridesForLocale": { - "displayName": null, - "fieldValue": null - } + "isRequired": true } }, { @@ -1108,12 +645,7 @@ The following example retrieves modifier information. You can retrieve global in "id": "bc/store/productModifier/119", "displayName": "Custom Message", "isShared": false, - "isRequired": false, - "defaultValue": "Enjoy your gift", - "overridesForLocale": { - "displayName": null, - "fieldValue": null - } + "isRequired": false } }, { @@ -1122,32 +654,7 @@ The following example retrieves modifier information. You can retrieve global in "id": "bc/store/productModifier/121", "displayName": "Holiday Theme", "isShared": false, - "isRequired": false, - "values": [ - { - "id": "bc/store/productModifierValue/113", - "label": "Birthday", - "isDefault": true - }, - { - "id": "bc/store/productModifierValue/114", - "label": "Christmas", - "isDefault": true - } - ], - "overridesForLocale": { - "displayName": "Thème de vacances", - "values": [ - { - "id": "bc/store/productModifierValue/113", - "label": "Anniversaire" - }, - { - "id": "bc/store/productModifierValue/114", - "label": "Noël" - } - ] - } + "isRequired": false } }, { @@ -1169,16 +676,26 @@ The following example retrieves modifier information. You can retrieve global in "isDefault": false } ], - "overridesForLocale": { - "displayName": "Couleur du capot", - "values": [ - { - "id": "bc/store/productModifierValue/115", - "label": "Rouge" - }, + "overrides": { + "edges": [ { - "id": "bc/store/productModifierValue/116", - "label": "Bleu" + "node": { + "context": { + "channelId": "bc/store/channel/2", + "locale": "fr" + }, + "displayName": "Couleur du capot", + "values": [ + { + "id": "bc/store/productModifierValue/115", + "label": "Rouge" + }, + { + "id": "bc/store/productModifierValue/116", + "label": "Bleu" + } + ] + } } ] } @@ -1186,41 +703,16 @@ The following example retrieves modifier information. You can retrieve global in }, { "node": { - "__typename": "RectangleListProductModifier", + "__typename": "RadioButtonsProductModifier", "id": "bc/store/productModifier/123", "displayName": "Pattern", "isShared": false, - "isRequired": false, - "values": [ - { - "id": "bc/store/productModifierValue/117", - "label": "Plain", - "isDefault": true - }, - { - "id": "bc/store/productModifierValue/118", - "label": "Checkered", - "isDefault": true - } - ], - "overridesForLocale": { - "displayName": "Modèle", - "values": [ - { - "id": "bc/store/productModifierValue/117", - "label": "ordinaire" - }, - { - "id": "bc/store/productModifierValue/118", - "label": "à carreaux" - } - ] - } + "isRequired": false } }, { "node": { - "__typename": "RectangleListProductModifier", + "__typename": "DropdownProductModifier", "id": "bc/store/productModifier/124", "displayName": "Fit Type", "isShared": false, @@ -1237,16 +729,26 @@ The following example retrieves modifier information. You can retrieve global in "isDefault": false } ], - "overridesForLocale": { - "displayName": "Type d'ajustement", - "values": [ - { - "id": "bc/store/productModifierValue/119", - "label": "Régulière" - }, + "overrides": { + "edges": [ { - "id": "bc/store/productModifierValue/120", - "label": "Ample" + "node": { + "context": { + "channelId": "bc/store/channel/2", + "locale": "fr" + }, + "displayName": "Type d'ajustement", + "values": [ + { + "id": "bc/store/productModifierValue/119", + "label": "Régulière" + }, + { + "id": "bc/store/productModifierValue/120", + "label": "Ample" + } + ] + } } ] } @@ -1258,12 +760,16 @@ The following example retrieves modifier information. You can retrieve global in "id": "bc/store/productModifier/125", "displayName": "Optional details", "isShared": false, - "isRequired": false, - "defaultValue": "", - "overridesForLocale": { - "displayName": null, - "fieldValue": null - } + "isRequired": false + } + }, + { + "node": { + "__typename": "PickListProductModifier", + "id": "bc/store/productModifier/126", + "displayName": "Closure Type", + "isShared": false, + "isRequired": false } }, { @@ -1272,12 +778,7 @@ The following example retrieves modifier information. You can retrieve global in "id": "bc/store/productModifier/127", "displayName": "Number of Pockets", "isShared": false, - "isRequired": true, - "defaultValueFloat": 1, - "overridesForLocale": { - "displayName": null, - "defaultValueFloat": null - } + "isRequired": true } }, { @@ -1286,152 +787,7 @@ The following example retrieves modifier information. You can retrieve global in "id": "bc/store/productModifier/128", "displayName": "Anniversary Date", "isShared": false, - "isRequired": false, - "overridesForLocale": { - "displayName": "Date d'anniversaire" - } - } - }, - { - "node": { - "__typename": "FileUploadProductModifier", - "id": "bc/store/productModifier/129", - "displayName": "Custom-printed Image", - "isShared": false, - "isRequired": false, - "overridesForLocale": { - "displayName": "image personnalisée" - } - } - } - ] - } - } - } - } - } - ``` - - - - - -You can retrieve overrides for multiple locales in a channel, as shown in the following example: - - - - - ```graphql filename="Example query: Get modifier options" showLineNumbers copy - POST https://api.bigcommerce.com/stores/{{STORE_HASH}}/graphql - X-Auth-Token: {{ACCESS_TOKEN}} - Content-Type: application/json - Accept: application/json - - query { - store { - product (id: "bc/store/product/111") { - id - modifiers (first: 1) { - edges { - node { - __typename - id - displayName - isShared - isRequired - - // modifier values for rectangle List product modifiers - ... on RectangleListProductModifier { - - // global values for the store - values { - id - label - isDefault - } - - // overrides for the UK locale in channel 2 - uk: overridesForLocale(localeContext: { channelId: "bc/store/channel/2", locale: "uk" }) { - displayName - values { - id - label - } - } - - // overrides for the France locale in channel 2 - fr: overridesForLocale(localeContext: { channelId: "bc/store/channel/2", locale: "fr" }) { - displayName - values { - id - label - } - } - } - } - } - } - } - } - } - ``` - - - - - ```json filename="Example query: Get modifier options" showLineNumbers copy - { - "data": { - "store": { - "product": { - "id": "bc/store/product/111", - "modifiers": { - "edges": [ - { - "node": { - "__typename": "RectangleListProductModifier", - "id": "bc/store/productModifier/121", - "displayName": "Holiday Theme", - "isShared": false, - "isRequired": false, - "values": [ - { - "id": "bc/store/productModifierValue/113", - "label": "Birthday", - "isDefault": true - }, - { - "id": "bc/store/productModifierValue/114", - "label": "Christmas", - "isDefault": true - } - ], - "uk": { - "displayName": "Public Holiday", - "values": [ - { - "id": "bc/store/productModifierValue/113", - "label": "New Year's Day" - }, - { - "id": "bc/store/productModifierValue/114", - "label": "Chrimbo" - } - ] - }, - "fr": { - "displayName": "Thème de vacances", - "values": [ - { - "id": "bc/store/productModifierValue/113", - "label": "Anniversaire" - }, - { - "id": "bc/store/productModifierValue/114", - "label": "Noël" - } - ] - } + "isRequired": false } } ] diff --git a/docs/store-operations/catalog/graphql-admin/product-variant-options.mdx b/docs/store-operations/catalog/graphql-admin/product-variant-options.mdx index afec75a52..bb68db572 100644 --- a/docs/store-operations/catalog/graphql-admin/product-variant-options.mdx +++ b/docs/store-operations/catalog/graphql-admin/product-variant-options.mdx @@ -10,11 +10,10 @@ Using the Catalog features of the Admin API, you can set and query information about a [product variant option](https://support.bigcommerce.com/s/article/Product-Options-v3?language=en_US#variations), such as option name and values. Perform the following for product variant options: -- [Set global variant option information](#set-variant-options-at-the-global-level) for the catalog. Channels inherit global information by default. -- [Create overrides for a channel locale](#set-variant-options-for-a-locale) using the `overridesForLocale` field. These override global store information. +- [Set variant options](#set-variant-options): You can set global variant option information for the catalog. Channels inherit global information by default. You can also create overrides for a channel locale. These override global store information. - [Remove overrides for a channel locale](#remove-variant-options-for-a-locale) -You can also set and remove information for [shared variant options](https://support.bigcommerce.com/s/article/Product-Options-v3?language=en_US#svo). The changes affect all products that you assign to the shared variant option. [Querying variant options](#query-product-variant-options) returns all variant options, including shared ones. +You can also set and remove information for [shared variant options](https://support.bigcommerce.com/s/article/Product-Options-v3?language=en_US#svo). Changing a shared variant option affects all products that you assign to the shared variant option. You cannot customize shared variant options on a product level. [Querying variant options](#query-product-variant-options) returns all variant options, including shared ones. For a full schema, see the [GraphQL Admin API reference](https://developer.bigcommerce.com/graphql-admin/reference). @@ -22,7 +21,7 @@ For a full schema, see the [GraphQL Admin API reference](https://developer.bigco Setting or removing information requires that you specify ID fields in the input. For more information on how to specify ID fields, see [Input fields](/docs/store-operations/catalog/msf-international-enhancements#input-fields). -## Set variant options +## Variant options Set information about a product variant option for a store or a locale within a storefront channel. @@ -32,25 +31,25 @@ The following mutations let you set the name and values for existing variant opt The responses may include all variant options, including those that are shared. However, to _set_ shared variant options, use the mutations in [Set shared variant options](#set-shared-variant-options). -### Set variant options at the global level +### Set variant options -The following example sets the store's global product variant option information, from which channels inherit by default. You can set the name and values for existing variant options. +The following example sets product variant option information for the global store and a channel locale. - ```graphql filename="Example mutation: Set product variant options at the global level" showLineNumbers copy + ```graphql filename="Example mutation: Set product variant options" showLineNumbers copy POST https://api.bigcommerce.com/stores/{{STORE_HASH}}/graphql X-Auth-Token: {{ACCESS_TOKEN}} Content-Type: application/json Accept: application/json - mutation ($input: SetProductOptionsInformationInput!) { + mutation ($input: UpdateProductOptionsInput!) { product { - setProductOptionsInformation (input: $input) { + updateProductOptions(input: $input) { product { id - options (first: 2) { + options (first: 1) { edges { node { id @@ -60,6 +59,23 @@ The following example sets the store's global product variant option information id label } + overrides(context: { channelId: "bc/store/channel/1", locale: "fr" }) { + edges { + node { + ... on ProductOptionOverridesForChannelLocale { + context { + channelId + locale + } + displayName + values { + id + label + } + } + } + } + } } } } @@ -72,32 +88,57 @@ The following example sets the store's global product variant option information { "input": { "productId": "bc/store/product/111", - "data": { - "options": [ - { - "optionId": "bc/store/productOption/108", - "data": { - "dropdown": { - "displayName": "Size US", - "values": [ - { - "valueId": "bc/store/productOptionValue/68", - "label": "Small US" - }, - { - "valueId": "bc/store/productOptionValue/69", - "label": "Medium US" - }, - { - "valueId": "bc/store/productOptionValue/70", - "label": "Large US" + "data": [ + { + "optionId": "bc/store/productOption/108", + "optionData": { + "dropdown": { + "displayName": "Size UK", + "values": [ + { + "valueId": "bc/store/productOptionValue/68", + "label": "Small UK" + }, + { + "valueId": "bc/store/productOptionValue/69", + "label": "Medium UK" + }, + { + "valueId": "bc/store/productOptionValue/70", + "label": "Large UK" + } + ], + "overrides": [ + { + "channelLocaleOverrides": { + "context": { + "channelId": "bc/store/channel/1", + "locale": "fr" + }, + "data": { + "displayName": "Override Size UK", + "values": [ + { + "valueId": "bc/store/productOptionValue/68", + "label": "Override Small UK" + }, + { + "valueId": "bc/store/productOptionValue/69", + "label": "Override Medium UK" + }, + { + "valueId": "bc/store/productOptionValue/70", + "label": "Override Large UK" + } + ] + } } - ] - } + } + ] } } - ] - } + } + ] } } ``` @@ -105,11 +146,11 @@ The following example sets the store's global product variant option information - ```json filename="Example mutation: Set product variant options at the global level" showLineNumbers copy + ```json filename="Example mutation: Set product variant options" showLineNumbers copy { "data": { "product": { - "setProductOptionsInformation": { + "updateProductOptions": { "product": { "id": "bc/store/product/111", "options": { @@ -117,175 +158,50 @@ The following example sets the store's global product variant option information { "node": { "id": "bc/store/productOption/108", - "displayName": "Size US", + "displayName": "Size UK", "isShared": false, "values": [ { "id": "bc/store/productOptionValue/68", - "label": "Small US" + "label": "Small UK" }, { "id": "bc/store/productOptionValue/69", - "label": "Medium US" + "label": "Medium UK" }, { "id": "bc/store/productOptionValue/70", - "label": "Large US" - } - ] - } - }, - { - "node": { - "id": "bc/store/productOption/109", - "displayName": "Color", - "isShared": false, - "values": [ - { - "id": "bc/store/productOptionValue/7", - "label": "Silver" - }, - { - "id": "bc/store/productOptionValue/8", - "label": "Black" + "label": "Large UK" } - ] - } - } - ] - } - } - } - } - } - } - ``` - - - - -### Set variant options for a locale - -The following example sets product variant option information for the locale within the specified storefront channel. These override global store information. You can set the name and values for existing variant options. - - - - - ```graphql filename="Example mutation: Set product variant options for a locale" showLineNumbers copy - POST https://api.bigcommerce.com/stores/{{STORE_HASH}}/graphql - X-Auth-Token: {{ACCESS_TOKEN}} - Content-Type: application/json - Accept: application/json - - mutation ($input: SetProductOptionsInformationInput!) { - product { - setProductOptionsInformation (input: $input) { - product { - id - options (first: 2) { - edges { - node { - id - overridesForLocale( - localeContext: { - channelId: "bc/store/channel/2", - locale: "uk" - } - ) { - displayName - values { - id - label - } - } - } - } - } - } - } - } - } - ``` - ```json filename="GraphQL variables" showLineNumbers copy - { - "input": { - "productId": "bc/store/product/111", - "localeContext": { - "channelId": "bc/store/channel/2", - "locale": "uk" - }, - "data": { - "options": [ - { - "optionId": "bc/store/productOption/108", - "data": { - "dropdown": { - "displayName": "Size UK", - "values": [ - { - "valueId": "bc/store/productOptionValue/68", - "label": "Small UK" - }, - { - "valueId": "bc/store/productOptionValue/69", - "label": "Medium UK" - }, - { - "valueId": "bc/store/productOptionValue/70", - "label": "Large UK" - } - ] - } - } - } - ] - } - } - } - ``` - - - - - ```json filename="Example mutation: Set product variant options for a locale" showLineNumbers copy - { - "data": { - "product": { - "setProductOptionsInformation": { - "product": { - "id": "bc/store/product/111", - "options": { - "edges": [ - { - "node": { - "id": "bc/store/productOption/108", - "overridesForLocale": { - "displayName": "Size UK", - "values": [ - { - "id": "bc/store/productOptionValue/68", - "label": "Small UK" - }, - { - "id": "bc/store/productOptionValue/69", - "label": "Medium UK" - }, + ], + "overrides": { + "edges": [ { - "id": "bc/store/productOptionValue/70", - "label": "Large UK" + "node": { + "context": { + "channelId": "bc/store/channel/1", + "locale": "fr" + }, + "displayName": "Override Size UK", + "values": [ + { + "id": "bc/store/productOptionValue/68", + "label": "Override Small UK" + }, + { + "id": "bc/store/productOptionValue/69", + "label": "Override Medium UK" + }, + { + "id": "bc/store/productOptionValue/70", + "label": "Override Large UK" + } + ] + } } ] } } - }, - { - "node": { - "id": "bc/store/productOption/109", - "overridesForLocale": { - "displayName": null, - "values": [] - } - } } ] } @@ -299,6 +215,7 @@ The following example sets product variant option information for the locale wit + ### Remove variant options for a locale The following example removes product variant option information for the locale within the specified storefront channel. @@ -314,10 +231,10 @@ The following example removes product variant option information for the locale mutation ($input: RemoveProductOptionsOverridesInput!) { product { - removeProductOptionsOverrides (input: $input) { + removeProductOptionsOverrides(input: $input) { product { id - options (first: 2) { + options (first: 1) { edges { node { id @@ -326,11 +243,21 @@ The following example removes product variant option information for the locale id label } - overridesForLocale (localeContext: {channelId: "bc/store/channel/2", locale: "uk"}) { - displayName - values { - id - label + overrides(context: { channelId: "bc/store/channel/1", locale: "fr" }) { + edges { + node { + ... on ProductOptionOverridesForChannelLocale { + context { + channelId + locale + } + displayName + values { + id + label + } + } + } } } } @@ -347,8 +274,8 @@ The following example removes product variant option information for the locale "input": { "productId": "bc/store/product/111", "localeContext": { - "channelId": "bc/store/channel/2", - "locale": "uk" + "channelId": "bc/store/channel/1", + "locale": "fr" }, "data": { "options": [ @@ -384,55 +311,45 @@ The following example removes product variant option information for the locale { "node": { "id": "bc/store/productOption/108", - "displayName": "Size US", + "displayName": "Size UK", "values": [ { "id": "bc/store/productOptionValue/68", - "label": "Small US" + "label": "Small UK" }, { "id": "bc/store/productOptionValue/69", - "label": "Medium US" + "label": "Medium UK" }, { "id": "bc/store/productOptionValue/70", - "label": "Large US" + "label": "Large UK" } ], - "overridesForLocale": { - "displayName": null, - "values": [ - { - "id": "bc/store/productOptionValue/68", - "label": "Small UK" - }, + "overrides": { + "edges": [ { - "id": "bc/store/productOptionValue/69", - "label": "Medium UK" + "node": { + "context": { + "channelId": "bc/store/channel/1", + "locale": "fr" + }, + "displayName": null, + "values": [ + { + "id": "bc/store/productOptionValue/68", + "label": "Override Small UK" + }, + { + "id": "bc/store/productOptionValue/69", + "label": "Override Medium UK" + } + ] + } } ] } } - }, - { - "node": { - "id": "bc/store/productOption/109", - "displayName": "Color", - "values": [ - { - "id": "bc/store/productOptionValue/7", - "label": "Silver" - }, - { - "id": "bc/store/productOptionValue/8", - "label": "Black" - } - ], - "overridesForLocale": { - "displayName": null, - "values": [] - } - } } ] } @@ -446,30 +363,51 @@ The following example removes product variant option information for the locale -## Set shared variant options - -You can set information about a shared variant option for a store or a locale within a storefront channel. You must first create the shared variant options through the control panel. Changing a shared variant option affects all products that you assign to the shared variant option. You cannot customize shared variant options on a product level. +## Shared variant options -The following mutations let you set the name and values for existing shared variant options. +### Set shared variant options -### Set shared variant options at the global level +You can set information about a shared variant option for a store or a locale within a storefront channel. You must first create the shared variant options through the control panel. -The following example sets global shared variant option information for the store, from which channels inherit by default. You can set the name and values for existing variant options. +The following mutation sets the name and values for an existing shared variant option. - ```graphql filename="Example mutation: Set shared variant options at the global level" showLineNumbers copy + ```graphql filename="Example mutation: Set shared variant options" showLineNumbers copy POST https://api.bigcommerce.com/stores/{{STORE_HASH}}/graphql X-Auth-Token: {{ACCESS_TOKEN}} Content-Type: application/json Accept: application/json - mutation ($input: SetSharedProductOptionsInformationInput!) { + mutation ($input: UpdateSharedProductOptionsInput!) { sharedProductOptions { - setSharedProductOptionsInformation (input: $input) { + updateSharedProductOptions(input: $input) { sharedProductOptions { id + displayName + values { + id + isDefault + label + } + overrides(context: { channelId: "bc/store/channel/1", locale: "fr" }) { + edges { + node { + ... on SharedProductOptionOverridesForChannelLocale { + context { + channelId + locale + } + displayName + values { + id + label + } + } + } + } + } } } } @@ -478,46 +416,90 @@ The following example sets global shared variant option information for the stor ```json filename="GraphQL variables" showLineNumbers copy { "input": { - "data": { - "options": [ - { - "optionId": "bc/store/sharedProductOption/1", - "data": { - "dropdown": { - "displayName": "Fabric", - "values": [ - { - "valueId": "bc/store/sharedProductOptionValue/123", - "label": "Cotton" - }, - { - "valueId": "bc/store/sharedProductOptionValue/124", - "label": "Polyester" + "data": [ + { + "optionId": "bc/store/sharedProductOption/1", + "optionData": { + "dropdown": { + "displayName": "Fabric", + "values": [ + { + "valueId": "bc/store/sharedProductOptionValue/123", + "label": "Cotton" + }, + { + "valueId": "bc/store/sharedProductOptionValue/124", + "label": "Polyester" + } + ], + "overrides": [ + { + "channelLocaleOverrides": { + "context": { + "channelId": "bc/store/channel/1", + "locale": "fr" + }, + "data": { + "displayName": "Fabric channel override", + "values": [ + { + "valueId": "bc/store/sharedProductOptionValue/123", + "label": "Cotton channel override" + }, + { + "valueId": "bc/store/sharedProductOptionValue/124", + "label": "Polyester channel override" + } + ] + } } - ] - } + } + ] } - }, - { - "optionId": "bc/store/sharedProductOption/4", - "data": { - "swatch": { - "displayName": "Zipper color", - "values": [ - { - "valueId": "bc/store/sharedProductOptionValue/129", - "label": "Orange" - }, - { - "valueId": "bc/store/sharedProductOptionValue/130", - "label": "Green" + } + }, + { + "optionId": "bc/store/sharedProductOption/4", + "optionData": { + "swatch": { + "displayName": "Zipper color", + "values": [ + { + "valueId": "bc/store/sharedProductOptionValue/129", + "label": "Orange" + }, + { + "valueId": "bc/store/sharedProductOptionValue/130", + "label": "Green" + } + ], + "overrides": [ + { + "channelLocaleOverrides": { + "context": { + "channelId": "bc/store/channel/1", + "locale": "fr" + }, + "data": { + "displayName": "Zipper color override", + "values": [ + { + "valueId": "bc/store/sharedProductOptionValue/129", + "label": "Orange override" + }, + { + "valueId": "bc/store/sharedProductOptionValue/130", + "label": "Green override" + } + ] + } } - ] - } + } + ] } } - ] - } + } + ] } } ``` @@ -525,117 +507,72 @@ The following example sets global shared variant option information for the stor - ```json filename="Example mutation: Set shared variant options at the global level" showLineNumbers copy + ```json filename="Example mutation: Set shared variant options" showLineNumbers copy { "data": { "sharedProductOptions": { - "setSharedProductOptionsInformation": { + "updateSharedProductOptions": { "sharedProductOptions": [ { - "id": "bc/store/sharedProductOption/1" - }, - { - "id": "bc/store/sharedProductOption/4" - } - ] - } - } - } - } - ``` - - - - -### Set shared variant options for a locale - -The following example sets shared variant option information for the locale within the specified storefront channel. These override global store information. You can set the name and values for existing variant options. - - - - - ```graphql filename="Example mutation: Set shared variant options for a locale" showLineNumbers copy - POST https://api.bigcommerce.com/stores/{{STORE_HASH}}/graphql - X-Auth-Token: {{ACCESS_TOKEN}} - Content-Type: application/json - Accept: application/json - - mutation ($input: SetSharedProductOptionsInformationInput!) { - sharedProductOptions { - setSharedProductOptionsInformation (input: $input) { - sharedProductOptions { - id - } - } - } - } - ``` - ```json filename="GraphQL variables" showLineNumbers copy - { - "input": { - "localeContext": { - "channelId": "bc/store/channel/2", - "locale": "uk" - }, - "data": { - "options": [ - { - "optionId": "bc/store/sharedProductOption/1", - "data": { - "dropdown": { - "displayName": "Fabric material", - "values": [ - { - "valueId": "bc/store/sharedProductOptionValue/123", - "label": "Linen" - }, + "id": "bc/store/sharedProductOption/1", + "displayName": "Fabric", + "values": [ + { + "id": "bc/store/sharedProductOptionValue/1", + "isDefault": true, + "label": "Cotton" + }, + { + "id": "bc/store/sharedProductOptionValue/2", + "isDefault": false, + "label": "Polyester" + } + ], + "overrides": { + "edges": [ { - "valueId": "bc/store/sharedProductOptionValue/124", - "label": "Nylon" + "node": { + "context": { + "channelId": "bc/store/channel/1", + "locale": "fr" + }, + "displayName": "Fabric channel override", + "values": [] + } } ] } - } - }, - { - "optionId": "bc/store/sharedProductOption/4", - "data": { - "swatch": { - "displayName": "Color of zipper", - "values": [ - { - "valueId": "bc/store/sharedProductOptionValue/129", - "label": "Black" - }, + }, + { + "id": "bc/store/sharedProductOption/4", + "displayName": "Zipper color", + "values": [ + { + "id": "bc/store/sharedProductOptionValue/7", + "isDefault": false, + "label": "Orange" + }, + { + "id": "bc/store/sharedProductOptionValue/8", + "isDefault": true, + "label": "Green" + } + ], + "overrides": { + "edges": [ { - "valueId": "bc/store/sharedProductOptionValue/130", - "label": "Brown" + "node": { + "context": { + "channelId": "bc/store/channel/1", + "locale": "fr" + }, + "displayName": "Zipper color override", + "values": [] + } } ] } } - } - ] - } - } - } - ``` - - - - - ```json filename="Example mutation: Set shared variant options for a locale" showLineNumbers copy - { - "data": { - "sharedProductOptions": { - "setSharedProductOptionsInformation": { - "sharedProductOptions": [ - { - "id": "bc/store/sharedProductOption/1" - }, - { - "id": "bc/store/sharedProductOption/4" - } ] } } @@ -735,7 +672,7 @@ The following example retrieves variant information. You can retrieve global inf store { product(id: "bc/store/product/111") { id - options (first: 3) { + options (first: 1) { edges { node { id @@ -746,13 +683,21 @@ The following example retrieves variant information. You can retrieve global inf label isDefault } - overridesForLocale( - localeContext: { channelId: "bc/store/channel/2", locale: "uk"} - ) { - displayName - values { - id - label + overrides(context: { channelId: "bc/store/channel/1", locale: "fr" }) { + edges { + node { + ... on ProductOptionOverridesForChannelLocale { + context { + channelId + locale + } + displayName + values { + id + label + } + } + } } } } @@ -760,7 +705,7 @@ The following example retrieves variant information. You can retrieve global inf } } } - } + } ``` @@ -776,90 +721,49 @@ The following example retrieves variant information. You can retrieve global inf { "node": { "id": "bc/store/productOption/108", - "displayName": "Size", + "displayName": "Size UK", "isShared": false, "values": [ { "id": "bc/store/productOptionValue/68", - "label": "Small US", + "label": "Small UK", "isDefault": false }, { "id": "bc/store/productOptionValue/69", - "label": "Medium US", + "label": "Medium UK", "isDefault": false }, { "id": "bc/store/productOptionValue/70", - "label": "Large US", - "isDefault": false - } - ], - "overridesForLocale": { - "displayName": "Size UK", - "values": [ - { - "id": "bc/store/productOptionValue/68", - "label": "Small UK" - }, - { - "id": "bc/store/productOptionValue/69", - "label": "Medium UK" - } - ] - } - } - }, - { - "node": { - "id": "bc/store/productOption/109", - "displayName": "Color", - "isShared": false, - "values": [ - { - "id": "bc/store/productOptionValue/7", - "label": "Silver", - "isDefault": false - }, - { - "id": "bc/store/productOptionValue/8", - "label": "Black", - "isDefault": false - } - ], - "overridesForLocale": { - "displayName": null, - "values": [] - } - } - }, - { - "node": { - "id": "bc/store/productOption/130", - "displayName": "Fabric", - "isShared": true, - "values": [ - { - "id": "bc/store/productOptionValue/123", - "label": "Cotton", + "label": "Large UK", "isDefault": true - }, - { - "id": "bc/store/productOptionValue/124", - "label": "Polyester", - "isDefault": false } ], - "overridesForLocale": { - "displayName": "Fabric material", - "values": [ + "overrides": { + "edges": [ { - "id": "bc/store/productOptionValue/123", - "label": "Linen" - }, - { - "id": "bc/store/productOptionValue/124", - "label": "Nylon" + "node": { + "context": { + "channelId": "bc/store/channel/1", + "locale": "fr" + }, + "displayName": "Override Size UK", + "values": [ + { + "id": "bc/store/productOptionValue/68", + "label": "Override Small UK" + }, + { + "id": "bc/store/productOptionValue/69", + "label": "Override Medium UK" + }, + { + "id": "bc/store/productOptionValue/70", + "label": "Override Large UK" + } + ] + } } ] } diff --git a/docs/store-operations/catalog/msf-international-enhancements.mdx b/docs/store-operations/catalog/msf-international-enhancements.mdx index c7b491b7e..6f358a51c 100644 --- a/docs/store-operations/catalog/msf-international-enhancements.mdx +++ b/docs/store-operations/catalog/msf-international-enhancements.mdx @@ -10,7 +10,7 @@ For example, when selling products internationally, you can add information for Shoppers can then see key product details in the language of their choice throughout the complete checkout and post-order experience for a personalized shopping experience. This personalized shopping experience helps shoppers find and learn information about a product before purchasing. -The following pages provide sample queries: +The following pages provide example queries: - [Basic product information](/docs/store-operations/catalog/graphql-admin/product-basic-info) - [Product SEO information](/docs/store-operations/catalog/graphql-admin/product-seo-info) @@ -100,3 +100,12 @@ The API account should have the following OAuth scopes. | Products | read-only | `store_v2_products_read_only` | For more about BigCommerce OAuth scopes, see [API Accounts and OAuth Scopes](/docs/start/authentication/api-accounts#oauth-scopes). + + +## Deprecated + +For some features, the following fields are deprecated, when specifying a channel and locale. Use the `overrides` field instead. +- `localeContext` +- `overridesForLocale` + +The example query pages contain the most up-to-date queries. Deprecated fields can be found in the [GraphQL Admin API reference](https://developer.bigcommerce.com/graphql-admin/reference).