Skip to content

Instantly share code, notes, and snippets.

@foysalit
Created June 19, 2013 23:11
Show Gist options
  • Save foysalit/5818950 to your computer and use it in GitHub Desktop.
Save foysalit/5818950 to your computer and use it in GitHub Desktop.
hack the woocommerce ajax reload of the order review.
remove_action('woocommerce_checkout_order_review', 'woocommerce_order_review');
add_action('woocommerce_checkout_order_review', 'cu_pr_update_order_review', 10);
function cu_pr_update_order_review() {
ob_start();
global $woocommerce;
woocommerce_get_template( 'checkout/review-order.php', array( 'checkout' => $woocommerce->checkout() ) );
$table = ob_get_contents();
ob_end_clean();
$modified = preg_replace('#<span class="amount">.*</span>#', '<span class="amount">Gratis</span>', $table);
echo $modified;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment