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

Products without variants don't show up in the admin panel #609

Closed
BitPatty opened this issue Jan 2, 2021 · 6 comments
Closed

Products without variants don't show up in the admin panel #609

BitPatty opened this issue Jan 2, 2021 · 6 comments
Assignees
Labels
type: bug 🐛 Something isn't working
Milestone

Comments

@BitPatty
Copy link

BitPatty commented Jan 2, 2021

Describe the bug
Products created via the createProduct mutation in the admin api don't show up in the admin panel unless a product variant is created.

To Reproduce
Steps to reproduce the behavior:

  1. Create a product with the createProduct mutation in the admin-api
  2. Go to the admin panel
  3. The product is not listed but accessible by specifying the id in the url (though the manage variants view is broken)

Expected behavior
It should be possible to create a product without a variant or else require a product variant in the createProduct mutation.

Environment (please complete the following information):

  • @vendure/core version: 0.18.0
  • Nodejs version 14.15.1
  • Database (mysql/postgres etc): mysql

Additional context
Test Product 123 not showing up in the admin panel:
image

Broken variant management in the admin panel after accessing the product via its id (/admin/catalog/products/:id)
image

@BitPatty BitPatty added the type: bug 🐛 Something isn't working label Jan 2, 2021
@michaelbromley
Copy link
Member

The underlying reason for this is that the product list view uses the search query to get the list of products/variants to display. This in turn in based on the search index, which only knows about ProductVariants.

I'm not yet sure how to solve this, though I agree it needs fixing.

@michaelbromley michaelbromley added this to the v1.0.0 milestone Jan 5, 2021
@Ayzrian
Copy link

Ayzrian commented Jan 16, 2021

Can't we add a "default" product variant to the product when we create it?

@michaelbromley
Copy link
Member

@Ayzrian Yes, this could be a solution, I'd have to explore the implications of this.

@arjunmurali1993
Copy link

I've created a few products and product variants using the graphql mutations createProduct and createProductVariants from the admin-api playground.
These products are successfully created and I can see them when I query through the graphql query for products, but they don't show up in the admin UI.
I've also rebuilt the search index in the admin ui and also ensured that the enabled property on all the products and productVariants are set to true.

Versions from my package.json file below:

"dependencies": {
    "@pinelab/vendure-plugin-google-storage-assets": "^1.2.1",
    "@vendure/admin-ui-plugin": "3.0.0",
    "@vendure/asset-server-plugin": "3.0.0",
    "@vendure/core": "3.0.0",
    "@vendure/email-plugin": "3.0.0",
    "better-sqlite3": "^9.6.0",
    "dotenv": "16.3.1",
    "sharp": "^0.33.4"
  },
  "devDependencies": {
    "@vendure/cli": "^3.0.0",
    "concurrently": "8.2.2",
    "ts-node": "^10.9.2",
    "typescript": "^5.5.4"
  }

I recently updated to version 3.0.0 from version 2.1

Am I missing something? Can someone please help?

@michaelbromley
Copy link
Member

Hi, since v2.x we no longer use the search query to power the admin ui product list. So the search index is definitely not the issue here.

My first idea is that if you are using multiple channels, maybe they got created in a different channel that what you expect?

@arjunmurali1993
Copy link

Hi, since v2.x we no longer use the search query to power the admin ui product list. So the search index is definitely not the issue here.

My first idea is that if you are using multiple channels, maybe they got created in a different channel that what you expect?

Ah you were absolutely correct @michaelbromley. I had created a channel for this particular project but all the graphql mutations had been creating products in the Default Channel. Checked that and sure enough, all the products and facets show up in the admin UI.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🐛 Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants