Skip to main content

How to change existing shopify listings to point at different app types

If you update the links in the shopify partner portal, this will effect both new AND existing users. This is rarely what we would want to do. No one wants to have their app suddenly change for no reason.

Instead, we are overwriting the app_type from within our codebase in two places:

app/interactors/shopify/authenticate_interactor.rb

Example:

elsif context.app_type == 'twitterFeed' && !context.install.persisted? context.app_type = 'facebookFeed' context.install.assign_attributes(app_type: context.app_type)

app/controllers/shopify_controller.rb

Example:

elsif params[:app_type]=='twitterFeed' && shopify_install && shopify_install.created_at > DateTime.parse('Wed, 27 Mar 2019 17:45:00 -0700') app_type = 'facebookFeed' app_slug = 'facebook-feed'

You can test locally or on staging by using a version of this link - update the server and the shop name correctly:

Going to this link should take you to wholesale form: https://www.powr-staging.io/plugins/contact-form/shopify_authenticate?shop=YOUR-SHOPIFY-TEST-STORE.myshopify.com

Going to this link should take you to video gallery: https://www.powr-staging.io/plugins/media-gallery/shopify_authenticate?shop=YOUR-SHOPIFY-TEST-STORE.myshopify.com