Skip to content

Instantly share code, notes, and snippets.

@psaikali
Created September 20, 2017 16:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save psaikali/3e4dbb16766dd411505ebf9ce0a13dc2 to your computer and use it in GitHub Desktop.
Save psaikali/3e4dbb16766dd411505ebf9ce0a13dc2 to your computer and use it in GitHub Desktop.
Afficher la description d'un code promo sur la page de commande WooCommerce
<?php
/**
* Afficher la description d'un code promo
* Illustré sur http://media.mosaika.fr/mcbj
*/
function msk_display_coupon_description($value, $coupon) {
$new_value = sprintf('%1$s <small class="coupon-description">%2$s</small>', $value, $coupon->get_description());
return $new_value;
}
add_filter('woocommerce_cart_totals_coupon_label', 'msk_display_coupon_description', 10, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment