-2

I am not able to understand the flow on this page

how they are doing in MVC http://demo.nopcommerce.com/onepagecheckout till now i created only one button for one page (view ) or provide me some similar link or similar code so i can understand

i want to implement same in my application

Thanks in Advance

tereško
  • 58,060
  • 25
  • 98
  • 150
user1035814
  • 184
  • 2
  • 4
  • 14
  • 1
    What is the difficulty you are getting to add multiple buttons in views? you can add as many html controls you want in view. or provied your sample code what u tried till now. – Jatin patil Oct 09 '13 at 05:14
  • I think the OP wants to know how the page works, rather than "how to put buttons on a page". OP's wording is a little off but I think I got the meaning. – Rowan Freeman Oct 09 '13 at 05:43
  • Hi Jatiin , thanks for your reply, i have shopping cart with item , now i want to procedure for checkout till now i did not do any code for checkout . that why i ask to question . if you have any suggestion for me . Please Let me know .. Thanks – user1035814 Oct 09 '13 at 06:48

1 Answers1

0

The page is using AJAX to achieve the effect. Let's go through how it works.

The page is divided up into four sections.

  • Billing Address
  • Payment Method
  • Payment Information
  • Confirm Order

Each section is treated separately and are likely rendered using partial views. Each section has it's own form. When the user fills out a section and then submits that section, the form is submitted to a particular action. The Billing Address section submits its form to /checkout/OpcSaveBilling, the Payment Method section submits its form to /checkout/OpcSavePaymentMethod and so on.

When these forms are submitted (asynchronously, remember), the server handles the business logic and the validation and returns a result in the form of JSON. The JSON describes what happened, i.e. the result of the validation (success or fail), any errors that occurred and also contains HTML that the page can use to redisplay that particular section.

How is this data being remembered? Sessions. When forms are successful in their submission, the form data is stored per user in the session data. This way the system knows each user's settings and also knows where they are up to in the process.

The final step, Confirm Order, doesn't bother sending any form data because the server already knows everything through the session information.

Rowan Freeman
  • 15,724
  • 11
  • 69
  • 100
  • Hi Rowan , Thanks for your reply .i really appreciate your answer very descriptive ways , i think it should work for me and if you have any similar or related code , that will very help full for me -- Thanks – user1035814 Oct 09 '13 at 06:54