woothemes/woocommerce — comment on commit 3d18b7d698f1d4b04e588ffd4f680441c9249611
File:  line 0
By GeertDD:

I tried it this way too, the first time, but it isn't working properly. `wp_get_referer()` returns false for some reason. Maybe you could do a check to see if it returns false and if it does use `$woocommerce->cart->get_cart_url()` instead.