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( 'views_edit-shop_order', 'wpo_wc_show_all_refunded_orders', 10, 1 ); | |
function wpo_wc_show_all_refunded_orders ($views) { | |
$title = __('All refunded'); | |
$views['all-refunded'] = sprintf( '<a href="edit.php?post_status=wc-refunded&post_type=shop_order&all-refunded=true">%s</a>', $title ); | |
return $views; | |
} | |
add_filter( 'request', 'wpo_wc_show_all_refunded_orders_request' ); | |
function wpo_wc_show_all_refunded_orders_request( $query_vars ) { |
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( 'bulk_actions-edit-shop_order', 'woocommerce_bulk_actions_order_emails', 10 ); | |
function woocommerce_bulk_actions_order_emails( $actions ) { | |
$actions['send_order_details'] = __( 'Email invoice / order details to customer', 'woocommerce' ); | |
return $actions; | |
} | |
add_filter( 'handle_bulk_actions-edit-shop_order', 'woocommerce_bulk_actions_order_emails_handle', 10, 3 ); | |
function woocommerce_bulk_actions_order_emails_handle( $redirect_to, $action, $post_ids ) { | |
if ( $action !== 'send_order_details' ) { |
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('woocommerce_order_item_add_action_buttons','wpo_bulk_edit_line_item_prices',10,1); | |
function wpo_bulk_edit_line_item_prices($order) { | |
?> | |
<input type="text" class="bulk-multiply-items-multiplier" size="5" style="float:left;"><button type="button" class="button bulk-multiply-items">multiply prices</button> | |
<script> | |
jQuery(function($) { | |
$('.button.bulk-multiply-items').click(function(event){ | |
event.preventDefault(); | |
var multiplier = parseFloat( $('.bulk-multiply-items-multiplier').val() ); |
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( !empty( $post_meta ) ) { ?> | |
<table class="widefat striped" style="font-family:monospace; text-align:left; width:100%;"> | |
<tbody> | |
<?php foreach( $post_meta as $meta_name => $meta_value ) { ?> | |
<?php | |
if( count( maybe_unserialize( $meta_value ) ) == 1 ) | |
$meta_value = $meta_value[0]; | |
$meta_value = maybe_unserialize( $meta_value ); | |
?> |
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 | |
/******************************* | |
** DOKAN PDF INVOICE FILTERS ** | |
*******************************/ | |
/** | |
* Replace the main shop name with "Store Info" (actual shop name listed below) | |
*/ | |
add_filter( 'wpo_wcpdf_shop_name', 'wpo_wcpdf_add_dokan_shop_name', 10, 1 ); | |
function wpo_wcpdf_add_dokan_shop_name ( $shop_name ) { |
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( 'views_edit-shop_order', 'wc_hide_completed_link', 10, 1 ); | |
function wc_hide_completed_link ($views) { | |
$views['exclude-completed'] = sprintf('<a href="edit.php?exclude_order_status=wc-completed&post_type=shop_order">Hide completed orders</a>'); | |
return $views; | |
} | |
add_action( 'load-edit.php', 'wc_filter_completed' ); | |
function wc_filter_completed() { | |
global $typenow; |
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( 'wpmenucart_cart_link_item', 'wpmenucart_cart_checkout_buttons', 10, 1 ); | |
function wpmenucart_cart_checkout_buttons($cart_link_item) { | |
global $woocommerce; | |
// get urls | |
$checkout_url = $woocommerce->cart->get_checkout_url(); | |
$cart_url = $woocommerce->cart->get_cart_url(); | |
// make buttons |