Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Re: How can I use the Resource Picker in a CLI generated extension?

How can I use the Resource Picker in a CLI generated extension?

jamesauble
Shopify Partner
13 0 6

Okay so I created my first app using the Remix template and am generating QR codes successfully. Sweet.

 

I thought how can I extend this and learn something. So I decided I want to create an extension that allows me to select a variant from within the Product Detail admin page that is scoped to the selected product's variants.

 

Alright so I generated an extension using the `shopify app generate extension`. The demo worked fine.

 

Now I want to add my variant resource picker. I have no idea how to do this and not finding many resources on this.

 

I'm understanding that I need to use the App Bridge in some capacity though, but that this extension is just pure React right? I don't have access to any Remix packages correct?

Any help and/or example code or references to existing extension source that demostrates this would be much appreciated. 

 

Thanks!

Replies 2 (2)

Huptech-Web
Shopify Partner
1016 204 220

Hello @jamesauble  

Solution 1:
The implementation goes beyond simply using the Shopify checkout extension. To achieve this, you will need to integrate the resource picker to select the product variant within an app built using the Shopify App Bridge. Additionally, you need to develop an API that manages the selected variants and integrate this API into your checkout extension.

To utilize a third-party API in the checkout extension, network access must be allowed in the app partner dashboard

Screenshot_5.png

and network access should be enabled in the shopify.extension.toml file.
Screenshot_1.png
Solution 2:
Instead of showing a resource picker on the admin page, you can utilize the checkout extension theme settings. To implement this follow below steps

1. add the following code to the shopify.extension.toml file.

Screenshot_6.png

2. go checkout the setting

Screenshot_3.png

3. add your extension block

Screenshot_4.png

4. result 

Screenshot_7.png

If you found this response helpful, please do like and accept the solution. Thanks!
Need support with Customizing your Shopify store?
Feel free to contact me at info@huptechweb.com or Visit our website Huptech Web.
Instant Shortcode Builder: Integrate customizable UI features anywhere in your store - No coding knowledge required
jamesauble
Shopify Partner
13 0 6

Thanks for your response. I failed to specify in my post that I generated an Admin extension as I thought this seemed the most appropriate for the task. I just assumed I shouldn't be using the Checkout Extension because generating a QRCode from the product detail page didn't involve the checkout.

 

I'm not sure how much of your answer is relevant to the Admin Extension.