Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Oct 20, 2023. It is now read-only.
/theme-scriptsPublic archive

Fix reference to product object property#154

Open
LukaszFormela wants to merge2 commits intoShopify:master
base:master
Choose a base branch
Loading
fromLukaszFormela:fix-reference-to-product-object

Conversation

@LukaszFormela
Copy link

@LukaszFormelaLukaszFormela commentedFeb 23, 2021
edited
Loading

There is a discrepancy between JSON returned fromfetch('/products/PRODUCT_HANDLE.js') and{{ product | json }}.

In first one,options property contains array of objects:

options: [   {name: "Option1", position: 1, values: Array(4)},   {name: "Option2", position: 2, values: Array(4)},   {name: "Option3", position: 3, values: Array(3)},]

The latter returnsoptions property that contains direct option names:

options: [   'Option1',   'Option2',   'Option3',]

To prevent errors being thrown while using this in conjunction with theme-product-form.js on JSON returned with liquid tag, we need to do a quick check on what type ofoptions property does current product object contain.

Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

@LukaszFormela

[8]ページ先頭

©2009-2025 Movatter.jp