Skip to content

Instantly share code, notes, and snippets.

Building WP Shopify

Andrew Robbins arobbins

Building WP Shopify
Block or report user

Report or block arobbins

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
arobbins / Gulpfile.js
Last active Aug 29, 2015
My Gulp setup, feel free to use
View Gulpfile.js
/* ====================================================================
==================================================================== */
var gulp = require('gulp'),
browserSync = require('browser-sync'),
sass = require('gulp-sass'),
concat = require('gulp-concat'),
minifyCSS = require('gulp-minify-css'),
jshint = require('gulp-jshint'),
rename = require('gulp-rename'),
arobbins / onename.txt
Created Feb 27, 2016
Oenname verification
View onename.txt
Verifying that +simpleblend is my blockchain ID.

Keybase proof

I hereby claim:

  • I am arobbins on github.
  • I am arobbins ( on keybase.
  • I have a public key ASA9j69jqgvPEHf8fTVCUrEc3m0EiH_vd-a-JF3EfGE3VAo

To claim this, I am signing this object:

arobbins / wps-custom.php
Last active Jan 5, 2018
Amanda's WP Shopify customizations
View wps-custom.php
// Shows / Enables WordPress Sidebar on WP Shopify products-all template
function wps_products_show_sidebar_callback() {
return true;
add_filter('wps_products_show_sidebar', 'wps_products_show_sidebar_callback');
arobbins / wps-custom-order-data-js.js
Last active Jan 23, 2018
Custom order data example - AJAX sender
View wps-custom-order-data-js.js
Step 1. Add an AJAX POST request to the add to cart click event.
Resolves through the then() method once the data has been saved. You'll need to
write some jQuery to fill in the "dynamicValues" object according to your own markup
jQuery('.wps-add-to-cart').on('click', function(e) {
arobbins / wps-custom-order-data-ajax-action.php
Last active Jan 23, 2018
Custom order data example - AJAX receiver
View wps-custom-order-data-ajax-action.php
Step 2. Save any dynamic values to the users Session
We're calling this function from the frontend javascript via the 'save_dynamic_values_to_session' AJAX action.
function save_dynamic_values_to_session() {
arobbins / wps-custom-order-data-attrs.php
Last active Jan 23, 2018
Custom order data example - Order attributes filter
View wps-custom-order-data-attrs.php
Step 3. Saves any dynamic session variables to the Shopify order. Fires once the user clicks the checkout button.
function namespace_cart_checkout_attrs() {
// Gain access to the global $_SESSION variable
arobbins / wps-custom-order-save-data.php
Last active Jan 23, 2018
Custom order data example - Save order data
View wps-custom-order-save-data.php
Step 4. Once the order is successfully paid for ...
The $order parameter contains all the data contained here (scroll down to the Order webhook):
function namespace_checkouts_order_paid($order) {
arobbins / example-bitcoin-transaction.json
Last active Jan 25, 2018
Example Bitcoin transaction
View example-bitcoin-transaction.json
"ver": 1,
"inputs": [
"sequence": 4294967295,
"witness": "",
"prev_out": {
"spent": true,
"tx_index": 326817500,
"type": 0,
You can’t perform that action at this time.