Skip to content

Instantly share code, notes, and snippets.

View cpres's full-sized avatar

C- Pres cpres

  • Zevo // Sacshiki
  • Oakland, CA
View GitHub Profile
@cpres
cpres / wp8-mobile-view.html
Created July 3, 2014 00:55
Windows Phone 8 Helper Script - For use with Bootstrap.js and others
<script type="text/javascript">
<!--
(function() {
if ("-ms-user-select" in document.documentElement.style && navigator.userAgent.match(/IEMobile\/10\.0/)) {
var msViewportStyle = document.createElement("style");
msViewportStyle.appendChild(
document.createTextNode("@-ms-viewport{width:auto!important}")
);
document.getElementsByTagName("head")[0].appendChild(msViewportStyle);
}
@cpres
cpres / shopifyCartMethods
Last active October 8, 2018 18:55
Robust Shopify Cart JS Methods
__init__: function (p) {
var self = this;
self.initialConfig = p;
Shopify.queue = [];
},
addItem: function(prod,num, attr) {
var num = (num) ? num : 1;
this.pushQueue(prod,num,attr);
},
{% comment %}
To add a companion product to the cart automatically if a primary product is in cart:
1. Create a new link list under your Navigation tab.
2. In that link list, make the first link point to companion product.
3. Copy your link list handle where indicated at line 9
4. Set the minimum cart total required for the bonus product on line 10
{% endcomment %}
{% assign linklist = linklists['put-your-link-list-handle-here'] %}
{% assign min_total = 100 %}
@cpres
cpres / file1.txt
Created September 20, 2017 21:43
Created via API
Demo