Straight to Checkout without scrolling past "your cart"

alanalan Member
Hi,

We want to link straight to the checkout. When we do this, the page loads and immediately scrolls down to the the checkout portion of the page, requiring customers to scroll up to see what is in their cart (on mobile). We do not want this behavior. How can we disable this scrolling action?
Comments
  • fc_marijafc_marija FoxyCart Team
    Hello @alan -

    You can put the following in your custom footer text area in the Foxy template configuration settings (https://admin.foxycart.com/admin.php?ThisAction=TemplateConfig). You may need to enable the Add custom header and footer code to your templates option to see the custom footer text area.
    {% if context == "checkout" %}
    <script>
    $(document).ready(function(){
    $('#customer_email').blur();
    $(this).scrollTop(0);
    });
    </script>
    {% endif %}
    That will de-select the email field and scroll to the top of the window, overriding the default behavior.

    You can whisper the store URL if you need more specific direction.
Sign In or Register to comment.