You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make sure you have included the below details when open an issue. Thank you.
Wordpress version, WooCommerce version and WooCommerce.NET version
We updated Wordpress core 5.9.2 -> 6.0 and WooCommerce 6.3.1->6.6.1
Steps to replicate the issue
The below method is used to get a list of published products:
public async Task<List<Product>> GetPublishedProducts()
{
Dictionary<string, string> dic = new Dictionary<string, string>();
dic.Add("per_page", "100");
int pageNumber = 1;
dic.Add("page", pageNumber.ToString());
dic.Add("status", "publish");
List<Product> products = new List<Product>();
bool endWhile = false;
while (!endWhile)
{
var productsTemp = await _WCObject.Product.GetAll(dic);
if (productsTemp.Count > 0)
{
products.AddRange(productsTemp);
pageNumber++;
dic["page"] = pageNumber.ToString();
}
else
{
endWhile = true;
}
}
return products;
}
Then, iterating the products, I check for variations so I can grab them too:
foreach (var product in products)
{
if (product.variations != null && product.variations.Count > 0)
{ ...
As of our WooCommerce update (above), the total amount of variable products pulled from our production environment went down from 577 to 29. The simple products are unchanged. The above check is showing product.variations.Count is zero for products that definitely have variations in WooCommerce.
Details of the error message if there is any
N/A
Any insight would be appreciated. I don't know why 49 are still working; at face value they don't have any differences with the ones that aren't.
EDIT
I'm using v0.8.2. I just updated to v0.8.4 and I'm testing--will follow up ASAP
The text was updated successfully, but these errors were encountered:
Update: v0.8.4 has the same issue. I will revert WooCommerce version, but I'd still like to properly understand this issue.
JayMoorhouse
changed the title
Product.Variations count is zero for ~90% of products as of July 1 2022
Product.Variations count is zero for ~90% of products with WooCommerce 6.6.1 update
Jul 5, 2022
Update: _WCObject.Product.Variations.GetAll still works and returns variations on a product that has variations. Just odd that the Product.Variations.Count is 0. Now I have to run it on every product instead of only the ones that has variation.count > 0 which is fine, but obviously a lot worse for performance.
Make sure you have included the below details when open an issue. Thank you.
Wordpress version, WooCommerce version and WooCommerce.NET version
Steps to replicate the issue
The below method is used to get a list of published products:
Then, iterating the products, I check for variations so I can grab them too:
As of our WooCommerce update (above), the total amount of variable products pulled from our production environment went down from 577 to 29. The simple products are unchanged. The above check is showing
product.variations.Count
is zero for products that definitely have variations in WooCommerce.Details of the error message if there is any
N/A
Any insight would be appreciated. I don't know why 49 are still working; at face value they don't have any differences with the ones that aren't.
EDIT
I'm using v0.8.2. I just updated to v0.8.4 and I'm testing--will follow up ASAP
The text was updated successfully, but these errors were encountered: