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

New Products get synced into "Draft" #423

Open
2gen opened this issue Apr 11, 2023 · 2 comments
Open

New Products get synced into "Draft" #423

2gen opened this issue Apr 11, 2023 · 2 comments

Comments

@2gen
Copy link

2gen commented Apr 11, 2023

Expected behavior

Products that are initially not set as visible during the sync should be updated to visible on the next sync after the "visible on store front" option is checked in big commerce.

Actual behavior

Products get stuck in draft mode and never sync into the publish state.

Steps to reproduce behavior

  1. Add a product to big commerce with no thumbnail and no visibility.
  2. Run wordpress product sync.
  3. Update product on bigcommerce with thumbnail and set to be visible.
  4. Run wordpress product sync again.

Workaround or possible solution

Delete all products from wp entirely via sql and resync them all again.

DELETE FROM wp_posts WHERE post_type='bigcommerce_product'; DELETE FROM wp_postmeta WHERE post_id NOT IN (SELECT id FROM wp_posts); DELETE FROM wp_term_relationships WHERE object_id NOT IN (SELECT id FROM wp_posts)

@JleonardNavitend
Copy link

We are having the same problem. Were you able to find a solution to this? Deleting and resyncing unfortunately didn't solve it.

@2gen
Copy link
Author

2gen commented Sep 28, 2023

We are having the same problem. Were you able to find a solution to this? Deleting and resyncing unfortunately didn't solve it.

Yeah I found that deleting the drafts and resyncing those also helped. I made a list of instructions for doing it internally here but I think I can share it with you.

1: put site into maintenance mode
https://site-url/wp-admin/admin.php?page=maintenance

2: Delete all products and date with sql script via phpmyadmin.
DELETE FROM wp_posts WHERE post_type='bigcommerce_product';
DELETE FROM wp_postmeta WHERE post_id NOT IN (SELECT id FROM wp_posts);
DELETE FROM wp_term_relationships WHERE object_id NOT IN (SELECT id FROM wp_posts)

3: goto https://site-url/wp-admin/edit.php?post_type=bigcommerce_product and select"All Products" in the drop down next to the sync button then click "Sync Products"

4: Wait for it to finish then go to https://site-url/wp-admin/edit.php?post_status=draft&post_type=bigcommerce_product and delete all the drafts.

5: Repeat step 3

6: removed because not relevant to anyone but us
7: removed because not relevant to anyone but us
8: removed because not relevant to anyone but us

9: take site out of maintenance mode
https://site-url/wp-admin/admin.php?page=maintenance
Reason for step 4 and 5: The bigcommerce plugin has a bug in it where it wrongly marks visible products as draft. Deleting all drafts and syncing again seems to fix it don't know why.

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

No branches or pull requests

2 participants