Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jean-Francois Pitre 1 post 71 karma points
    Nov 09, 2021 @ 16:05
    Jean-Francois Pitre
    0

    Adding a discount create a postback which empty all my customer information field.

    Hello, I'm pretty new to MVC, Umbraco and Vendr in general. As a base to my project, I've used the Vendr Demo Store which work perfectly. I only saw a strange behavior when I'm in the Customer Information page. When you're there, you can add a gift card on the right side of the site. Doing so create a postback, and if there was any information already filled for the customer, they all get deleted in the process. Is there an easy way to fix this behavior in the Vendr Demo Store? Any help would be appreciated. Thanks!

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Nov 10, 2021 @ 08:36
    Matt Brailsford
    0

    Hi Jean-Francois,

    This is expected behavior with the demo store setup as the discount code / customer information fields are two separate forms and so any post back from one will loose any un-persisted changes in the other.

    Your two options are really are:

    1) Combine the forms into one and try and handle both updating of the customer information and applying the gift card, although this could be problematic if the customer info is only half filled in.

    2) Look at making the apply discount code run via an ajax request or similar so that you never actually leave the page when adding a discount.

    The aim of the demo store was just to keep things as simple as possible so this was a compromise we made, but hopefully one of the above should make it work a little smoother for you.

    Hope this helps

    Matt

Please Sign in or register to post replies

Write your reply to:

Draft