HomeHome Product Discus... Product Discus...SmithCartSmithCarturgent - add to cart errorurgent - add to cart error
Previous
 
Next
New Post
12/20/2011 2:25 PM
 

I am running the version 4.67.0 of smith-cart and DNN 6.00.01. In the product list (buynow) when I click the add to cart button, I get the error below. I can view the cart by clicking the view cart button on the mini-cart. I have not seen this before and not sure what I did to cause it.

 

An error has occurred.DotNetNuke.Services.Exceptions.PageLoadException: Object cannot be cast from DBNull to other types. ---> DotNetNuke.Services.Exceptions.PageLoadException: Object cannot be cast from DBNull to other types. ---> System.InvalidCastException: Object cannot be cast from DBNull to other types. at System.DBNull.System.IConvertible.ToDecimal(IFormatProvider provider) at System.Convert.ToDecimal(Object value) at Smith.DNN.Modules.BuyNow.MyQtyDiscount.GetCategoryQtyDiscount(Int32 ProductID, Decimal Quantity, Decimal price, DataTable _ProductList) at Smith.DNN.Modules.BuyNow.ProductsList.AddToCart(Int32 ProductID, Decimal Quantity, Decimal price, Boolean isRequired, Int32 bundleID, Boolean inBundle, Decimal myWeight, Int32 catID) at Smith.DNN.Modules.BuyNow.ProductsList.StartAddingToCart(DataListItem item) at Smith.DNN.Modules.BuyNow.ProductsList.btnAddBasket_Click(Object sender, EventArgs e) at System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) --- End of inner exception stack trace --- at DotNetNuke.Services.Exceptions.Exceptions.ProcessPageLoadException(Exception exc, String URL) at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) --- End of inner exception stack trace ---

 
New Post
12/20/2011 8:36 PM
 
Hi Carl.

Is this a clean install of the Cart or have you upgraded from a previous version?

Did you import your product data?

Please post a screenshot of your Cart Settings and I will try to reproduce this issue in our test environment.

Thanks,
 
New Post
12/22/2011 12:46 PM
 

Hi

This is an upgrade from the previous version. I did not import items but I did use the clone feature. When I attempted to clone items using ie9 it didn't do anything. I tried it in firefox and it worked. I wonder if the cloning using ie9 inserted bad data somewhere. I also used advanced clone. I inserted 40 plus products using the clone and then used advanced clone to update the tabs

 Let me know if you need access.

Thanks for the help!

 

 
 Login to download attachment
New Post
12/23/2011 4:32 AM
 

Hi Carl,

Which version did you upgrade from?

When did this behavior begin? After the upgrade?

Did you clone the products before or after the upgrade?

Do the products have variants configured?

I have tried to reproduce the same behavior but I was unable to replicate the issue you reported above. Can you log onto our test portal and try to reproduce the error? You can create aa new DNN sandbox and/or perform a data backup and clean install using the instructions at the following link. I would recommend first testing the fresh install before importing your data to determine if the data is the cause or or if the clean install resolved the issue.

Please email me at kevin@smith-consulting.com if login credentials ware needed.

Clean Install instructions: http://www.smith-consulting.com/Forum...

 

Thanks,

 
New Post
12/23/2011 1:00 PM
 

Hi Kevin

 

I believe I upgraded from 4.60 and I am not sure if it happened after the upgrade or after I used the clone. Cloned the products after the upgrade to 4.67.  2 items have variants but the ones I cloned did not.

I will try to reproduces on the test portal.

 
New Post
12/23/2011 1:42 PM
 
Kevin

I can't replicate the error in the test environment. Did you see the error message - does that shed some light on the problem?
 
New Post
12/28/2011 2:16 PM
 

Hi Carl,

Which test site did you test in?

Since you cant recreate the bug on the test portal the issue must be something with your Cart install possibly has gotten out of the sync. To get a working cart on your site I recommend you download the latest version of the cart v4.67 from our site and then do a clean install of the Cart using the instructions found at the following link: http://www.smith-consulting.com/Forum...

Thanks,

 
New Post
12/29/2011 12:17 PM
 

Well I don't think thats an appropriate answer - reinstall a clean version??? I have 3 instances of the cart installed on my site and have hours invested in entering products.

There is something wrong with the list template. I can view the cart from the mini basket on the same page. The error message indicates an invalid conversion from dbnull. Does this imply that possibly null values were inserted somewhere as a result of the clone feature?

I have a basic install and am not doing anything out of the ordinary. I have been using the cart over many many versions so attempting to recreate the issue in your test environment is not an apple to apple comparison.

Could you please take a look at the original error message and see if you can pinppoint what might be happening? I did upgrade to the latest version...

Thanks!

 
New Post
12/29/2011 1:47 PM
 
Kevin

I am not sure if this helps but it seems that if I have an item in the cart (by adding it from the detail page) I can then add the same item to the cart from the buynow page. If I delete the item from the cart and try to add from the buy now page I get the error again.

Could there be a problem in sp that adds the item to the cart from the buynopw page?

Do you need access to my site?

This is somewhat urgent as I have a client that wants to sell from my site asap.

Thanks for the help.
 
New Post
1/3/2012 3:14 PM
 
Hi Carl,

I have not been able to replicate this issue on my test portal. On your site, are only the Products which have been cloned giving you trouble? Can you confirm if Products entered through the Product Setup screen function correctly?

Thanks,
 
New Post
1/3/2012 4:08 PM
 
Hi Kevin

It happens across all buynow instances with all products. I entered a new product from scratch and it still had the problems.
 
New Post
1/3/2012 4:53 PM
 

Hi kevin

Doesn't this error message shed some light on where you can look in the program. Since it affects all of the instances and all products, it's not a data issue and everything was working until I upgraded and entered 45 products using the clone feature.

Object cannot be cast from DBNull to other types. at System.DBNull.System.IConvertible.ToDecimal(IFormatProvider provider) at System.Convert.ToDecimal(Object value) at Smith.DNN.Modules.BuyNow.MyQtyDiscount.GetCategoryQtyDiscount(Int32 ProductID, Decimal Quantity, Decimal price, DataTable _ProductList) at Smith.DNN.Modules.BuyNow.ProductsList.AddToCart(Int32 ProductID, Decimal Quantity, Decimal price, Boolean isRequired, Int32 bundleID, Boolean inBundle, Decimal myWeight, Int32 catID) at Smith.DNN.Modules.BuyNow.ProductsList.StartAddingToCart(DataListItem item) at Smith.DNN.Modules.BuyNow.ProductsList.btnAddBasket_Click(Object sender, EventArgs e) at System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) ---

 

Thanks

 
New Post
1/3/2012 5:08 PM
 

Here is a scenario that caused the problem. I had enable category discounts checked and with no discounts defined, the buynow page through the dbnull error becasue the category discount table was empty.

Problem solved BUT: why did it affect all instances. Only had the option checked for one instance.

Thanks

 
New Post
1/5/2012 1:00 PM
 
Hi Carl,

Thank you for posting back that this issue has been resolved, not sure why enabling Category Discounts in the Cart Settings without defining Category discounts was causing this issue as I have setup our test portal with 3 instances of the BuyNow module and attempted to replicate this scenario but I was unable to reproduce the same behavior.

Thanks for your feedback!
 
Previous
 
Next
HomeHome Product Discus... Product Discus...SmithCartSmithCarturgent - add to cart errorurgent - add to cart error