Inhalte aufrufen

Profilbild

Generate an order for another customer

database customer orders direct order

  • Bitte melden Sie sich an, um eine Antwort zu verfassen.
4 Antworten zu diesem Thema

#1 profnimrod

profnimrod

    Advanced Member

  • Members
  • PunktPunktPunkt
  • 39 Beiträge

Geschrieben: 01 November 2017 - 22:05

We have a number of "dealer" type customers that submit surveys for equipment they might need, as well as an order containing the equipment to meet the survey requirements.  What we'd like to do is, once we've reviewed the site survey, generate an order for that particular customer, and then send a URL so they can review it.

 

I want to generate the order from a different (C# MVC5 based) administration system by making appropriate entries directly in the SmartStore SQL database.

 

What tables do I need to add row to?  Is there a stored procedure that I can use to simplify matters?

 

Many thanks in advance for any guidance.



#2 Marcus Gesing

Marcus Gesing

    SmartStore AG

  • Administrators
  • 3801 Beiträge

Geschrieben: 01 November 2017 - 22:47

Due to the review criterion, a shopping cart for the customer would have to be prefilled with corresponding goods. The customer can check and, if necessary, correct it and can finally submit the order using the checkout. Alternative: The wishlist, with the advantage that you can use an URL like www.my-store.com/wishlist/e7ac07a5-8ebb-496a-b6d4-8cd623822c60 that doesn't require to be logged in to view the wishlist.
 
The data table for shopping cart and wishlist items is "ShoppingCartItem" with ShoppingCartTypeId set to 1 (2 would be a wishlist item) and the correct CustomerId of the customer (primary key of the Customer table).
 
If you want to use the .NET service layer, you could use the "AddToCart" methods of the "ShoppingCartService" class. These are internally used to fill shopping baskets.

Marcus Gesing

Smartstore AG


#3 profnimrod

profnimrod

    Advanced Member

  • Members
  • PunktPunktPunkt
  • 39 Beiträge

Geschrieben: 02 November 2017 - 17:17

Many thanks for such a quick response Marcus!  The problem with your proposed workaround is that we'll probably want to tie individual orders to the site survey and we'll be processing more than one per day... if we just added to the customers cart then items relating to different survey would get mixed up.

 

I wonder if you could explain how the review criterion function works, or point me to some documentation - is there a way to bypass the review with appropriate database writes?  I was hoping to just write the appropriate rows to the 'Order', 'OrderItem' and 'OrderNote' tables.



#4 Marcus Gesing

Marcus Gesing

    SmartStore AG

  • Administrators
  • 3801 Beiträge

Geschrieben: 02 November 2017 - 20:53

I understood your post that the customer should be able to review the order and change it. Of course you can create Order, OrderItem and OrderNote but then the actual order exists and can no longer be changed by the customer. If that's okay, then creating Order, OrderItem and OrderNote etc. is the right way.

Marcus Gesing

Smartstore AG


#5 profnimrod

profnimrod

    Advanced Member

  • Members
  • PunktPunktPunkt
  • 39 Beiträge

Geschrieben: 02 November 2017 - 21:10

Sorry Marcus - it just dawned on me that you were referencing a requirement I put in my original post... d'oh!  My approach will now be to create a direct order page in our administrative application, which can be prepopulated if required... then the dealer can review, make any changes, then submit to generate an order.

 

Thanks for your time - apols for my brain fart!

 

BTW Great store solution - I love it!


  • Marcus Gesing gefällt das


Auch markiert mit einem oder mehrerer dieser Schlüsselwörter: database, customer orders, direct order