Skip to content

Instantly share code, notes, and snippets.

View getmanzooronline's full-sized avatar
👨‍💻
Working from Home

Mansoorkhan T K getmanzooronline

👨‍💻
Working from Home
View GitHub Profile
@getmanzooronline
getmanzooronline / gist:a16605fb8e657280dc207356a8ff3e67
Created October 22, 2020 05:22 — forked from mikejolley/gist:c4606aa52754b334f0f1bbe7e5b5ca6b
WooCommerce - remove payment method from emails
<?php // Do not include this if already open!
/**
* Code goes in theme functions.php.
*/
add_filter( 'woocommerce_get_order_item_totals', 'custom_woocommerce_get_order_item_totals' );
function custom_woocommerce_get_order_item_totals( $totals ) {
unset( $totals['payment_method'] );
return $totals;
@getmanzooronline
getmanzooronline / wc_order_status_changes.php
Created April 19, 2020 04:23 — forked from abegit/wc_order_status_changes.php
WooCommerce Hooks for Order Status Changes
function mysite_pending($order_id) {
error_log("$order_id set to PENDING", 0);
}
function mysite_failed($order_id) {
error_log("$order_id set to FAILED", 0);
}
function mysite_hold($order_id) {
error_log("$order_id set to ON HOLD", 0);
}
function mysite_processing($order_id) {
<?php
/*
This function saved my life.
found on: http://www.sitepoint.com/forums//showthread.php?t=438748
by: crvandyke
It takes an object, and when all else if/else/recursive functions fail to convert the object into an associative array, this one goes for the kill. Who would'a thunk it?!
*/
$array = json_decode(json_encode($object), true);