Last active
June 15, 2021 14:35
-
-
Save PechenkiUA/9144afdf8d5971dd70464f0b3538d0d3 to your computer and use it in GitHub Desktop.
telsender coupons | woocommerce
This file contains 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 | |
/** | |
* Telsender coupons name | |
* @param $list | |
* @param $order_id | |
* @return mixed | |
*/ | |
function telsender_coupons($list, $order_id){ | |
// (optional if not defined) An instance of the WC_Order object | |
$order = wc_get_order( $order_id ); | |
$coupons = $order->get_coupon_codes(); | |
$coupon_line = implode(' | ', $coupons); | |
$list['{coupons}'] = $coupon_line; | |
return $list; | |
} | |
add_filter( 'tscf_filter_codetemplate','telsender_coupons', 20, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment