How do you modify the redirect url after finishing payment with Mollie.

royroy Member Posts: 1

Hi!

We use Mollie as our payment provider, but I can't seem to figure out where I can modify the redirect url after completing the payment process. Currently, the user gets redirected to https://XXX.webshopapp.com/nl/checkout/thankyou/, however I want the user to be redirected to our domain.

Does anyone have any idea how to make this work?

Thanks!

Answers

  • MilesbdMilesbd Moderator, Lightspeed Staff Posts: 19 moderator

    Hi @roy !

    Thanks for the question!

    Unfortunately, the re-direct to the thank-you page is a platform default, that is not something that can be modified. It is done to ensure that the customer is aware that their order was placed, and that the payment went through successfully.


    If you'd like to re-direct customers to your homepage, that can be accomplished in a few ways:


    1) Using the template's code:

    You could place something like the following code in the top of the fixed.rain template:

    {% if 'checkout/thankyou/' in request.url %}
    
    <script>
    
    window.location.replace('{{ shop.domain }}');
    
    </script>
    
    {% endif %}
    


    2) Using Javascript:

    Code similar to this could be placed in the custom js section of settings > web extras:

    <script>
    if (window.location.href.indexOf('checkout/thankyou') > -1) {
    var origin = window.location.origin;
    window.location.replace(origin);
    }
    </script>
    


    Either of these implementations should work, however note that the javascript option (option 2) would run after page load, so the "Thank You" page would appear briefly to customers.

Sign In or Register to comment.