Plugin Directory

Changeset 1719324


Ignore:
Timestamp:
08/25/2017 12:30:15 PM (9 years ago)
Author:
francdore
Message:

Update version 1.0.5.
Fixed action buttons on order listing page.

Location:
woo-tracking-the-courier-guy/trunk
Files:
3 added
2 edited

Legend:

Unmodified
Added
Removed
  • woo-tracking-the-courier-guy/trunk/readme.txt

    r1718204 r1719324  
    44Requires at least: 3.0.1
    55Tested up to: 4.8.1
    6 Stable tag: 1.0.4
     6Stable tag: 1.0.5
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
  • woo-tracking-the-courier-guy/trunk/woo-tracking-the-courier-guy.php

    r1718204 r1719324  
    22
    33/**
    4 * Plugin Name: Woo Tracking for The Courier Guy
    5 * Description: This is a simple plugin to display tracking information for The Courier Guy on your WooCommerce orders page.
    6 * Author: Mustache
    7 * Author URI: http://www.mustache.co.za
    8 * Version: 1.0.4
    9 */
     4 * Plugin Name: Woo Tracking for The Courier Guy
     5 * Description: This is a simple plugin to display tracking information for The Courier Guy on your WooCommerce orders page.
     6 * Author: Mustache
     7 * Author URI: http://www.mustache.co.za
     8 * Version: 1.0.5
     9 */
    1010
    1111// Add meta box
     
    154154    ?>
    155155    <?php if (!empty($tracking_box)) : ?>
    156     <div class="woo-tracking-the-courier-guy">
    157         <h3>Shipping Details</h3>
    158         <table class="table table-sm" width="100%">
    159             <thead>
     156        <div class="woo-tracking-the-courier-guy">
     157            <h3>Shipping Details</h3>
     158            <table class="table table-sm" width="100%">
     159                <thead>
    160160                <tr>
    161161                    <th align="left" width="30%">Waybill Number</th>
     
    163163                    <th align="left" width="40%">Customer Name</th>
    164164                </tr>
    165             </thead>
    166             <tbody>
     165                </thead>
     166                <tbody>
    167167                <tr>
    168168                    <td align="left"><?php echo $ex->result['waybill']->waybill; ?></td>
     
    170170                    <td align="left"><?php echo $ex->result['waybill']->destpers; ?></td>
    171171                </tr>
    172             </tbody>
    173         </table>
    174         <h3>Tracking Events</h3>
    175         <table class="table table-sm table-striped" width="100%">
    176             <thead>
     172                </tbody>
     173            </table>
     174            <h3>Tracking Events</h3>
     175            <table class="table table-sm table-striped" width="100%">
     176                <thead>
    177177                <tr>
    178178                    <th align="left" width="30%">Date</th>
     
    180180                    <th align="left" width="40%">Details</th>
    181181                </tr>
    182             </thead>
    183             <tbody>
     182                </thead>
     183                <tbody>
    184184                <?php foreach ($ex->result['events'] as $event) { ?>
    185                 <tr>
    186                     <td align="left"><?php echo $event->eventdate; ?></td>
    187                     <td align="left"><?php echo $event->eventtime; ?></td>
    188                     <td align="left"><?php echo $event->scanrule; ?></td>
    189                 </tr>
     185                    <tr>
     186                        <td align="left"><?php echo $event->eventdate; ?></td>
     187                        <td align="left"><?php echo $event->eventtime; ?></td>
     188                        <td align="left"><?php echo $event->scanrule; ?></td>
     189                    </tr>
    190190                <?php } ?>
    191             </tbody>
    192         </table>
    193     </div>
     191                </tbody>
     192            </table>
     193        </div>
    194194    <?php endif; ?>
    195195<?php }
     
    222222//add_action( 'woocommerce_my_account_my_orders_actions', 'tcg_display_tracking_button', 50, 2 );
    223223// Tracking button in admin order list page
     224add_filter('woocommerce_admin_order_actions', 'add_track_order_actions_button', 100, 2);
    224225function add_track_order_actions_button( $actions, $order )
    225226{
    226227    $tracking_box = get_post_meta( $order->get_id(), '_tracking_box', true );
    227     if (!empty($tracking_box)) :
     228    if (empty($tracking_box) === false) {
    228229        $actions['track_button'] = array(
    229             'url'   => 'https://www.thecourierguy.co.za/tracking_results.php?WaybillNumber=' . $tracking_box,
    230             'name'  => __( 'Track', 'woocommerce' ),
    231             'action' => "view tracking"
     230            'url' => 'https://www.thecourierguy.co.za/tracking_results.php?WaybillNumber=' . $tracking_box,
     231            'name' => __('Track', 'woocommerce'),
     232            'action' => 'view tracking'
    232233        );
     234    }
    233235    return $actions;
    234     endif;
    235 }
    236 add_filter( 'woocommerce_admin_order_actions', 'add_track_order_actions_button', PHP_INT_MAX, 2 );
     236}
    237237//Add CSS
    238238function add_tracking_order_actions_button_css() {
Note: See TracChangeset for help on using the changeset viewer.