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
<p><?php _e( 'There was a problem processing your order. Your transaction has been declined.', 'woocommerce' ); ?></p> | |
<p> | |
<?php | |
_e( 'Please attempt your purchase again.', 'woocommerce' ); | |
?> | |
</p> | |
<p> | |
<a href="<?php echo esc_url( $order->get_checkout_payment_url() ); ?>" class="button pay"><?php _e( 'Try Again', 'woocommerce' ) ?></a> |
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 | |
add_filter( "manage_edit-shop_order_sortable_columns", 'MY_COLUMNS_SORT_FUNCTION' ); | |
function MY_COLUMNS_SORT_FUNCTION( $columns ) | |
{ | |
$custom = array( | |
'MY_COLUMN_ID_1' => 'MY_COLUMN_1_POST_META_ID', | |
'MY_COLUMN_ID_2' => 'MY_COLUMN_2_POST_META_ID' | |
); | |
return wp_parse_args( $custom, $columns ); |
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 | |
add_action( 'manage_shop_order_posts_custom_column', 'MY_COLUMNS_VALUES_FUNCTION', 2 ); | |
function MY_COLUMNS_VALUES_FUNCTION( $column ) { | |
global $post; | |
$data = get_post_meta( $post->ID ); | |
//start editing, I was saving my fields for the orders as custom post meta | |
//if you did the same, follow this code | |
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 | |
/** | |
* Return the orders count of a specific order status. | |
* | |
* @param string $status | |
* @return int | |
*/ | |
function wc_orders_count( $status ) { | |
$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
<?php | |
public function woo_empty_cart_action() { | |
global $woocommerce; | |
if ( isset( $_REQUEST[ 'emptycart' ] ) && $_REQUEST[ 'emptycart' ] == 'yes' ) { | |
$woocommerce->cart->empty_cart(); | |
} | |
} |
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 | |
/** | |
* Empties the cart and optionally the persistent cart too. | |
* | |
* @param bool $clear_persistent_cart (default: true) | |
*/ | |
public function empty_cart( $clear_persistent_cart = true ) { | |
$this->cart_contents = array(); | |
$this->reset( true ); |
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 | |
add_filter( 'woocommerce_include_processing_order_count_in_menu', 'exclude_processing_order_count' ); | |
function exclude_processing_order_count( $show ) { | |
$show = false; | |
return $show; | |
} |
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 | |
if ( ! defined( 'ABSPATH' ) ) { | |
exit; | |
} | |
?> | |
<div class="woocommerce-order"> | |
<?php if ( $order ) : ?> |
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 | |
add_filter('woocommerce_thankyou_order_received_text', 'woo_change_order_received_text', 10, 2 ); | |
function woo_change_order_received_text( $str, $order ) { | |
$new_str = $str . ' We have emailed the purchase receipt to you.'; | |
return $new_str; | |
} |
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 | |
add_filter('woocommerce_thankyou_order_received_text', 'woo_change_order_received_text', 10, 2 ); | |
function woo_change_order_received_text( $str, $order ) { | |
$new_str = 'We have emailed the purchase receipt to you. Please make sure to fill <a href="http://localhost:8888/some-form.pdf">this form</a> before attending the event'; | |
return $new_str; | |
} |
OlderNewer