if (subscription.error) {
console.error('❌ [SUBSCRIPTION ERROR]: Unable to subscribe to plan', subscription.error);
shopify.toast.show('There was an error with your subscription.', { isError: true });
} else if (!subscription.confirmationUrl) {
shopify.toast.show('Successfully subscribed to development plan!');
setTimeout(() => location.reload(), 1000);
} else {
shopify.toast.show('Successfully subscribed to your plan!');
open(subscription.confirmationUrl, '_top');
}
if (subscription.error) {
console.error('❌ [SUBSCRIPTION ERROR]: Unable to subscribe to plan', subscription.error);
shopify.toast.show('There was an error with your subscription.', { isError: true });
} else if (!subscription.confirmationUrl) {
shopify.toast.show('Successfully subscribed to development plan!');
setTimeout(() => location.reload(), 1000);
} else {
shopify.toast.show('Successfully subscribed to your plan!');
open(subscription.confirmationUrl, '_top');
}