Roswell Studios

139 Fulton Street, Ste 132
New York, NY 10038

Blog

This is where we write stuff.

Guide to asynchronous Shopify sites

— November 12, 2018

Shopify has a great content distribution network (CDN). It can easily load a complicated page with many images in 0.2-0.3 seconds. However, it takes some time to load and execute the Javascript that makes the site run. Worse, it might take 4 seconds or more to load all the poorly written plugins and user tracking scripts. Mega-worse: some random script can stop the site from loading...

Karabiner script for Dvorak left hand

— August 6, 2018

My primary keyboard’s cord is unable to move without dropping the connection, so I switched to an even older Apple Pro Keyboard. The keys are the same, but there’s a plastic stand dealy on the back that, given that it sits on my lap, is likely to break and leaves sizable divots in my legs. I have a similar vintage dell keyboard for the PC, but...

ecommerce University

— March 14, 2018

While working on a Shopify problem (applying a discount code to the highest priced item), I found this page (https://ecommerce.shopify.com/c/shopify-apis-and-technology/t/apply-discount-to-most-expensive-item-in-cart-464958). There’s a lot of discussion on the page, but the examples repeatedly use line_item.change_line_price(high.variant.price * 0.80, message: "discount"). This is wrong, as line_price is the line item price, not the variant price. It is the initially defined as the quantity * variant.price, though obviously the discount...

Shopify images for blog posts

— February 16, 2018

It is unfortunate that the Files doesn’t have an upload API that people have been asking for for at least 4 years, and apparently existed at one point. Here’s a sample solution for when you have copied the blog posts (there are several apps that do that), but now the linked images don’t work. You will need to put the images somewhere. One could use the...

Converting Product Images on Shopify

— January 8, 2018

First, it is easier and generally preferable to do this in the product uploading import CSV. But lets say the upload has already occurred, against your advice they used giant PNG images and now it is your problem to fix it because unsurprisingly the collection page loads slowly. This is not something the admin console can do, so here’s a PHP script to download png images,...

Uploading variant images to Shopify

— January 8, 2018

First, it is easier and generally preferable to do this in the product uploading import CSV. But lets say the upload has already occurred, and now it is your problem to upload images to individual variants. You could log in, open the Javascript console, and run some api calls to do this. [NOTE: this is just a guide for somebody reasonably familiar with Javascript to take...

Fault tolerant jQuery .when()

— January 8, 2018

When getting data from a set of REST endpoints, some times the correct result comes back as an HTTP error. If you were managing the set of ajax calls with jQuery’s .when, it will fail/stop as soon as one of the items returns an error. I still want the rest of the data, though. function failTolerantPromises(promises) { return $.map(promises, function(p) { var dfd = $.Deferred() p.always(function()...

Filtering Shopify product lists

— November 24, 2017

Normally Shopify only lets you filter by up to 3 product tags. It doesn’t offer any sort of boolean options, or the ability to filter anything else. There’s not much you can do about that. It is just what Shopify’s search does. Unfortunately, something like a single slider selector (greater than X AND less than Y) would occupy 2 of your 3 slots, even if it...

Slack + SVN

— September 1, 2016

Git has all sorts of Slack integrations. I’m a bigger fan of git once I found the max-depth thing, the exact syntax of which I’ve already forgotten. (so cloning a repo doesn’t download the entire repo history, which may include massive media files or entirely different websites) However, I still like svn. In an effort to increase our velocity or flywheel or other business sounding keywords...

older »