Answers.Body: <p>I fixed this in payment.twig by wrapping the payment form (id=&quot;paymentForm&quot;) in :</p>
  <pre><code>{% if cart.shippingAddress and cart.shippingMethod %}
  
       //paypal and payment buttons
       &lt;form id=&quot;paymentForm&quot;&gt;...&lt;/form&gt;
  
  {% else %}
  
            {% if not cart.shippingAddress %}
  
                 &lt;p&gt;No shipping address selected.&lt;/p&gt;
                 &lt;a href=&quot;{{ url('/shop/checkout/addresses') }}&quot;&gt;
                                  Change
                              &lt;/a&gt;
  
            {% elseif not cart.shippingMethod %}
  
                 &lt;p&gt;No shipping method.&lt;/p&gt;
                 &lt;a href=&quot;{{ url('/shop/checkout/shipping') }}&quot;&gt;
                                  Change
                              &lt;/a&gt;
  
            {% endif %}
  
  {% endif %}
  </code></pre>
  <p>It doesn't make the shipping automatically applied or prevent the user from skipping the shipping charge but it does prevent the user from checking out without going through the correct process.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-11-13T10:32:32.000Z
Answers.LastActivityDate: 2021-11-13T10:32:32.000Z
Answers.UserDisplayName: cannon303
Body: <p>I'm using checkout.twig in the CraftCMS shop checkout examples templates.<a href="https://i.sstatic.net/5oTcY.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/5oTcY.png" alt="nav checkout astrip" /></a></p>
  <p>As the user proceeds though the checkout process, this nav strip appears at the top of each page and marks their progress. The nav strip is active and so the user can bypass the shipping section altogether by clicking the &quot;Payment&quot; link at the end and then just pay for the item and not pay any shipping. The shipping doesn't get applied automatically as they should go through to the shipping section and click the shipping option radio button. I would much sooner automatically apply the shipping without them having to select it. Can anyone tell me how to automatically apply shipping and also prevent the user from skipping ahead by clicking the payment button?</p>
  <p>Thanks.</p>
  
Tags: <craft3><plugin-craftcommerce><craft-pro><shipping>
Title: Craft Commerce Checkout: How to prevent payment link from bypassing shipping section in nav-checkout
ThreadText: # Craft Commerce Checkout: How to prevent payment link from bypassing shipping section in nav-checkout
  
  (Asked by: username_0 on 2021-11-12)
  
  I'm using checkout.twig in the CraftCMS shop checkout examples templates.[![nav checkout astrip](https://i.sstatic.net/5oTcY.png)](https://i.sstatic.net/5oTcY.png)
  
  As the user proceeds though the checkout process, this nav strip appears at the top of each page and marks their progress. The nav strip is active and so the user can bypass the shipping section altogether by clicking the "Payment" link at the end and then just pay for the item and not pay any shipping. The shipping doesn't get applied automatically as they should go through to the shipping section and click the shipping option radio button. I would much sooner automatically apply the shipping without them having to select it. Can anyone tell me how to automatically apply shipping and also prevent the user from skipping ahead by clicking the payment button?
  
  Thanks.
  
  **Tags:** craft3, plugin-craftcommerce, craft-pro, shipping
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2021-11-13. Score: 1 | Accepted answer
  
  I fixed this in payment.twig by wrapping the payment form (id="paymentForm") in :
  
  ```
  {% if cart.shippingAddress and cart.shippingMethod %}
  
       //paypal and payment buttons
       <form id="paymentForm">...</form>
  
  {% else %}
  
            {% if not cart.shippingAddress %}
  
                 <p>No shipping address selected.</p>
                 <a href="{{ url('/shop/checkout/addresses') }}">
                                  Change
                              </a>
  
            {% elseif not cart.shippingMethod %}
  
                 <p>No shipping method.</p>
                 <a href="{{ url('/shop/checkout/shipping') }}">
                                  Change
                              </a>
  
            {% endif %}
  
  {% endif %}
  
  ```
  
  It doesn't make the shipping automatically applied or prevent the user from skipping the shipping charge but it does prevent the user from checking out without going through the correct process.
  
  
  ---
  
  