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

ProductProperties do not auto-populate the way OptionTypes and OptionValues do #15

Open
jzisser9 opened this issue Jan 13, 2020 · 0 comments

Comments

@jzisser9
Copy link
Contributor

I have a column in a .csv file meant to populate a Spree::ProductProperty called "product_family". I wrote the column name in the csv as [Prop]product_family, but found that after importing the csv using SolidusImportProducts::Import.call, I found the generated products did not have the product property field set.

After digging into the gem's code a bit, I found that a Spree::Property with a given name must exist in order for SIP to set the product property with the same name. So we fixed this issue by first creating the Spree::Property:

Spree::Property.create!(
    name: 'product_family', presentation: 'Product Family'
  )

Doing this before the import caused products to have the desired property.

This requirement wasn't obvious to me, considering OptionTypes and OptionValues are generated automatically if they don't exist when encountered by the importer. I'd be up for taking a crack at implementing the fix to make ProductProperties automatic, but in the meantime, would you consider updating the README to make a note about this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant