Skip to content

Commit

Permalink
Optimize payments handle
Browse files Browse the repository at this point in the history
  • Loading branch information
chapdel committed Nov 21, 2022
1 parent 015b251 commit 9f8e99a
Show file tree
Hide file tree
Showing 9 changed files with 1,624 additions and 6 deletions.
Binary file added assets/channels.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icon-256x256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/screenshot-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/woo-notchpay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
651 changes: 647 additions & 4 deletions includes/class-wc-gateway-notchpay.php

Large diffs are not rendered by default.

45 changes: 45 additions & 0 deletions includes/notchpay-order-statuses.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?php

/**
* Add new Invoiced status for woocommerce
*/
add_action('init', 'register_notchpay_new_order_statuses');

function register_notchpay_new_order_statuses()
{
register_post_status('wc-invoiced', array(
'label' => _x('Invoiced', 'Order status', 'wc-notchpay'),
'public' => true,
'exclude_from_search' => false,
'show_in_admin_all_list' => true,
'show_in_admin_status_list' => true,
'label_count' => _n_noop('Invoiced <span class="count">(%s)</span>', 'Invoiced<span class="count">(%s)</span>', 'wc-notchpay')
));
}

add_filter('wc_order_statuses', 'notchpay_wc_order_statuses');

// Register in wc_order_statuses.
function notchpay_wc_order_statuses($order_statuses)
{
$order_statuses['wc-invoiced'] = _x('Invoiced', 'Order status', 'wc-notchpay');
return $order_statuses;
}

function notchpay_add_bulk_invoice_order_status()
{
global $post_type;

if ($post_type == 'shop_order') {
?>
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery('<option>').val('mark_invoiced').text('<?php _e('Change status to invoiced', 'wc-notchpay'); ?>').appendTo("select[name='action']");
jQuery('<option>').val('mark_invoiced').text('<?php _e('Change status to invoiced', 'wc-notchpay'); ?>').appendTo("select[name='action2']");
});
</script>
<?php
}
}

add_action('admin_footer', 'notchpay_add_bulk_invoice_order_status');
Loading

0 comments on commit 9f8e99a

Please sign in to comment.