gulp-shopify-theme icon indicating copy to clipboard operation
gulp-shopify-theme copied to clipboard

Checkout liquid template not updating on theme

Open OwenLD opened this issue 4 years ago • 8 comments

When saving the checkout.liquid file locally it queues and gets added without any errors but it doesn't update the file on the shopify store.

Other files in the layout folder are updating as expected (theme.liquid etc).

Any idea as to why this is happening?

OwenLD avatar Jan 23 '20 16:01 OwenLD

That may be because you are not a Shopify Plus customer?

tmslnz avatar Feb 10 '20 09:02 tmslnz

The store I am working on is a plus store.

The specific gulp task looks like this:

/* Paths */
const paths = {
    copy: {
        src: ['src/{layout,config,snippets,sections,templates,locales}/**/*.*', '!src/config/settings_data.json'],
        watch: ['src/{layout,config,snippets,sections,templates,locales}/**/*.*', '!src/config/settings_data.json'],
        dest: 'dist'
    }
};

/* Copy */
function copy() {
    return gulp.src(paths.copy.src)
        .pipe(changed(paths.copy.dest))
        .pipe(gulpif(destCheck, embedSvg({
            root: 'dist/assets',
            selectors: '.inline-svg'
        })))
        .pipe(gulp.dest(paths.copy.dest))
        .pipe(theme.stream());
}

The copy function is then part of my watch/deploy tasks.

Which both run without erroring when editing the checkout.liquid locally.

The output in the terminal looks like this:

[13:55:41] Starting 'copy'...
[13:55:41]   gulp-shopify-theme   queued: layout/checkout.liquid
[13:55:42]   gulp-shopify-theme   added: layout/checkout.liquid
[13:55:42]   gulp-shopify-theme   Done
[13:55:42] Finished 'copy' after 562 ms
[13:55:42] Starting 'browserSyncReload'...
[13:55:42] Finished 'browserSyncReload' after 274 μs

Can you think of any other reason why this might not be working?

OwenLD avatar Feb 12 '20 14:02 OwenLD

Looks like checkout.liquid is being added according to the console… That’s weird API behaviour if it doesn’t show up in the Shopify editor.

Is there any info out there on Shopify’s API docs that refers to special behaviour with checkout.liquid?

Maybe try a simple API call with cURL just for that file to rule out Shopify being the cause of the issue.

Sorry, not really sure how to help off the top of my head. There isn’t any magic sauce in the Gulp module…

tmslnz avatar Feb 12 '20 18:02 tmslnz

I've just tested the API call with cURL and a very simple checkout.liquid file, which looked like this:

<!DOCTYPE html>
<html>
    <head>
        {{ content_for_header }}
    </head>
    <body>
        {{ content_for_layout }}
    </body>
</html>

The API call with cURL works as expected and the file updates on the theme.

However, using the exact same content with gulp doesn't seem to do anything but also doesn't error (same output as above).

Strange that this is only an issue with the checkout.liquid file... I can't find any information about it requiring any special behaviour.

Would be interesting to know if anyone else is having the same issue.

OwenLD avatar Feb 13 '20 10:02 OwenLD

Thanks for looking into this. Weird one… I wonder if it could be something to do with the way the asset paths are built in my module?

tmslnz avatar Feb 13 '20 10:02 tmslnz

Could be, I am not sure to be honest.

I wouldn't really know how to start debugging this.

Sorry I can't provide more information.

OwenLD avatar Feb 14 '20 10:02 OwenLD

@OwenLD - I just wanted to jump in and confirm your experience. We have a theme that uses Gulp Shopify Theme and we experience the EXACT same behavior. We have not been able to troubleshoot it, either, so we resort to using ThemeKit directly for that, or copy/pasting the file contents into the online editor.

MrSpecific avatar Mar 26 '21 20:03 MrSpecific

I'm encountering this too. I debugged this and it turns out the Shopify API is returning a 200 for the asset update call. This library calls out to the Shopify API here and then the Shopify API is making the request and getting a response here. I checked the response we were getting and it's a 200, normal JSON body, no errors, but the template is not updated in the Theme Editor..

nijotz avatar Mar 26 '21 21:03 nijotz