This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** Add a Purchased Column w/ Item Quantity, SKU, Name, & Meta to the Admin Orders Table **/ | |
class ThemeWooCommerce | |
{ | |
/* Add a `Purchased` Column to the Admin Orders Table */ | |
public static function add_purchased_column_header($columns) { | |
$new_columns = array(); | |
foreach ($columns as $key => $title) { | |
if ($key === 'billing_address') { | |
$new_columns['order_items'] = __('Purchased', 'woocommerce'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Works with WooCommerce 3.2.6 | |
add_action( 'woocommerce_shipping_init', 'econt_shipping_method' ); | |
function econt_shipping_method() { | |
if ( ! class_exists( 'WC_Econt_Shipping_Method' ) ) { | |
class WC_Econt_Shipping_Method extends WC_Shipping_Method { | |
public function __construct( $instance_id = 0 ) { | |
$this->instance_id = absint( $instance_id ); | |
$this->id = 'econt';//this is the id of our shipping method |