Plugin Directory

Changeset 1640694


Ignore:
Timestamp:
04/19/2017 02:51:38 PM (9 years ago)
Author:
Webby Scots
Message:

Fixes and now filters in-cart statuses from results

Location:
woo-vendors-bookings-dashboard/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • woo-vendors-bookings-dashboard/trunk/readme.txt

    r1640105 r1640694  
    3838
    3939= 2.1.0 =
    40 * Fix missing entries in the dashboard
     40* Fix missing entries in the dashboard - works with more setups
     41
     42= 2.2.0 =
     43* Filters out in-cart statuses from results
  • woo-vendors-bookings-dashboard/trunk/woo-wendors-bookings-dashboard.php

    r1640116 r1640694  
    33 * Plugin Name: Woo Vendors Bookings Management
    44 * Description: Allows vendors to manage their bookings in the frontend
    5  * Version: 2.1.0
     5 * Version: 2.2.0
    66 * Author: Liam Bailey
    77 * Author URI: http://webbyscots.com/
     
    141141                $bookings = array_filter( $bookings, array( $this, 'filter_booking_products' ) );
    142142            }
     143
    143144            set_transient( 'wcpv_reports_bookings_wg_' . $this->active_vendor, $bookings, DAY_IN_SECONDS );
    144145        }
     
    160161            foreach ($actions as $action) {
    161162                $action_url = add_query_arg(array('wvbd_action' => $action, 'booking_id' => $booking->ID, 'security' => wp_create_nonce('vendor-booking-confirm-noncerator')), site_url() . "/vendors-dashboard/" . get_query_var('vendors-dashboard') . "/");
    162                 $action_strings[] = ($action == "cancel") ? "<a href='" . $_booking->get_cancel_url("/vendors-dashboard/{$vendor->slug}/") . "'>Cancel</a>" : "<a href='" . $action_url . "'>" . ucfirst($action) . "</a>";
     163                $action_strings[] = ($action == "cancel") ? "<a href='" . $_booking->get_cancel_url("/vendors-dashboard/{$vendor->slug}") . "'>Cancel</a>" : "<a href='" . $action_url . "'>" . ucfirst($action) . "</a>";
    163164            }
    164165            $data[$booking->ID] = array(
     
    177178        }
    178179        wc_print_notices();
    179         ?><div class="woocommerce-tabs">
    180             <ul class="tabs">
    181         <?php
     180        ?><div class="woocommerce-tabs"><?php
     181        if (count($tabs) > 1) {
     182            ?><ul class="tabs"><?php
     183            foreach ($tabs as $key => $tab) {
     184                $class = ($key == 0) ? "active" : "";
     185                ?><li class="dashboard_tab <?php echo $class; ?>">
     186                        <a href="#tab-<?php echo $tab; ?>"><?php echo ucwords($tab); ?></a>
     187                </li><?php
     188            } ?>
     189            </ul><?php
     190        }
    182191        foreach ($tabs as $key => $tab) {
    183             $class = ($key == 0) ? "active" : "";
    184             ?><li class="dashboard_tab <?php echo $class; ?>">
    185                         <a href="#tab-<?php echo $tab; ?>"><?php echo ucwords($tab); ?></a>
    186                     </li>
    187         <?php } ?>
    188             </ul>
    189                 <?php foreach ($tabs as $key => $tab) {
    190192                    ?><div class="panel entry-content" id="tab-<?php echo $tab; ?>" style="display: block;">
    191193                    <table class="<?php echo $tab; ?>-table">
     
    225227        $booking_item = get_wc_booking( $item->ID );
    226228
    227         if ( is_object( $booking_item ) && is_object( $booking_item->get_product() ) && $booking_item->get_product()->id && in_array( $booking_item->get_product()->id, $product_ids ) ) {
     229        if ( is_object( $booking_item ) && !strstr($booking_item->status, "in-cart") && is_object( $booking_item->get_product() ) && $booking_item->get_product()->id && in_array( $booking_item->get_product()->id, $product_ids ) ) {
    228230            return $item;
    229231        }
Note: See TracChangeset for help on using the changeset viewer.