Developer forum

Forum » Swift » Single Page checkout

Single Page checkout

Justin Sjouw Dynamicweb Employee
Justin Sjouw
Reply

Hi,

For a B2B customer that has a the wish for a very simple checkout page I have modified the Swift\eCom7\CartV2\Step\PaymentUser.cshtml template to also include address and delivery selection.

This seems to work, except I had to create a workaround for getting the delivery Address onto the order.

The @RenderAddressUser() wil render the addresses correctly, and also pre-select the delivery addres that is set as default. However I need to trigger useUserAddress() in javascript to apply the address, otherwise the order gets completed with the invoice address.

Is there a better way to handle this and already apply the delivery address to the order?

Thanks,

Justin


Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

There are no better ways. 

 
Nicolai Jessen
Nicolai Jessen
Reply

Hi, 

I came across this post while troubleshooting a similar issue, where the delivery and payment steps has been merged, and I’m hoping you might be able to share some insight into your approach.

We’re experiencing a problem in checkout where a logged-in customer selects a different delivery address, but when clicking “Proceed to Payment,” it reverts back to the default address. The same happens if the customer changes delivery method after selecting a different address. This results in orders being completed with the wrong delivery address.

From your post, it sounds like you ran into something related when rendering and applying addresses .

Just to make sure I understand correctly:

  • Are you manually triggering useUserAddress() via JavaScript to ensure the selected address is actually applied to the order?

I have only succeeded saving the deliveraddress to the order by form submission. 

Any details on how/when you apply that JS workaround would be greatly appreciated or if you’ve since found another approach :-)

Thanks in advance,
Nicolai

 

You must be logged in to post in the forum