Skip to content

Instantly share code, notes, and snippets.

View CaptainHilly's full-sized avatar

Jason Hill CaptainHilly

  • Gold Coast, Australia
View GitHub Profile
@CaptainHilly
CaptainHilly / custom.js
Created August 23, 2015 00:46
Overwrite add to cart modals, header cart template and any others to force funnel through Cart -> Checkout
$.addToCartInit({
'cart_id' : 'cartcontents',
'target_id': 'cartcontentsheader',
'image_rel': 'itmimg',
'cart' : {
'header': '<div class="thumb_cart"><ul>',
'body': '<li><div class="left"><a href="##producturl##" ><img src="##image##" alt="##parent_name## ##name##" width="50px" height="50px"></a></div>' + '<div class="right"><a href="javascript:$.removeCartItem(\'##sku##\');" class="float_right"><img src="/assets/icons/cross.png" alt="Remove From Cart"></a><div class="title"><a href="##producturl##"><b>##qty##</b> x ##parent_name## ##name## <i>##extra##</i></a></div>' + '<div class="price">Price: ##price##</div></div></li>',
'body_withunit': '<li><div class="left"><a href="##producturl##" ><img src="##image##" alt="##parent_name## ##name##" width="50px" height="50px"></a></div>' + '<div class="right"><a href="javascript:$.removeCartItem(\'##sku##\');" class="float_right"><img src="/assets/icons/cross.png" alt="Remove From Cart"></a><div class="title"><a href="##producturl##"><b>##baseqty## ##base_u
@CaptainHilly
CaptainHilly / gist:6dec80320bbdc3fb96aa
Created April 28, 2015 02:33
Create barcode for neto tags
<img src="[%BARCODE_URL fn:'barcode' barcode:'[@order_id@]' height:'60' /%]" border="0">
@CaptainHilly
CaptainHilly / gist:cf728f4e871783e75fa9
Created April 24, 2015 04:00
Show product variations on thumb
<!-- MXSTORE CUSTOM - SHOW VARIATIONS ON CAT THUMB -->
<p class="available">
<!--##[%IF [@store_quantity@] > 0%]##-->
<!--##[%list_item_variations id:'[@sku@]'%]
[%PARAM *variation_header%]##-->
<span>Available: </span>
<!--##[%END PARAM%]
[%PARAM *variation_body%]##-->
<!--##[%IF [@variation_qty@] > 0%]##-->
@CaptainHilly
CaptainHilly / gist:dfe245a378328407b7e6
Created April 24, 2015 04:00
List Warehouse quantities
<!--##[%warehouse_qty id:'[@SKU@]'%]
[%PARAM *header%]##-->
<div class="span4" style="margin:0;">
<!--##[%END PARAM%]
[%PARAM *body%]##-->
<span class="label label-success">In Stock in [@warehouse_name@]</span>
<!--##[%END PARAM%]
[%PARAM *footer%]##-->
<p><a href="[%URL type:'cms' id:'2114' nohost:'1' /%]" id="availability" class="small">Availability explained?</a></p>
</div>
@CaptainHilly
CaptainHilly / gist:1ef610d6104dee421245
Created April 20, 2015 05:24
Add versioning to css files - add number after [%END NTHEME_ASSET%]
<link rel="stylesheet" type="text/css" href="[%NTHEME_ASSET%]css/override.css[%END NTHEME_ASSET%]001" media="all" />
@CaptainHilly
CaptainHilly / stuff
Created April 19, 2015 03:33
Get content alt Image
<img src="[%ASSET_URL type:'content' thumb:'alt_1' id:'[@content_id@]'%][%END ASSET_URL%]"/>
@CaptainHilly
CaptainHilly / gist:fe94a879819aa131d82a
Created April 14, 2015 13:34
Remove styling from IOS buttons/select boxes
-webkit-appearance:none;
@CaptainHilly
CaptainHilly / gist:61e2641d7bfa2d32dcf1
Created April 9, 2015 04:38
Trigger Bootstrap Tab toggle with onclick
<a href="#" data-toggle="tab" onClick="$('a[href=#reviews]').tab('show'); $('html,body').animate({scrollTop:$('a[href=#reviews]').offset().top}, 600); return false;"> Link Content </a>
[@user:email@]
[@user:bill_first_name@]
etc...
@CaptainHilly
CaptainHilly / gist:d1d18a0fb0ee147b6c66
Created April 2, 2015 01:27
GA Event on page load
<script type="text/javascript">
$(document).ready(function() {
_gaq.push(["_trackEvent", "Error", "Checkout", "[@info_msg@]"]);
});
</script>