I'm using Drupal 7 with Commerce and I'd like to change the text shown when the user visits /cart and they have not added any items, from the default "Your shopping cart is empty." to a custom message, preferably that contains HTML.

I have tried adding custom text under no results behavior commerce_cart_form view with no luck.

What is the best way to do this?

1 Answer 1


I think a theme function called commerce_cart_empty_page is used. So you should be able to add a function:
to your themes template.php file and return whatever html you want.

You can also do the same for the cart block with a theme function MYTHEME_commerce_cart_empty_block()

  • Perfect, thank you. This is what I was looking for :)
    – Andy
    Jul 21, 2014 at 20:39
  • This works like magic.. Likes :)
    – Dev
    Jan 29, 2016 at 10:18

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.