<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>

CC BY-SA 4.0
2021-11-13T10:32:32.000Z
2021-11-13T10:32:32.000Z
cannon303
<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>

<craft3><plugin-craftcommerce><craft-pro><shipping>
Craft Commerce Checkout: How to prevent payment link from bypassing shipping section in nav-checkout
# 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
     ...

{% else %}

          {% if not cart.shippingAddress %}

               No shipping address selected.
               
                                Change
                            

          {% elseif not cart.shippingMethod %}

               No shipping method.
               
                                Change
                            

          {% 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.


---

