You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given a product with variants set up (with existing option groups),
trying to add a new option group to the product by calling POST /api/v1/products/:product_id/variants with the variants field but without the options field
result in an error.
Expected Behavior
For a product that has existing option groups i.e. option_data is not empty e.g.
attempt to add another entry to the option_data by calling POST /api/v1/products/:product_id/variants with a request body with a variants field but without an options field e.g.
attempt to add another entry to the option_data by calling POST /api/v1/products/:product_id/variants with a request body with a variants field but without an options field e.g.
and the endpoint responds with an error Undefined index: sizewith stack trace pointing to vendor/getcandy/candy-api/src/Core/Products/Models/ProductVariant.php:103.
Possible Solution
Steps to Reproduce
Create a product
Create a variant for the product: POST /api/v1/products/:product_id/variants with request body:
Observe the API endpoint responds with an error Undefined index: size.
Context (Environment)
getcandy/candy-api: version 0.11.5 OS: MacOS 11.1
I want to add a new option group to a product that already has existing option groups.
For example, an admin could decide to create a new option group size for a T-shirt product that already has a color option group.
On the current admin hub, I find it impossible to achieve such a feat - it's only possible to add new options to an existing option group. Using the same example above, this means an admin could only add more options to the existing color option group e.g. add grey color to the options, but not adding a new option group size.
Detailed Description
The text was updated successfully, but these errors were encountered:
Given a product with variants set up (with existing option groups),
trying to add a new option group to the product by calling
POST /api/v1/products/:product_id/variants
with thevariants
field but without theoptions
fieldresult in an error.
Expected Behavior
For a product that has existing option groups i.e.
option_data
is not empty e.g.attempt to add another entry to the
option_data
by callingPOST /api/v1/products/:product_id/variants
with a request body with avariants
field but without anoptions
field e.g.updates the
option_data
column in DB toand the endpoint responds with success status.
Current Behavior
For a product that has existing option groups i.e.
option_data
is not empty e.g.attempt to add another entry to the
option_data
by callingPOST /api/v1/products/:product_id/variants
with a request body with avariants
field but without anoptions
field e.g.updates the
option_data
column in DB toand the endpoint responds with an error
Undefined index: size
with stack trace pointing tovendor/getcandy/candy-api/src/Core/Products/Models/ProductVariant.php:103
.Possible Solution
Steps to Reproduce
POST /api/v1/products/:product_id/variants
with request body:POST /api/v1/products/:product_id/variants
with request body:Undefined index: size
.Context (Environment)
getcandy/candy-api: version 0.11.5
OS: MacOS 11.1
I want to add a new option group to a product that already has existing option groups.
For example, an admin could decide to create a new option group
size
for a T-shirt product that already has acolor
option group.On the current admin hub, I find it impossible to achieve such a feat - it's only possible to add new options to an existing option group. Using the same example above, this means an admin could only add more options to the existing
color
option group e.g. addgrey
color to the options, but not adding a new option groupsize
.Detailed Description
The text was updated successfully, but these errors were encountered: