Skip to content

Instantly share code, notes, and snippets.

@mjesusabarca
mjesusabarca / edit-woocommerce-checkout-template.php
Created August 4, 2017 01:41 — forked from bekarice/edit-woocommerce-checkout-template.php
Add content and notices to the WooCommerce checkout - sample code
/**
* Each of these samples can be used - note that you should pick one rather than add them all.
*
* How to use WC notices: https://github.com/woothemes/woocommerce/blob/master/includes/wc-notice-functions.php#L96
* Tutorial: http://www.skyverge.com/blog/edit-woocommerce-templates/
**/
/**
* Add a content block after all notices, such as the login and coupon notices.
*
@mjesusabarca
mjesusabarca / wc-empty-cart-notice.php
Created August 4, 2017 00:59 — forked from bekarice/wc-empty-cart-notice.php
WooCommerce: Show a notice throughout the store if the cart is empty
/**
* Tutorial: http://www.skyverge.com/blog/check-if-woocommerce-cart-is-empty/
**/
function skyverge_empty_cart_notice() {
if ( WC()->cart->get_cart_contents_count() == 0 ) {
wc_print_notice( __( 'Get free shipping if your order is over $60!', 'woocommerce' ), 'notice' );
// Change notice text as desired
}
@mjesusabarca
mjesusabarca / jquery.nivo.slider.js
Created July 27, 2017 16:16 — forked from cubika/jquery.nivo.slider.js
nivo slider -- picture slide plugin
/*
* jQuery Nivo Slider v3.2
* http://nivo.dev7studios.com
*
* Copyright 2012, Dev7studios
* Free to use and abuse under the MIT license.
* http://www.opensource.org/licenses/mit-license.php
*/
(function($) {
@mjesusabarca
mjesusabarca / gist:f0bcabc3565f25a29fc52d64402774f6
Created July 13, 2017 04:54 — forked from mikejolley/gist:9971101
WC customising checkout fields using actions and filters - Lesson 3 snippet 1
/**
* Add the field to the checkout
*/
add_action( 'woocommerce_after_order_notes', 'my_custom_checkout_field' );
function my_custom_checkout_field( $checkout ) {
echo '<div id="my_custom_checkout_field"><h2>' . __('My Field') . '</h2>';
woocommerce_form_field( 'my_field_name', array(
@mjesusabarca
mjesusabarca / CS_BJS_101.md
Created May 18, 2017 14:07 — forked from 37celsius/CS_BJS_101.md
Learning Backbone JS

Anatomy of Backbone JS 1

/* Welcome to the Anatomy of Backbone.js challenges! We're going to be building a simple Appointment app for our friend, Dr. Goodparts.

So, let's get started and create an Appointment model class.
*/

// Create a model class
var Appointment = Backbone.Model.extend({});
@mjesusabarca
mjesusabarca / theReturnFlight1-6-free.js
Last active May 1, 2017 22:09 — forked from lnmunhoz/theReturnFlight1-6.js
You've decided you only want to get photos of london. Use the data option of the $.ajax function to pass a location option. Get the location from the data-location on the #tour element using the data method.
DOM :
<div id="tour" data-location="london">
<button>Get Photos</button>
<ul class="photos">
</ul>
</div>
JS:
$(document).ready(function() {
var el = $("#tour")
@mjesusabarca
mjesusabarca / style.css
Created April 15, 2017 21:31 — forked from codeschool-courses/style.css
Journey Into Mobile - Challenge 1-3
body {
font-size: 62.5%; /* 1em = 10px */
}
h1 {
font-size: 2.4em; /* 24px / 10px */
}