Skip to content

Instantly share code, notes, and snippets.

View growdev's full-sized avatar
😎
Future's so bright...

Daniel Espinoza growdev

😎
Future's so bright...
View GitHub Profile
@growdev
growdev / growdev-remove-states.php
Created May 13, 2015 15:05
Remove USA non-contiguous 48 states from WooCommerce
<?php
/*
* Plugin Name: Grow Development Remove States
* Plugin URI: http://growdevelopment.com/
* Description: This plugin removes states, provinces and armed forces locations outside contiguous 48 states.
* Version: 1.0.0
* Author: Grow Development
* Author URI: http://growdevelopment.com/
*
*/
@growdev
growdev / gist:b68e35b5c6e0856bdbf1
Created March 19, 2015 19:01
Delete all WooCommerce Products with wp-cli
wp post list --field=ID --post_type=product | xargs wp post delete --force
@growdev
growdev / gist:ad915038172511975fbd
Created December 3, 2014 20:03
Remove WooThemes Helper plugin nag
<?php
add_action( 'init', 'growdev_remove_woo_nag' );
/**
* Remove the admin notice nagging you to install/activate the WooThemes Helper plugin
* This notice should be dismissable, but isn't.
*
*/
function growdev_remove_woo_nag() {
remove_action( 'admin_notices', 'woothemes_updater_notice' );
@growdev
growdev / gist:4a1426305d0f425a5486
Last active April 4, 2020 21:11
Remove Unused Payment Gateways from Dashboard
<?php
add_filter( 'woocommerce_payment_gateways', 'growdev_remove_unused_payment_gateways', 20, 1 );
/**
* This function will remove all of the WooCommerce standard gateways from the
* WooCommerce > Settings > Checkout dashboard.
* @see current default gateways https://github.com/woocommerce/woocommerce/blob/master/includes/class-wc-payment-gateways.php#L77-L85
*/
function growdev_remove_unused_payment_gateways( $load_gateways ) {
@growdev
growdev / gist:967ad18e4bde62cdc190
Created November 11, 2014 22:53
Add text to the Price based on conditional in WooCommerce
<?php
add_filter( 'woocommerce_get_price_html', 'growdev_custom_price_message', 30, 2 );
/**
* Add string to
*
* @param $price HTML string
* @param $product WC_Product object
* @return string
*/
@growdev
growdev / gist:3e084f833a3f27bf54af
Created October 14, 2014 14:10
Getting WooCommerce Cart Subtotal
<?php
add_action('woocommerce_cart_updated', 'growdev_woocommerce_cart_updated', 90);
function growdev_woocommerce_cart_updated ( $cart ){
// output subtotal
error_log( "subtotal: " . WC()->cart->subtotal );
// output the
error_log( "get_cart_subtotal: " . WC()->cart->get_cart_subtotal() );
@growdev
growdev / gist:164f23e0f6294cb17956
Created October 8, 2014 14:30
Change WooCommerce Add To Cart test on product page
<?php
// The Add to cart form is in this template file
// /woocommerce/templates/single-product/add-to-cart/simple.php
// and calls WC_Product::single_add_to_cart_text() to get the text for the button.
// This is the filter that is set around that text.
add_filter('woocommerce_product_single_add_to_cart_text', 'growdev_change_addtocart');
function growdev_change_addtocart( $arg ) {
// Change the argument to the new text for the button
$arg = "BUY NOW";
#!/bin/bash
# args
MSG=${1-'deploy from git'}
BRANCH=${2-'trunk'}
# paths
SRC_DIR=$(git rev-parse --show-toplevel)
DIR_NAME=$(basename $SRC_DIR)
DEST_DIR=~/svn/wp-plugins/$DIR_NAME/$BRANCH
@growdev
growdev / css_resources.md
Created June 11, 2014 03:18 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

@growdev
growdev / javascript_resources.md
Created June 11, 2014 03:17 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage