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

Error when saving product without variants #345

Closed
nfourtythree opened this issue May 16, 2018 · 1 comment
Closed

Error when saving product without variants #345

nfourtythree opened this issue May 16, 2018 · 1 comment
Assignees
Labels
💡 enhancement Ideas and suggestions

Comments

@nfourtythree
Copy link
Contributor

Description

If you create a new product and delete the initial blank variant you get an error

Argument 1 passed to craft\commerce\elements\Product::setVariants() must be of the type array, string given

The reason that I came across this because I basically want a product with all the product goodness and data but at a certain time it can't be purchased.

I would be able to do this but you can't disable a defaultVariant.

I understand this is an edge case so I have taken that into account.

Steps to reproduce

  1. Create new multi-variant product
  2. Delete initial blank variant
  3. Save product

Additional info

  • Craft version: Craft Pro 3.0.7
  • PHP version: 7.1.17
  • Database driver & version: MySQL 5.7.22
  • Plugins & versions: Craft Commerce | 2.0.0-beta.4.1
@lukeholder lukeholder self-assigned this May 16, 2018
@lukeholder lukeholder added the 💡 enhancement Ideas and suggestions label May 16, 2018
@lukeholder
Copy link
Member

Hmmm, would rather make the enabled and disabled status a publishing feature, and then add a separate 'enabled for sale' checkbox to variants. Will look to add it to the next release.

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

No branches or pull requests

2 participants