Polymorphic and Route Concerns... who is who?

The goal of this post is to outline some tips on easily figuring out the parent object for a polymorphic modal/route/controller. Let's start with the basics... Polymorphic For those unfamiliar to it, Polymorphic is an Active Record association type where a model can belong to other models. As…

Calculating Percent Saved with Shopify

Visually displaying to the customer how much they are saving is a big help to driving them towards a purchase. This is a simple snippet and guide to help you achieve this functionality in your Shopify stores. First, to calculate the percentage saved, lets look at the basic math for…

all_products... finally

Shopify has finally implemented a global variable for accessing products. Shopify has global variables for many things like Collections, Linklists, pages, etc, so you can do things such as access a collection by its handle collections.my-cool-toys.products. However, it always lacked the ability to look up products by their…

Get Original Sized Images from a Wordpress Post Gallery

Recently I was working on a project where I needed to modify an existing page which had multiple galleries. This change required me to have access to the original uploaded images. Heres a simple function I wrote which returns the images easily in an array format. # Input Hey comes see…

Quickly Get All Products in Your Shopify Store with Ruby

This is a simple snippet I've used over-and-over again this year to batch process products (modify tags, pricing, etc). It simply calculates the number of pages of products, pushes each page of products into a master array and returns them all. Should work well for others so I thought I…

Get Single Field Error in Symfony

This is just a quick tid-bit/how-to! Recently a project came up where special front-end actions and structures had to take place within the view of the Twig template once an error occurred on specific fields. It also didn't require enough attention to warrant creating a form theme. This is…

Woocommerce - Sorting Product by Category

This past week I was assigned to heavily customize a Woocommerce install on a client's successful store. What needed to be done on one task, was to give the customers the ability to filter products on the product's page by a specific set of categories. In other words: Only show…

Simple Password Checking with Symfony and FOS User Bundle

Recently for a project, a co-developer wanted to validate someone's record in the database from an Android application and the website was using Symfony 2.3 with FOS User Bundle. Specifically this developer did not want to log the user in, only to check their login against the database. So…

Gathering User-Input with Shopify

Shopify includes everything you need to setup an online store, including free web-based store building software, unlimited ecommerce website hosting, and more. It is a great tool for both users and __developers. __It offers a great API which has libraries for many languages (PHP, Python, Ruby, ...) and a great back-end…