Skip to content

Instantly share code, notes, and snippets.

@michaelgiles
michaelgiles / basic-servers.md
Created September 19, 2018 20:17 — forked from VikramTiwari/basic-servers.md
Simple Servers

When developing locally use the following servers

For Python 2.7x

python -m SimpleHTTPServer 8888 &

For Python 3.x

python -m http.server 8888 &
<?php
/**
* Loop Add to Cart -- with quantity and AJAX
* requires associated JavaScript file qty-add-to-cart.js
*
* @ref: http://snippets.webaware.com.au/snippets/woocommerce-add-to-cart-with-quantity-and-ajax/
* @ref: https://gist.github.com/mikejolley/2793710/
*/
// add this file to folder "woocommerce/loop" inside theme
add_action( 'woocommerce_before_cart', 'apply_matched_coupons' );
function apply_matched_coupons() {
global $woocommerce;
$get1 = 'getonech'; // your coupon code here
$get2 = 'gettwoch'; // your coupon code here
$get3 = 'getthreech'; // your coupon code here
$get4 = 'getfourch'; // your coupon code here
$get5 = 'getfivech'; // your coupon code here