Is Dawendo.Commerce Ok?

Topics: Writing modules
Nov 14, 2013 at 2:40 PM
Edited Nov 14, 2013 at 2:43 PM
I tried to compile Dawendo.Commerce v1 - October 2013 and got this :
Image)(![Image]

I think it is because I use october nwazet version.

The question : could you give me a link to right version of nwazet ?
Nov 15, 2013 at 9:11 PM
Hi, Christian .

Could you clarify the issue ?
Nov 18, 2013 at 8:58 PM
Edited Nov 18, 2013 at 9:17 PM
Ok, I have found the right version, compilation is Ok, but now I have migration error :

A column ID occurred more than once in the specification.
at Datwendo.Commerce.Migrations.CommerceMigrations.UpdateFrom9()

Is it Ok two AttributeDescription ?
        public int UpdateFrom9()
        {
            SchemaBuilder.AlterTable("OrderDetailPartRecord", t => t
                    .AddColumn<string>("AttributeDescription", c => c.WithLength(1024).Nullable()));
            return 10;
        }
            SchemaBuilder.CreateTable("OrderDetailPartRecord", t => t
                .ContentPartRecord()
                .Column<int>("Line")
                .Column<int>("Order_Id")
                .Column<int>("ProductPriceList_Id")
                .Column<string>("IsoCurrency", c => c.WithLength(3).WithDefault("EUR"))
                .Column<int>("Subscription", column => column.WithDefault((int)SubscriptionModel.Months))
                .Column<int>("QuantitySubscribed", column => column.WithDefault(0))
                .Column<decimal>("Quantity", c => c.NotNull())
                .Column<decimal>("DPrice", c => c.NotNull())
                .Column<decimal>("DShipping", c => c.NotNull())
                .Column<decimal>("DDiscount", c => c.NotNull())
                .Column<decimal>("DVat", c => c.NotNull())
                .Column<string>("AttributeDescription", c => c.WithLength(1024).Nullable())
                );

2013-11-18 23:08:02,546 [17] Orchard.Data.Migration.DataMigrationManager - An unexpected error occurred while applying migration on Datwendo.Commerce from version 9
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Data.SqlServerCe.SqlCeException: A column ID occurred more than once in the specification.
   at System.Data.SqlServerCe.SqlCeCommand.ProcessResults(Int32 hr)
   at System.Data.SqlServerCe.SqlCeCommand.ExecuteCommandText(IntPtr& pCursor, Boolean& isBaseTableCursor)
   at System.Data.SqlServerCe.SqlCeCommand.ExecuteCommand(CommandBehavior behavior, String method, ResultSetOptions options)
   at System.Data.SqlServerCe.SqlCeCommand.ExecuteNonQuery()
   at Orchard.Data.Migration.Interpreters.DefaultDataMigrationInterpreter.RunPendingStatements() in ~\src\Orchard\Data\Migration\Interpreters\DefaultDataMigrationInterpreter.cs:line 336
   at Orchard.Data.Migration.Interpreters.DefaultDataMigrationInterpreter.Visit(AlterTableCommand command) in ~\src\Orchard\Data\Migration\Interpreters\DefaultDataMigrationInterpreter.cs:line 134
   at Orchard.Data.Migration.Interpreters.AbstractDataMigrationInterpreter.Visit(ISchemaBuilderCommand command) in ~\src\Orchard\Data\Migration\Interpreters\AbstractDataMigrationInterpreter.cs:line 17
   at Orchard.Data.Migration.Schema.SchemaBuilder.Run(ISchemaBuilderCommand command) in ~\src\Orchard\Data\Migration\Schema\SchemaBuilder.cs:line 58
   at Orchard.Data.Migration.Schema.SchemaBuilder.AlterTable(String name, Action`1 table) in ~\src\Orchard\Data\Migration\Schema\SchemaBuilder.cs:line 38
   at Datwendo.Commerce.Migrations.CommerceMigrations.UpdateFrom9()
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at Orchard.Data.Migration.DataMigrationManager.Update(String feature) in ~\src\Orchard\Data\Migration\DataMigrationManager.cs:line 122
2013-11-18 23:08:02,552 [17] Orchard.Data.Migration.DataMigrationManager - Error while running migration version 9 for Datwendo.Commerce
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Data.SqlServerCe.SqlCeException: A column ID occurred more than once in the specification.
   at System.Data.SqlServerCe.SqlCeCommand.ProcessResults(Int32 hr)
   at System.Data.SqlServerCe.SqlCeCommand.ExecuteCommandText(IntPtr& pCursor, Boolean& isBaseTableCursor)
   at System.Data.SqlServerCe.SqlCeCommand.ExecuteCommand(CommandBehavior behavior, String method, ResultSetOptions options)
   at System.Data.SqlServerCe.SqlCeCommand.ExecuteNonQuery()
   at Orchard.Data.Migration.Interpreters.DefaultDataMigrationInterpreter.RunPendingStatements() in ~\src\Orchard\Data\Migration\Interpreters\DefaultDataMigrationInterpreter.cs:line 336
   at Orchard.Data.Migration.Interpreters.DefaultDataMigrationInterpreter.Visit(AlterTableCommand command) in ~\src\Orchard\Data\Migration\Interpreters\DefaultDataMigrationInterpreter.cs:line 134
   at Orchard.Data.Migration.Interpreters.AbstractDataMigrationInterpreter.Visit(ISchemaBuilderCommand command) in ~\src\Orchard\Data\Migration\Interpreters\AbstractDataMigrationInterpreter.cs:line 17
   at Orchard.Data.Migration.Schema.SchemaBuilder.Run(ISchemaBuilderCommand command) in ~\src\Orchard\Data\Migration\Schema\SchemaBuilder.cs:line 58
   at Orchard.Data.Migration.Schema.SchemaBuilder.AlterTable(String name, Action`1 table) in ~\src\Orchard\Data\Migration\Schema\SchemaBuilder.cs:line 38
   at Datwendo.Commerce.Migrations.CommerceMigrations.UpdateFrom9()
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at Orchard.Data.Migration.DataMigrationManager.Update(String feature) in ~\src\Orchard\Data\Migration\DataMigrationManager.cs:line 126
2013-11-18 23:08:08,875 [19] Orchard.Data.Migration.DataMigrationManager - An unexpected error occurred while applying migration on Datwendo.Commerce from version 9
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Data.SqlServerCe.SqlCeException: A column ID occurred more than once in the specification.
   at System.Data.SqlServerCe.SqlCeCommand.ProcessResults(Int32 hr)
   at System.Data.SqlServerCe.SqlCeCommand.ExecuteCommandText(IntPtr& pCursor, Boolean& isBaseTableCursor)
   at System.Data.SqlServerCe.SqlCeCommand.ExecuteCommand(CommandBehavior behavior, String method, ResultSetOptions options)
   at System.Data.SqlServerCe.SqlCeCommand.ExecuteNonQuery()
   at Orchard.Data.Migration.Interpreters.DefaultDataMigrationInterpreter.RunPendingStatements() in ~\src\Orchard\Data\Migration\Interpreters\DefaultDataMigrationInterpreter.cs:line 336
   at Orchard.Data.Migration.Interpreters.DefaultDataMigrationInterpreter.Visit(AlterTableCommand command) in ~\src\Orchard\Data\Migration\Interpreters\DefaultDataMigrationInterpreter.cs:line 134
   at Orchard.Data.Migration.Interpreters.AbstractDataMigrationInterpreter.Visit(ISchemaBuilderCommand command) in ~\src\Orchard\Data\Migration\Interpreters\AbstractDataMigrationInterpreter.cs:line 17
   at Orchard.Data.Migration.Schema.SchemaBuilder.Run(ISchemaBuilderCommand command) in ~\src\Orchard\Data\Migration\Schema\SchemaBuilder.cs:line 58
   at Orchard.Data.Migration.Schema.SchemaBuilder.AlterTable(String name, Action`1 table) in ~\src\Orchard\Data\Migration\Schema\SchemaBuilder.cs:line 38
   at Datwendo.Commerce.Migrations.CommerceMigrations.UpdateFrom9()
   --- End of inner exception stack trace ---

Nov 19, 2013 at 7:54 PM
Edited Nov 19, 2013 at 8:01 PM
Ok, just comment UpdateFrom9().

Now I have one more probleme :
List Content Type and Content Types with container part not working,
Blog Post list is not working either at front-end. In admin area it is Ok.

But everything is Ok if I disable Dawendo.Commerce module.

How (why?) Dawendo.Commerce overlap container-containeble content types ?

Please, Christian Surieux , clarify the issue.
Nov 20, 2013 at 3:16 PM
Ok, just comment <!--<Place Parts_Common_Body_Summary="-"/>-->
Why is it switch off , not to have blog post list ? :)
But it is funny, it force me to replace all lists to content pickers :)
Nov 26, 2013 at 8:03 PM
Edited Nov 26, 2013 at 8:04 PM
two exceptions :
  1. if Pricing model InputOnlyQuantity :
2013-11-26 22:33:13,088 [7] Orchard.Exceptions.DefaultExceptionPolicy - An unexpected exception was caught
System.ArgumentException: The parameters dictionary contains a null entry for parameter 'subscription' of non-nullable type 'System.Int32' for method 'System.Web.Mvc.ActionResult Add(Int32, System.Decimal, Int32, Int32, System.Collections.Generic.IDictionary`2[System.Int32,System.String])' in 'Datwendo.Commerce.Controllers.ShoppingCart2Controller'. An optional parameter must be a reference type, a nullable type, or be declared as an optional parameter.
Parameter name: parameters
   at System.Web.Mvc.ActionDescriptor.ExtractParameterFromDictionary(ParameterInfo parameterInfo, IDictionary`2 parameters, MethodInfo methodInfo)
   at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters)
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
   at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass13.<InvokeActionMethodWithFilters>b__10()
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation)
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation)
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation)
2 if use Weight Based Shipping Method :
2013-11-26 22:46:56,584 [9] Orchard.Exceptions.DefaultExceptionPolicy - An unexpected exception was caught
Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: Operator '>=' cannot be applied to operands of type 'object' and 'int'
   at CallSite.Target(Closure , CallSite , Object , Int32 )
   at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
   at Datwendo.Commerce.Controllers.CheckoutController.<Summary>b__4e(Object x) in ~\src\Orchard.Web\Modules\Datwendo.Commerce\Controllers\CheckoutController.cs:line 488
   at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Datwendo.Commerce.Controllers.CheckoutController.Summary() in ~\src\Orchard.Web\Modules\Datwendo.Commerce\Controllers\CheckoutController.cs:line 478
   at lambda_method(Closure , ControllerBase , Object[] )
   at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters)
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
   at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass13.<InvokeActionMethodWithFilters>b__10()
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation)
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation)
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation)
Dec 2, 2013 at 3:41 PM
Edited Dec 2, 2013 at 3:50 PM
Ok, Christian is too busy, to answer :)
  1. workaround : put optional to controller parameters
  2. Shipping is NOT implemented AT ALL
IMHO :
it is bad idea to rewrite whole shopping cart controller from Bertrand's advanced code to very poor code with a lot of "//TBD"

it is very very early alpha stage for the module

EMS fork is more perspective if the Pull requests #3 will be realized
Dec 2, 2013 at 7:45 PM
Edited Dec 5, 2013 at 9:26 PM
Hi,
Sorry but I just discover your thread, you had better do a comment on BitBucket so I would had received a notification, here I don't scan for Datwendo nor Commerce.
It is true I am busy but I have recently updated the code to solve some issues and I have a larger update on the way but I could wait for TheGreatShif4Orchard....:)

I read here that:
  • There were issues with blogs due to placement.info, I must agree some elements in this placement info are historical and not recently tested some come from the original Nwazet, some from EMS and some from my first tries as a beginner a year ago....) , as I explained in the little readme I added on bitbucket, You have to write your theme and adapt all the visual part (placement, styles and cshtml, even .js sometime) to it, take the existing elements as 'models' to understand the logic, I have actually 2 sites with 2 differents themes running Ok. One main reason for this is Nwazet uses its own Orchard-similar css conventions, I have been using Bootstrap from the origin, on the beginning I let the chtml in Nwazet style and rewrite only the alternates in my themes.
  • You got problems with shipping, shipping is the Nwazet shipping and not very tested because when I took it, Bertrand was in rewriting stripes payment and part of shipping, personnally I have no shipping usage but would do some work to have it working back again.
  • I don't know how I could have used Nwazet shopping cart code based on these differences:
    -- Datwendo manages amounts as decimals
    -- Datwendo manages not only quantities but subscriptions and subscriptions quantities
    -- Datwendo manages currencies
    It means that you have to store many more infos in each shopping cart and that the controllers and divers are also very differents.
    I agree that I am not as an expert as Bertrand :) for all the Orchard world.
    I also know that the bases options of my code concerning currencies, decimals, subscriptions and some others in the discount part could be interesting if some necessity to communicate with something else as a CRM or an ERP may be in your concern (my intention was to have a real money class but NHibernate seriously limits Orchard in the OO area)
Thanks for having tryed this code.

Now please do communicate for my Datwendo modules in their respective repos, I will always answer.