Automattic / wp-calypso

The JavaScript and API powered WordPress.com
https://developer.wordpress.com
GNU General Public License v2.0
12.41k stars 1.98k forks source link

Gifting: Checkout cancellation should return to referrer not /start/domain. #70317

Closed lsl closed 1 year ago

lsl commented 1 year ago

When clicking the "X" in checkout or otherwise emptying the cart you should be returned to the referring domain.

Some quick testing of https://wordpress.com/checkout/business-bundle/gift/19766713?cancel_to=https://... and checking the code tells me we're only able to redirect to internal routes, lets just go to home for now.

Acceptance:

lupus2k commented 1 year ago

What do you think about adding an else here using window.location.href?

lupus2k commented 1 year ago

Created this diff (for simple sites): D93366-code Also, this PR at wpcomsh (for atomic sites): https://github.com/Automattic/wpcomsh/pull/1157