Posted on 20/06/2016 15:41:20
I am using Core 8.8.0.6
I made a function trying to get product info. The product has stock and price. When I tried Product.GetAllProducts() I am missing alot of products in my productcollection, how is that possible? If I use Product.GetProductByNumber, I am able to get the product, but other methods is giving me NULL reponse back. Product.GetProductsBySql("SELECT * FROM [EcomProducts]"); is also not getting all the products.
public static ProductStockModel GetResults(string productId, string variantId)
{
Product product = Product.GetProductByID(productId, variantId);
ProductStockModel ProductResult = new ProductStockModel();
if (product == null)
{
return ProductResult;
}
ProductResult.Number = productId;
ProductResult.VariantId = variantId;
ProductResult.Colors = GetVariantColors(product.VariantGroups);
return ProductResult;
}