an ASP.NET Open Source CMS & eCommerce platform
Search:
Skip Navigation LinksHome > DotShoppingCart Forums > Support > Using DotShoppingCart > Product Customization on Checkout?
Last Post 1/21/2011 3:44:42 PM By lukezy. 20 replies.
Page 2 of 2 (21 posts) << First < Prev 1 2 Next > Last >> 
1/19/2011 2:05:21 PM
RMI-Jon
Posts: 24
Joined: 3/4/2009
Location:Ohio
Re: Product Customization on Checkout?
Where would I find that file?
1/19/2011 2:31:00 PM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: Product Customization on Checkout?
The store procedure is located at your SQL server. Use SQL management studio to connect to your server and then make the change.
DotShoppingCart Staff
1/21/2011 6:37:34 AM
RMI-Jon
Posts: 24
Joined: 3/4/2009
Location:Ohio
Re: Product Customization on Checkout?
I inserted that line, but now when I try to add the product the second time with different information it returns this error:
 
<span> 

Server Error in '/shop' Application. <hr color="#c0c0c0" size="1" width="100%" />

Cannot insert duplicate key row in object 'dbo.DSC_Cart_Item' with unique index 'IX_DSC_Cart_Item_cardId_productId_attributeIds'.
The statement has been terminated.

</span>Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Cannot insert duplicate key row in object 'dbo.DSC_Cart_Item' with unique index 'IX_DSC_Cart_Item_cardId_productId_attributeIds'.
The statement has been terminated.

Source Error:

<table width="100%" bgcolor="#ffffcc"> <tbody> <tr> <td>
Line 133:        if (!Product.Status.Orderable)
Line 134:            return;
Line 135:        lblNotEnoughStock.Visible = !AddToCart(AddToCartControl.Quantity, SelectedAttributeValueIds, CustomField);
Line 136:    }
Line 137:}
</td> </tr> </tbody> </table>
1/21/2011 9:43:27 AM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: Product Customization on Checkout?
Looks like the index needs to be changed to non unique. Try running the following sql script.
 
DROP INDEX [IX_DSC_Cart_Item_cardId_productId_attributeIds]
    ON [dbo].[DSC_Cart_Item];
 
CREATE NONCLUSTERED INDEX [IX_DSC_Cart_Item_cardId_productId_attributeIds]
    ON [dbo].[DSC_Cart_Item]([cartId] ASC, [productId] ASC, [attributeValueIds] ASC)  
DotShoppingCart Staff
1/21/2011 9:55:52 AM
RMI-Jon
Posts: 24
Joined: 3/4/2009
Location:Ohio
Re: Product Customization on Checkout?
It now returns this error when the product is added the second time:
 

Input string was not in a correct format.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.FormatException: Input string was not in a correct format.

Source Error:

<table width="100%" bgcolor="#ffffcc"> <tbody> <tr> <td>
Line 44:                         valueids.Add(valueid);
Line 45:                     } else if (c is RadioButtonList) {
Line 46:                         int valueid = int.Parse(((RadioButtonList)c).SelectedValue);
Line 47:                         if (0 == valueid)
Line 48:                             continue; // not selected
</td> </tr> </tbody> </table>
Source File: e:\docs\www.rettigmusic.com\DotShoppingCartSuiteV4.0.3\Web\Store\AttributeSelection.ascx.cs    Line: 46

1/21/2011 10:27:02 AM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: Product Customization on Checkout?
Ah, this is a different issue. There is an attribute displayed as radiobuttonlist in your product but the attribute is set to not required.
 
In Web\Store\AttributeSelection.ascx.cs adding the yellow background line around line 139 should fix it.
                case "RadioButtonList":
                    RadioButtonList rbl = new RadioButtonList();
                    rbl.ID = attrib.Attribute.Name;
                    rbl.Style.Add("padding""10px, 0px, 10px, 0px");
                    rbl.DataSource = GetValues(attrib);
                    rbl.DataTextField = "DisplayValue";
                    rbl.DataValueField = "ProductAttributeValueId";
                    rbl.DataBind();
                    rbl.SelectedIndex = 0;
 
 
DotShoppingCart Staff
1/21/2011 11:43:29 AM
RMI-Jon
Posts: 24
Joined: 3/4/2009
Location:Ohio
Re: Product Customization on Checkout?
That worked perfectly. Now the last part of this project - Is it possible to make one of these fields write the attribute "price adjustment" upon clicking "Add to Cart"?
1/21/2011 12:39:21 PM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: Product Customization on Checkout?
You can have "price adjustment" for each attribute value. But the adjustment must be pre-defined. To allow user to enter the amount you will need to use UserInputOrderTotalProvider which is showing up at the checkout page rather than product page.
DotShoppingCart Staff
1/21/2011 12:46:06 PM
RMI-Jon
Posts: 24
Joined: 3/4/2009
Location:Ohio
Re: Product Customization on Checkout?
Is it possible to move the UserInputOrderTotalProvider to a product page?
1/21/2011 3:44:42 PM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: Product Customization on Checkout?
No, they are doing different things.
DotShoppingCart Staff
Page 2 of 2 (21 posts) << First < Prev 1 2 Next > Last >>