Skip to content

Instantly share code, notes, and snippets.

View whatthefork's full-sized avatar

Justin Hill whatthefork

View GitHub Profile
<?php
/**
* Plugin Name: WooCommerce Add CSS to Emails
* Plugin URI: https://gist.github.com/BFTrick/01cc414ee56ce93715ec
* Description: Add CSS styles to WooCommerce emails
* Author: Patrick Rauland
* Author URI: http://speakinginbytes.com/
* Version: 1.0
*
* This program is free software: you can redistribute it and/or modify
<?php
/**
* Plugin Name: WooCommerce Send Email
* Plugin URI: https://gist.github.com/BFTrick/9bd089bc53b11f7ac3fb
* Description: Send an email when a page loads. Useful for testing email functionality.
* Author: Patrick Rauland
* Author URI: http://speakinginbytes.com/
* Version: 1.0
*
* This program is free software: you can redistribute it and/or modify
<?php global $woocommerce; ?>
<a class="cart-contents" href="<?php echo $woocommerce->cart->get_cart_url(); ?>" title="<?php _e('View your shopping cart', 'woothemes'); ?>"><?php echo sprintf(_n('%d item', '%d items', $woocommerce->cart->cart_contents_count, 'woothemes'), $woocommerce->cart->cart_contents_count);?> - <?php echo $woocommerce->cart->get_cart_total(); ?></a>
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class FreightRatesAndService {
protected $username = '';
protected $password = '';
protected $accessKey = '';
protected $sandbox = '';
protected $endpointUrl = '';
protected static $endpointUrls = array(
<?php
function ibenic_get_all_zones() {
if( class_exists( 'WC_Shipping_Zones' ) ) {
$all_zones = WC_Shipping_Zones::get_zones();
return $all_zones;
}
return false;
}
@whatthefork
whatthefork / sodium-keypair-generator.php
Created May 23, 2019 20:32
Sodium - Generate keypair for signing
/*
SODIUM CRYPTO
GENERATE NEW KEY PAIR FOR PACKAGE SIGNING
You can use this to create a signing keypair and use it to sign plugins and themes for WordPress 5.2 and newer:
*/
function generate_new_key_pair() {
<?php
/*
Plugin Name: woocommerce modal variationn
Plugin URI: #
Description: show modal window with product variations after clicking -add to cart-.
Version: 0.1
Author: Maks Buriy
Author URI: mailto:byymster@gmail.com
License: GPL2
*/