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 | |
function dctit_add_coupon_to_email( $order ) { | |
$coupons = $order->get_items('coupon'); | |
foreach ($coupons as $item_id => $item) { | |
$coupon = new WC_Coupon( $item['name'] ); | |
$post = get_post($coupon->id); | |
echo "<p class='coupon-used'><span class='coupon-name'><b>Coupon: " . $item['name'] . "</b></span></p>"; | |
echo "<p><span class='coupon-description'>" . $post->post_excerpt . "</span></p>"; | |
} |
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 | |
/** | |
* Auto Complete all WooCommerce orders. | |
*/ | |
function dctit_custom_woocommerce_auto_complete_order( $order_id ) { | |
if ( ! $order_id ) { | |
return; | |
} | |
$order = wc_get_order( $order_id ); |
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 | |
/** Flush all caches of W3TC | |
* Weekly basis | |
*/ | |
//add weekly shcedule to wp cron | |
function dctit_cron_add_weekly( $schedules ) { | |
//adds once weekly to the existing schedules. | |
$schedules['weekly'] = array( | |
'interval' => 604800, |
NewerOlder