Courses Related to Bundle Products not shows when buy the Parent

Thursday, December 26, 2024 6:06:17 PM
  • Posted: Tuesday, February 8, 2022 7:30 PM
  • 2
Quick and dirty fix, go to \src\Business\Grand.Business.Marketing\Services\Courses\CourseService.cs
add the next lines between var pl and var q2

            ////--------------Rafie ---------------------
            var connection = DataSettingsManager.LoadSettings();
            IRepository<Domain.Catalog.Product> _productRepository = new Domain.Data.Mongo.MongoRepository<Domain.Catalog.Product>(connection.ConnectionString);
            
            List<string> AllBundleProductsIds = new System.Collections.Generic.List<string>();
            foreach (var ProductId in pl)
            {
                var ProductDetails = _productRepository.Table.FirstOrDefault(x => x.Id == ProductId);
                if (ProductDetails.BundleProducts.Any())
                {
                    foreach (var item in ProductDetails.BundleProducts)
                    {
                        AllBundleProductsIds.Add(item.ProductId);
                    }
                }
            }

            pl.AddRange(AllBundleProductsIds);
            ////-----------------------------------------
0
back to top
Filters