Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update product_option_types Seed File #4680

Merged
merged 1 commit into from
Nov 8, 2022
Merged

Update product_option_types Seed File #4680

merged 1 commit into from
Nov 8, 2022

Conversation

Naokimi
Copy link
Contributor

@Naokimi Naokimi commented Oct 20, 2022

Summary

When tinkering with a freshly created solidus app, I was surprised to see that Solidus Women's T-Shirt was missing an option to add variants.

image

Further investigation revealed that this due to Spree::ProductOptionType not being created when running seeds and that it impacts all clothing objects. I understand that this might have been done due to lack of images for the other variants, but one would expect to see the option to manually add the variants (and related images) through the admin panel.

With this commit all clothing options are assigned variants and the New Variant button i made visible in the admin panel:

image

It also brings the option types in line with the ones displayed in demo.solidus.io

image

Checklist

Check out our PR guidelines for more details.

The following are mandatory for all PRs:

  • I have written a thorough PR description.
  • I have kept my commits small and atomic.
  • I have used clear, explanatory commit messages.

The following are not always needed (cross them out if they are not):

  • I have added automated tests to cover my changes.
  • I have attached screenshots to demo visual changes.
  • I have opened a PR to update the guides.
  • I have updated the readme to account for my changes.

@codecov
Copy link

codecov bot commented Oct 20, 2022

Codecov Report

Merging #4680 (8207b76) into master (5f628dd) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #4680   +/-   ##
=======================================
  Coverage   86.24%   86.24%           
=======================================
  Files         574      574           
  Lines       14596    14596           
=======================================
  Hits        12588    12588           
  Misses       2008     2008           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

"Solidus T-Shirt", "Solidus Long Sleeve", "Solidus Women's T-Shirt",
"Solidus Snapback Cap", "Solidus Hoodie Zip", "Ruby Hoodie",
"Ruby Hoodie Zip", "Ruby Polo"
]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do all of these products have size/color variants? If yes 👍, if no what's the benefit of adding the option types when there's only the master variant?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I'll try to express again the thought process behind these changes:

  1. I installed a fresh solidus app locally
  2. Noticed that Solidus Women's T-Shirt did not have any variants (size or colour)
  3. Went to admin panel to add the variants manually
  4. Couldn't find how to add a variant

After further investigation I understood that it was because the option types were not assigned to the product.

I just thought it would be a good idea to skip the step of adding the option type and be able to add the variant from the get go.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The thing is that you add one or more option types to a product when that product has variants. Having an option type assigned but no variants might be considered an inconsistency because it means we are assuming that the product has some variants, but we didn't create them yet.

On a side note, in terms of consistency, with the clothing products we are creating in the demo, it's acceptable not to have the color option type, but maybe the size option type and its variants (eg. s/m/l) should always be present.

My proposal is to add the size option types and variants to all of them and keep the Solidus T-Shirt with both. WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, will modify as suggested

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By the way, maybe it's not clear or easy to add a variant to a product without option types. If you have any suggestions on how to improve it, let me know!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 5875a59

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My proposal is to add the size option types and variants to all of them and keep the Solidus T-Shirt with both. WDYT?

If that's what we want to communicate, I think it'd be better to refactor instead of:

  1. Manually select clothing products and add size & color option types.
  2. Manually select the rest of the clothing products and add the size option type.

Do:

  1. Manually select clothing products and add color option type.
  2. Select all clothing products and add the size option type.

That way, we don't need to visually confirm that we do not forget any clothing product to add the size, plus we're safe if we add new items.

WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implemented you suggestion in 9eda486

@kennyadsl kennyadsl added the type:enhancement Proposed or newly added feature label Oct 20, 2022
Copy link
Member

@kennyadsl kennyadsl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Thanks Paulo!

Copy link
Contributor

@waiting-for-dev waiting-for-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @Naokimi! Left two suggestions, let me know what you think 🙂

"Solidus T-Shirt", "Solidus Long Sleeve", "Solidus Women's T-Shirt",
"Solidus Snapback Cap", "Solidus Hoodie Zip", "Ruby Hoodie",
"Ruby Hoodie Zip", "Ruby Polo"
]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My proposal is to add the size option types and variants to all of them and keep the Solidus T-Shirt with both. WDYT?

If that's what we want to communicate, I think it'd be better to refactor instead of:

  1. Manually select clothing products and add size & color option types.
  2. Manually select the rest of the clothing products and add the size option type.

Do:

  1. Manually select clothing products and add color option type.
  2. Select all clothing products and add the size option type.

That way, we don't need to visually confirm that we do not forget any clothing product to add the size, plus we're safe if we add new items.

WDYT?

},
{
product: solidus_snapback_cap,
option_values: [small],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that we're adding a bunch of new variants, it'd be suitable to leverage automation to create all the possible combinations. However, you're building on top of what we already had, so feel free to ignore this suggestion if you think it deserves a separate PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would personally prefer to refactor it in a separate PR

It is unexpected that the loading of samples only provides size and
colour options to Solidus T-Shirt. This commit creates
`Spree::ProductOptionType`s for all clothing options and adds size
variants for the clothes which were missing any.

It also updates the names of the generated `Spree::OptionType`s to match
the ones from demo.solidus.io.
Copy link
Contributor

@waiting-for-dev waiting-for-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

@waiting-for-dev waiting-for-dev merged commit 53d8263 into solidusio:master Nov 8, 2022
@waiting-for-dev waiting-for-dev added the changelog:solidus_sample Changes to the solidus_sample gem label Dec 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:solidus_sample Changes to the solidus_sample gem type:enhancement Proposed or newly added feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants