Plugin Directory

Changeset 2983173


Ignore:
Timestamp:
10/24/2023 04:11:35 PM (2 years ago)
Author:
bookvault
Message:

3.0.1

Fixing issue with orders not resending

Location:
bookvault
Files:
12 added
2 edited

Legend:

Unmodified
Added
Removed
  • bookvault/trunk/Bookvault.php

    r2983154 r2983173  
    33    * Plugin Name: Bookvault
    44    * Description: Bookvault plugin for Woocommerce
    5     * Version: 3.0.0
     5    * Version: 3.1.0
    66    * License:     GPL v3
    77    * Requires at least: 5.6
     
    399399
    400400
    401 // Function to add a custom action to the order actions dropdown
    402 function bvlt_add_order_action($actions, $order) {
    403     // Add your custom action to the $actions array
    404     if (get_option("bvlt_auth") == 1) {
    405         $actions['bvlResendOrder'] = 'Resend Order To Bookvault';
     401add_action('woocommerce_order_actions', 'bvlt_order_resend', 10, 1 );
     402function bvlt_order_resend( $actions ) {
     403
     404    if ( is_array( $actions ) ) {
     405        $actions['blt_resend_order'] = __( 'Resend Order To Bookvault' );
    406406    }
    407     return $actions;
    408 }
    409 add_filter('woocommerce_order_actions', 'bvlt_add_order_action', 10, 2);
    410 
    411 // Function to handle the custom action when clicked
    412 function bvlt_order_action_handler($order) {
    413     // Add your custom action handling code here
    414     // You can use the $order object for additional processing
    415     // For example, send an email, update the order status, etc.
    416     // The order ID can be accessed as $order->get_id()
     407
     408    return $actions;
     409
     410}
     411
     412/**
     413 * Filter name is woocommerce_order_action_{$action_slug}
     414 */
     415add_action( 'woocommerce_order_action_blt_resend_order', 'bvlt_order_resend_action' );
     416function bvlt_order_resend_action( $order ) {
    417417    resendOrder($order->get_id());
    418418}
    419 add_action('woocommerce_order_action_custom_action', 'bvlt_order_action_handler');
    420 
    421419
    422420// Adding to admin order list bulk dropdown a custom action 'custom_downloads'
     
    430428
    431429// Make the action from selected orders
    432 add_filter( 'handle_bulk_actions-edit-shop_order', 'downloads_handle_bulk_action_edit_shop_order', 10, 3 );
    433 function downloads_handle_bulk_action_edit_shop_order( $redirect_to, $action, $post_ids ) {
     430add_filter( 'handle_bulk_actions-edit-shop_order', 'bvlt_bulk_resend_orders', 10, 3 );
     431
     432function bvlt_bulk_resend_orders( $redirect_to, $action, $post_ids ) {
    434433    if ( $action !== 'bvlt_resend_orders' )
    435434        return $redirect_to; // Exit
  • bookvault/trunk/readme.txt

    r2983154 r2983173  
    55Tested up to: 6.3
    66Requires PHP: 5.6
    7 Stable tag: 3.0
     7Stable tag: 3.1
    88License: GPLv3 or later
    99License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
     
    6868* Ability to batch resend orders
    6969* Fixed the stability of the portal
     70
     71= 3.1 =
     72* Fixed bug with orders not being resent from the order page
Note: See TracChangeset for help on using the changeset viewer.