Skip to content

Instantly share code, notes, and snippets.

@popforce
popforce / functions.php
Last active December 17, 2019 12:56 — forked from kloon/functions.php
WooCommerce total order weight column on orders page
<?php
add_filter( 'manage_edit-shop_order_columns', 'woo_order_weight_column' );
function woo_order_weight_column( $columns ) {
$columns['total_weight'] = __( 'Weight', 'woocommerce' );
return $columns;
}
add_action( 'manage_shop_order_posts_custom_column', 'woo_custom_order_weight_column', 2 );
function woo_custom_order_weight_column( $column ) {
global $post, $woocommerce, $the_order;
@popforce
popforce / wc-pos-core-functions.php
Last active March 21, 2024 06:16
Fix Memory Exhaustion for WooCommerce Point of Sale 5.5.4 by Actuality Exentsions + WPML in WP 6.4.3 / WC 8.7.0
<?php
/*
Line 310: Prevent PHP memory exhaustion while using translations by calling get_available_payment_gateways once
and not over and over.
*/
function wc_pos_get_available_payment_gateways() {
static $available_gateways = null;
if ($available_gateways === null) {
global $woocommerce;