in

dashCommerce

An ASP.NET Open Source e-Commerce Application

Trouble saving new product with no Attributes

Last post 02-12-2008 7:17 PM by yitzchok. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 02-12-2008 2:32 PM

    Trouble saving new product with no Attributes

    When I try and save the SKUs for a product with no attributes, it's giving me the following error:

    A critical error has occurred: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index

    Anyone else having this issue?  I've been able to create a product with attributes and was able to save them fine.

    Ostrich99

  • 02-12-2008 3:02 PM In reply to

    Re: Trouble saving new product with no Attributes

    This should do it
     *************Web\admin\controls\product\sku.ascx.cs************ // saving the sku

    line:186
        protected void btnSave_Click (object sender, EventArgs e) {
          try {
            SkuCollection skuCollection = new SkuCollection();
            Sku sku;
    +        *******if (associatedAttributeCollection != null && associatedAttributeCollection.Count > 0)*******
                  CreateSkus(associatedAttributeCollection[0], 0, product.BaseSku);
              for(int i = 0;i < skus.Count;i++) {
              sku = new Sku();

    Find a bug? Create a Work Item for a fast response.. Want to help? Create a patch for us!
  • 02-12-2008 3:28 PM In reply to

    Re: Trouble saving new product with no Attributes

    Hi,

    That change just stops the function which creates the items SKUs from running and this leaves you without anything in dashCommerce_Store_Sku for that product - which means you cannot buy the item as the inventory is 0. If you add it manually it works as expected.

    You will also notice that even after that code line you get the same error appear on the images tab.

    Regards,

    Steve

     

     

  • 02-12-2008 3:31 PM In reply to

    Re: Trouble saving new product with no Attributes

     Oh interesting I'll check that out

    Find a bug? Create a Work Item for a fast response.. Want to help? Create a patch for us!
  • 02-12-2008 7:17 PM In reply to

    Re: Trouble saving new product with no Attributes

    Now try this

    if (associatedAttributeCollection != null && associatedAttributeCollection.Count > 0) {
          CreateSkus(associatedAttributeCollection[0], 0, product.BaseSku);
            } else {
          skus.Add(product.BaseSku);
    }
    Find a bug? Create a Work Item for a fast response.. Want to help? Create a patch for us!
Page 1 of 1 (5 items)