I have look for Shopify theme detector but I have no idea how it works and how to detect WordPress activated theme into theme folder.
You can access theme related info via the theme object
{{ theme.id }} - The ID of current active theme
{{ theme.name }} - The name of current active theme
This is a very nice cheat sheet you should be using: https://www.shopify.com/partners/shopify-cheat-sheet
Related
I have created a Static e-commerce site using Hugo.
Hugo ecommerce site
want to add products thro' Shopify admin, and get it reflected on my site.
I'm quite familiar with liquid templating. Kindly let me know how to achieve this?
So far,
I have created a Shopify store, added a theme and added one product.
I'm not looking to customize an existing theme, but completely remove that theme add my website theme in it.
You should be able to get your products using the Shopify API. This endpoint could be the one for you. From Hugo, you can then retrieve the products by getJson function with telling it the Shopify authorization header X-Shopify-Access-Token. Like this:
{{ $data := getJSON "https://your-store.myshopify.com/admin/api/2022-01/products.json" (dict "X-Shopify-Access-Token" "your-token") }}
{{ range $data }}
{{ . }}
{{ end }}
Just make sure that you've replaced both the your-store and your-token strings.
I need help to add customized icon to the header of Shopify Store - Narrative theme.
https://butterflight-boutique.myshopify.com/
If no option available in theme settings then do below
Note: You should have HTML code idea.
From your Shopify admin, go to Online Store > Themes.
Find the theme you want to edit, and then click Actions > Edit code
Goto templates section and find Header template you can update there.
If the header is custom then to the main layout find which header is working and update that as per need.
Can any one help me on how to overwrite the theme in Shopify. Is there any option to create custom child theme under main theme and write custom codes into the activated child theme? Or there is another way to customized the theme.
There is no concept of child themes in shopify. Shopify refers to copies as duplicates, and a theme is either published or unpublished.
Before editing a themes structure make a duplicate and this is generally what should be worked on instead of the published(live) until all changes are done and the theme previews look ready.
If used to version control software(git) there are tools to automate the upload/download so you can work with your preferred editor locally.
So If you want customize the theme then just create a duplicate copy of the main the theme and do your all changes in the duplicate theme and see the all changes using theme preview option. After completing all of the changes, you can publish the duplicate theme and it will work as an active theme.
Is there a method in Liquid that can tell me if a theme is the store's live theme or if it's unpublished?
I am wondering is something like {{ theme.role }} is possible (I know that this particular one was deprecated) and then I would get published or unpublished in return.
{{ theme.role }} - it's available for now, but not documented as far as I see. It returns:
main - for published theme
unpublished
Is there any way to publish a test template page? For example, if I have a template file called "cart-test.liquid," is there anything I can modify so I can navigate to "http://shopname.com/cart-test" in order to test it out?
I'm currently developing an widget that'll be included on Shopify cart pages, and one of my clients wants to test it out before it's published on their real cart page.
The best way to test a theme without editing the live theme is to duplicate the current theme and use the preview function.
From within the Shopify admin (using Shopify Admin 2) goto the "Themes" section. Here you can "duplicate" the published main theme. It will create a copy of the theme within the "Unpublished themes" section. Here you can edit it and also get a preview of this theme (click on the link preview).