Skip to content

Instantly share code, notes, and snippets.

View Ezep's full-sized avatar

Ezequiel Ezep

  • Buenos Aires, Argentina
View GitHub Profile
@Ezep
Ezep / function.php
Last active August 29, 2016 04:31
Woocommerce Discount/Fee from custom attribute
function ezep_cart_order_total_action(WC_Cart $cart){
global $woocommerce, $post;
$order = new WC_Order($post->ID);
$order_items = $woocommerce->cart->get_cart();
$discount = 0;
$discount_name = "Descuento por pago en efectivo";
$payment_method = "";
$payment_method_desired = "cod";