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

It should be possible to set a flag for auto-publishing of products on create and/or update #66

Open
butenkor opened this issue Jan 24, 2016 · 6 comments

Comments

@butenkor
Copy link
Member

No description provided.

@pgbytes
Copy link
Contributor

pgbytes commented Feb 14, 2016

Publish Updates:

Possible configs

  • always
  • published
  • stagedAndPublishedOnly
  • publishedOnly

In case of existing product

  • always: published in all cases.
  • publishedOnly: published if it was already published
    • published = true, does not check any other conditions.
  • stagedAndPublishedOnly: published with the staged changes and was already published
    • hasStagedChanges = false and published = true

In case of new product

  • not supported yet, as it requires a separate publish action.

@pgbytes
Copy link
Contributor

pgbytes commented Feb 14, 2016

@butenkor @emmenko @PhilippSpo @hajoeichler please confirm if this needs to be implemented as stated above.
Also need suggestions on how we can handle the publishing of new products.
It would require a separate step for publishing new products, since the update action cannot be appended to the create method.

@butenkor
Copy link
Member Author

@panshul007 "published" and "publishedOnly" might be not valid use cases, right? There is no need to publish already published product if it does not have staged changes (application has to check that otherwise you will get API error). Here "always" will cover the requirement of both.

Question: If product does not have staged changes yet but you have generated update actions for it to send you will assume it has staged changes, right?

API might provide publishing on create. Just add your votes: http://support.sphere.io/forums/201737-api/suggestions/11565363-support-product-publishing-on-product-create-reque ;)

Separate step for publishing on create sounds ok and i think currently there is no other way.

@butenkor
Copy link
Member Author

So after discussion we have now probably only 2 use cases to consider:

always -> hasStagedChanged = true
publishedOnly- > (hasStagedChanged = true && (old product was published before))

@pgbytes
Copy link
Contributor

pgbytes commented Feb 15, 2016

The current feature has been implemented for Price updates only. But needs to be called in the product import as well. Refer to this commit dfeb920
for extending the functionality with relevant tests for the product import.
Also the condition for new products needs to be considered for this feature.
Please refer to the publishingStrategy description here: https://github.com/sphereio/sphere-product-import/blob/master/readme/price-importer.md#configuration

@pgbytes
Copy link
Contributor

pgbytes commented May 2, 2016

Also consider publishing new products according to the publishing strategy as now it is possible from the API to publish new products on creation without an extra request.

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

2 participants