1 Delivery Type - 2 Shipping Methods

I’ve got one delivery type…

Free

I’ve got 2 methods that are both free

Pick Up
Free Home Delivery

…In the cart ‘Free Home Delivery’ shows as the default. How can I get something like ‘Delivery calculated at checkout’ or allow the choice of delivery method at the cart stage? At th emoment it looks like ‘Free Home Delivery’ is the only method available.

Commerce will automatically pre-select the first shipping method that is available for an order, based on their order in the configuration.

To change the way things look in the cart, you can override the frontend/checkout/cart/totals.twig template in your custom theme. Copy the default from core/components/commerce/templates/default/ to a custom location you define in the settings, and then edit it freely.

(Changes to the default templates directly will be lost on upgrade. Always make a custom theme directory.)

The selected shipping method is rendered in the block on line 13-25 of the template. You can choose to replace {{ shipment.method.name }} on line 18 with something like “Alternative options available in checkout”, or add a separate note to it, or remove the entire block - though if you add paid shipping options later, that could cause the totals to not add up.

At the moment it’s not possible in the cart to set a shipping method directly, that is restricted to the shipping step only. Perhaps we’ll make that possible in the future, though there are many shipping method types that do require the users’ address before pricing or availability can be calculated.

2 Likes