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
<div> | |
<img src='wp-content/uploads/2017/09/safe_checkout1.png' > | |
<img src='wp-content/uploads/2017/09/payment-secure-ssl.jpg' width="100" height="100"> | |
</div> |
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
public function change_woocommerce_order_number( $order_id ) { | |
global $wpdb; | |
$prefix = '/RM/'; | |
$suffix = '/TS'; | |
$order = wc_get_order( $order_id ); | |
$order_date = $order->get_date_created(); | |
$date_created = $order_date->date( 'Y-m-d' ); | |
$query = "SELECT ID FROM {$wpdb->prefix}posts WHERE post_date LIKE '%".$date_created."%' AND post_type='shop_order' ORDER BY ID "; | |
$result = $wpdb->get_results( $query ); | |
$count = 0; |
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
add_action( 'init', array( &$this, 'register_new_order_status' ) ); | |
public function register_new_order_status() { | |
register_post_status( 'wc-scheduled', array( | |
'label' => 'Scheduled', | |
'public' => true, | |
'exclude_from_search' => false, | |
'show_in_admin_all_list' => true, | |
'show_in_admin_status_list' => true, | |
'label_count' => _n_noop( 'Scheduled <span class="count">(%s)</span>', 'Scheduled <span class="count">(%s)</span>' ) |
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
add_filter( 'wc_order_statuses', array( &$this, 'add_new_order_status' ), 10, 1 ); | |
public function add_new_order_status( $order_statuses ) { | |
$order_statuses['wc-scheduled'] = _x( 'Scheduled', 'Order Status', '' ); | |
return $order_statuses; | |
} |
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
add_filter( 'woocommerce_order_number', 'change_woocommerce_order_number' ); |
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
add_filter( 'woocommerce_order_number', 'change_woocommerce_order_number' ); | |
function change_woocommerce_order_number( $order_id ) { | |
$suffix = '/TS'; | |
$order = wc_get_order( $order_id ); | |
$order_date = $order->get_date_created(); | |
$new_order_id = $order_id .'/ '.$order_date. $suffix; | |
return $new_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
add_filter( 'woocommerce_order_number', 'change_woocommerce_order_number' ); | |
function change_woocommerce_order_number( $order_id ) { | |
$suffix = '/TS'; | |
$order = wc_get_order( $order_id ); | |
$order_date = $order->get_date_created(); | |
$date_created = $order_date->date( 'Y-m-d' ); | |
$new_order_id = $order_id .'/ '.$date_created. $suffix; | |
return $new_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
function show_content_after_add_to_cart() { | |
echo "<h1>Hello World</h1>"; | |
} |
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
function show_content_after_add_to_cart() { | |
echo "<img src='safe_checkout.png' >"; //add image URL in the src attribute | |
} |
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
function show_content_after_add_to_cart() { | |
global $post; | |
$product_id = $post->ID; | |
$categories = get_the_terms( $product_id, 'product_cat' ); | |
if( empty( $categories ) ) { | |
return; | |
} | |
foreach( $categories as $cat ) { |