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

Variant JavaScript error in Craft Commerce 3 #1273

Closed
kennethormandy opened this issue Feb 8, 2020 · 0 comments
Closed

Variant JavaScript error in Craft Commerce 3 #1273

kennethormandy opened this issue Feb 8, 2020 · 0 comments

Comments

@kennethormandy
Copy link

Description

Products with no variants, which I believe is now the default, seems to cause a JavaScript error in Craft 3.4 and Craft Commerce 3 in the control panel.

Screenshot 2020-02-07 16 34 43

I’m thinking this line might be causing the problem:

hasVariants: {{ productType.hasVariants|raw }},

Steps to reproduce

  1. Add a new User select field to a Product
  2. Add a new Product, of a Product Type that doesn’t have Variants. You’ll be able to use the User select field.
  3. Edit that product. You won’t be able to use the User select field, as the JS won’t work due to this error.

Additional info

  • Craft version: 3.4.5
  • PHP version: 7.3
  • Database driver & version: pgsql
  • Plugins & versions: Commerce 3.0.6

This is a default Craft CMS (3.3 → 3.4) and Craft Commerce (2.x → 3.x) install, using the default products.

kennethormandy added a commit to kennethormandy/craft-commerce that referenced this issue Feb 8, 2020
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

Successfully merging a pull request may close this issue.

1 participant