Exemplo n.º 1
0
    function woo_ce_orders_filter_by_coupon()
    {
        $woo_cd_url = 'http://www.visser.com.au/woocommerce/plugins/exporter-deluxe/';
        $woo_cd_link = sprintf('<a href="%s" target="_blank">' . __('Store Exporter Deluxe', 'woo_ce') . '</a>', $woo_cd_url);
        $args = array('coupon_orderby' => 'ID', 'coupon_order' => 'DESC');
        $coupons = woo_ce_get_coupons($args);
        ob_start();
        ?>
<p><label><input type="checkbox" id="orders-filters-coupon" /> <?php 
        _e('Filter Orders by Coupon Code', 'woo_ce');
        ?>
<span class="description"> - <?php 
        printf(__('available in %s', 'woo_ce'), $woo_cd_link);
        ?>
</span></label></p>
<div id="export-orders-filters-coupon" class="separator">
	<ul>
		<li>
<?php 
        if (!empty($coupons)) {
            ?>
			<select data-placeholder="<?php 
            _e('Choose a Coupon...', 'woo_ce');
            ?>
" name="order_filter_coupon[]" multiple class="chzn-select" style="width:95%;">
	<?php 
            foreach ($coupons as $coupon) {
                ?>
				<option value="<?php 
                echo $coupon;
                ?>
"><?php 
                echo get_the_title($coupon);
                ?>
 (<?php 
                echo woo_ce_get_coupon_code_usage(get_the_title($coupon));
                ?>
)</option>
	<?php 
            }
            ?>
			</select>
<?php 
        } else {
            ?>
			<?php 
            _e('No Coupons were found.', 'woo_ce');
        }
        ?>
		</li>
	</ul>
	<p class="description"><?php 
        _e('Select the Coupon Codes you want to filter exported Orders by. Default is to include all Orders with and without assigned Coupon Codes.', 'woo_ce');
        ?>
</p>
</div>
<!-- #export-orders-filters-coupon -->
<?php 
        ob_end_flush();
    }
Exemplo n.º 2
0
	function woo_ce_orders_filter_by_coupon() {

		$args = array(
			'coupon_orderby' => 'ID',
			'coupon_order' => 'DESC'
		);
		$coupons = woo_ce_get_coupons( $args );

		ob_start(); ?>
<p><label><input type="checkbox" id="orders-filters-coupon" /> <?php _e( 'Filter Orders by Coupon Code', 'woo_ce' ); ?></label></p>
<div id="export-orders-filters-coupon" class="separator">
	<ul>
		<li>
<?php if( !empty( $coupons ) ) { ?>
			<select data-placeholder="<?php _e( 'Choose a Coupon...', 'woo_ce' ); ?>" name="order_filter_coupon[]" multiple class="chzn-select" style="width:95%;">
	<?php foreach( $coupons as $coupon ) { ?>
				<option value="<?php echo $coupon; ?>"<?php disabled( 0, woo_ce_get_coupon_code_usage( get_the_title( $coupon ) ) ); ?>><?php echo get_the_title( $coupon ); ?> (<?php echo woo_ce_get_coupon_code_usage( get_the_title( $coupon ) ); ?>)</option>
	<?php } ?>
			</select>
<?php } else { ?>
			<?php _e( 'No Coupons were found.', 'woo_ce' ); ?>
<?php } ?>
		</li>
	</ul>
	<p class="description"><?php _e( 'Select the Coupon Codes you want to filter exported Orders by. Default is to include all Orders with and without assigned Coupon Codes.', 'woo_ce' ); ?></p>
</div>
<!-- #export-orders-filters-coupon -->
<?php
		ob_end_flush();

	}