Skip to content

Commit 9f8e99a

Browse files
committed
Optimize payments handle
1 parent 015b251 commit 9f8e99a

File tree

9 files changed

+1624
-6
lines changed

9 files changed

+1624
-6
lines changed

assets/channels.png

12.1 KB
Loading

assets/icon-256x256.png

6.8 KB
Loading

assets/images/screenshot-4.png

34.6 KB
Loading

assets/woo-notchpay.png

28.9 KB
Loading

includes/class-wc-gateway-notchpay.php

Lines changed: 647 additions & 4 deletions
Large diffs are not rendered by default.

includes/notchpay-order-statuses.php

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?php
2+
3+
/**
4+
* Add new Invoiced status for woocommerce
5+
*/
6+
add_action('init', 'register_notchpay_new_order_statuses');
7+
8+
function register_notchpay_new_order_statuses()
9+
{
10+
register_post_status('wc-invoiced', array(
11+
'label' => _x('Invoiced', 'Order status', 'wc-notchpay'),
12+
'public' => true,
13+
'exclude_from_search' => false,
14+
'show_in_admin_all_list' => true,
15+
'show_in_admin_status_list' => true,
16+
'label_count' => _n_noop('Invoiced <span class="count">(%s)</span>', 'Invoiced<span class="count">(%s)</span>', 'wc-notchpay')
17+
));
18+
}
19+
20+
add_filter('wc_order_statuses', 'notchpay_wc_order_statuses');
21+
22+
// Register in wc_order_statuses.
23+
function notchpay_wc_order_statuses($order_statuses)
24+
{
25+
$order_statuses['wc-invoiced'] = _x('Invoiced', 'Order status', 'wc-notchpay');
26+
return $order_statuses;
27+
}
28+
29+
function notchpay_add_bulk_invoice_order_status()
30+
{
31+
global $post_type;
32+
33+
if ($post_type == 'shop_order') {
34+
?>
35+
<script type="text/javascript">
36+
jQuery(document).ready(function() {
37+
jQuery('<option>').val('mark_invoiced').text('<?php _e('Change status to invoiced', 'wc-notchpay'); ?>').appendTo("select[name='action']");
38+
jQuery('<option>').val('mark_invoiced').text('<?php _e('Change status to invoiced', 'wc-notchpay'); ?>').appendTo("select[name='action2']");
39+
});
40+
</script>
41+
<?php
42+
}
43+
}
44+
45+
add_action('admin_footer', 'notchpay_add_bulk_invoice_order_status');

0 commit comments

Comments
 (0)