Failed to create variant

Failed to create variant on WooCommerce

Issue:

A SKU item within the product is failing to be created on the WooCommerce website.

Applies to:

woocommerce

Solution:

Investigate what could be causing the product to break when trying to add a variant on WooCommerce. The following are reasons for this queue error:

  • The product was first created from Stock2Shop as as simple product but the product in Stock2Shop has been changed to a variable product.
  • Your variable options (If you create variable products from Stock2Shop) on Stock2Shop do not match your website options.

You will need to change the WooCommerce product set up:

  • The product was initially created as a simple product but now needs to change to a variable product.
  • You need to make sure options match S2S / ERP Accounting system.

Alternatively you can remove the product from WooCommerce manually and recreate the whole variable product from S2S.

How to change the product in WooCommerce

  • Log in to WooCommerce.
  • Click on Products > All Products.
  • Search for the SKU of the product that has already synced. Vew all SKUs on the product in Stock2Shop (ie the other variable product that was created as a simple product. If you have a small and a large size SKU within one product, you may need to search for the small which was loaded first).
  • Click into the product > scroll to Product Data > change Simple Product to Variable Product > click Update.
  • Add variable SKU and options: Product Data > Variations > Add Variation > Go.
  • Add in the SKU info of the variation: SKU, qty, price, and option (eg small) as per the info on Stock2Shop.
  • Update the product page if necessary (eg description , title, image).
  • Reset the product in Stock2Shop: Products > View > Search > 3 dots > Edit > CHANNELS tab > click REMOVE ALL on the channel that needs resetting > click Save on the GENERAL and VARIANTS tabs.
  • Skip the queue error “Failed to create variant {SKU}” and any further “update” queue errors (that were already queued), because a new “add” item will be queued to relink.

How to re-add the product from Stock2Shop

  • Delete the simple SKU manually on WooCommerce (make sure to empty trash).
  • Log in to Stock2Shop.
  • Search for the SKU on Stock2Shop: Products >View > Search > 3 dots > Edit > CHANNELS tab > click REMOVE ALL on the channel that needs resetting > click Save on the GENERAL and VARIANTS tabs.
  • Skip the queue error “Failed to create variant {SKU}” and any further “update” queue errors (that were already queued), because a new “add” item will be queued to relink.

Dealing with queue errors

You will need to skip the “Failed to create variant {SKU}” queue error and any further “update” queue errors for this specific product if they were already in the queue. It can be multiple SKUs, depending on the number of variants connected to the product. A new “add” item will appear at the back of the queue to re-add the product to the website.