how to get products By Category ID

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
14 anos atrás
Hi,

I want to get products categories wise, any help please.
14 anos atrás
Have a look at the code used on the Category pages /Templates/Categories/ProductsInGrid.ascx.cs

In particular ProductCategoryManager.GetProductCategoriesByCategoryID(CategoryID)

Hope this helps,
Ben
14 anos atrás
Thank you so much, its working fine, i want to know that how can i add multiple products into cart, I've got category wise products and have a checkbox in front
of each product, whether i should use the following or something else to add products into cart,


I've a categories into the datalist and against each category there are relitive products.

foreach (DataListItem dtItem in dlCategories.Items)
  {
     foreach (RepeaterItem item in rptMultiProducts.Items)
     {
      // code after getting controls
         if (cbAddToCart.Checked)
         {
            if (ProductManager.DirectAddToCartAllowed(productID, out productVariantID))
            {
               ShoppingCartManager.AddToCart(ShoppingCartTypeEnum.ShoppingCart, productVariantID, new List<int>(), string.Empty, 1);
            }
        }

     }
  }
  Response.Redirect("~/ShoppingCart.aspx");
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.