I don't understand what 'options' are for

ko-lem-pc
Tourist
7 0 5

In selling plan groups and selling plans, there is an options attribute. I just put in a dummy value there though since I don't understand how I'm suppose to use them.

 

For selling plan groups, I just iterate through all its selling plans and display their name. What's options for here?

For selling plans, I don't get how there can be multiple options for a single selling plan.

Replies 3 (3)

Jason
Shopify Expert
11190 225 2283

Options are what would show to the customer front end. For example, letting them pick a frequency so you can in turn can set up the correct plan. Options are shown in the docs so maybe the example here may help you:

https://shopify.dev/tutorials/create-manage-selling-plans

★ I jump on these forums in my free time to help and share some insights. Not looking to be hired, and not looking for work. http://freakdesign.com.au ★
ko-lem-pc
Tourist
7 0 5

In that link, it shows a selling plan group with 3 selling plans. And the selling plan group has an array of options with one option: `["Delivery every"]`. I don't understand why this is an array. 

The selling plan options then are just string that looks like it should be concatenated with the group option. Not sure I understand.

 

In this page https://shopify.dev/tutorials/customize-theme-showing-selling-plan-groups-and-selling-plans#show-ava... it shows 2 ways to display in the front end:

  1. The first one is just to iterate through the selling plans and display their name. Looks very straightforward and this is what I'm doing. There's no need for options here but options is a required attribute.
  2. Second one uses options but I don't understand why it's necessary. Why not just the first way.

 

Webdibs
Shopify Partner
30 2 9

I have the same question. I don't see why should I use options (Besides giving the user an option to customize their name).

Why shouldn't I use it?

Stretching the limits of Shopfy, Wordpress & WooCommerce since 2010.