0

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

4

I think a theme function called commerce_cart_empty_page is used. So you should be able to add a function:
MYTHEME_commerce_cart_empty_page()
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()

2
  • 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 that you have read and understand our privacy policy and code of conduct.

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