I am working on a Drupal Commerce site, we are trying to add a feature in the cart that would allow the user to input their zip/postal code or country and receive an estimate on shipping, before proceeding through the checkout. I'm new to Drupal Commerce, so maybe this functionality already exists?

a shove in the right direction would be greatly appreciated. Thanks.

  • 1
    If you install Commerce Shipping and make sure the Customer Profile module is enabled, the checkout form will behave exactly as you're describing out of the box if I remember rightly
    – Clive
    Jan 22, 2014 at 16:57

2 Answers 2


link- https://drupal.org/project/commerce_shipping Commerce Shipping provides a shipping rate calculation system for Drupal Commerce , integrating shipping service selection into both the checkout form and order edit form. This module is a framework that is meant to be used in conjunction with shipping method modules like Commerce Flat Rate , Commerce UPS , and others. Shipping service availability and rate calculation is handled in the user interface through Rules and is backed up by an API that gives you a high level of flexibility to implement simple or complex shipping scenarios.


yes - use commerce_shipping

add in the Shopping cart form (Commerce Order) view, and Shopping cart block (Commerce Order) view - if used, the Commerce Order: Order total to the footer, as the line item summary does not display the shipping line item .., rearrange the order, like this: view footer

and hide the total in the Commerce Line Item: Line item summary (makes only sense in block view ;), in the cart view just remove the line item summary), like this: line item summary

then - create a shipping rule and add the following event:

  • After adding a product to the cart
  • After removing a product from the cart
  • After updating an existing commerce line item

(the default event is needed when the user changes it on the shipping step, or where you configured the shipping service in the checkout settings - if you remove the default event the rule will no longer show up in the shipping calculations rules, but only on the general rules UI)

setup your condition, fe:

  • Total product quantity comparison

and choose the action:

  • Apply shipping rate to an order

now, if desired, you can gracefully disable the shipping service in the checkout settings.

and don't forget to make a rule for every case, even the 'inital' one.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.