diff --git a/plugins/woocommerce/changelog/fix-wccom-21582-siteurl-setting b/plugins/woocommerce/changelog/fix-wccom-21582-siteurl-setting new file mode 100644 index 00000000000..edadba6a3d5 --- /dev/null +++ b/plugins/woocommerce/changelog/fix-wccom-21582-siteurl-setting @@ -0,0 +1,4 @@ +Significance: patch +Type: fix + +Correctly fetch `siteUrl` to fix broken `Back to Store` button diff --git a/plugins/woocommerce/client/admin/client/lib/in-app-purchase.js b/plugins/woocommerce/client/admin/client/lib/in-app-purchase.js index 0e925ccace5..620c60cbdd1 100644 --- a/plugins/woocommerce/client/admin/client/lib/in-app-purchase.js +++ b/plugins/woocommerce/client/admin/client/lib/in-app-purchase.js @@ -4,6 +4,11 @@ import { addQueryArgs } from '@wordpress/url'; import { getSetting } from '@woocommerce/settings'; +/** + * Internal dependencies + */ +import { getAdminSetting } from '~/utils/admin-settings'; + /** * Returns an in-app-purchase URL. * @@ -15,7 +20,7 @@ export const getInAppPurchaseUrl = ( url, queryArgs = {} ) => { const { pathname, search } = window.location; const connectNonce = getSetting( 'connectNonce', '' ); queryArgs = { - 'wccom-site': getSetting( 'siteUrl' ), + 'wccom-site': getAdminSetting( 'siteUrl' ), // If the site is installed in a directory the directory must be included in the back param path. 'wccom-back': pathname + search, 'wccom-woo-version': getSetting( 'wcVersion' ),