/**
     * The text to display before any sign-ups. 
     *
     * @since 1.0
     */
    public function no_items()
    {
        if (isset($_GET['_customer_user']) || !empty($_GET['_customer_user'])) {
            $user = get_user_by('id', intval($_GET['_customer_user']));
        }
        if (isset($_REQUEST['_product_id']) || isset($_REQUEST['_product_id'])) {
            $product = get_product(intval($_GET['_product_id']));
        }
        if (isset($_GET['_customer_user']) || !empty($_GET['_customer_user'])) {
            ?>
		<?php 
            if (isset($_REQUEST['_product_id']) || isset($_REQUEST['_product_id'])) {
                ?>
<p><?php 
                printf(__('%s has not purchased %s%s%s (#%s).', WC_Subscriptions::$text_domain), $user->display_name, '<em>', $product->get_title(), '</em>', intval($_GET['_product_id']));
                ?>
</p>
		<?php 
            } else {
                ?>
<p><?php 
                printf(__('%s has not purchased any subscriptions.', WC_Subscriptions::$text_domain), $user->display_name);
                ?>
</p>
		<?php 
            }
            ?>
		<?php 
        } elseif (isset($_REQUEST['_product_id']) || isset($_REQUEST['_product_id'])) {
            ?>
<p><?php 
            printf(__('No one has purchased %s%s%s (#%s) yet.', WC_Subscriptions::$text_domain), '<em>', $product->get_title(), '</em>', intval($_GET['_product_id']));
            ?>
</p>
		<?php 
        } elseif (isset($_REQUEST['s'])) {
            ?>
<p><?php 
            printf(__('No subscriptions found to have a subscriber name, email, title or order ID matching "%s".', WC_Subscriptions::$text_domain), '<em>' . esc_attr($_REQUEST['s']) . '</em>');
            ?>
</p>
		<?php 
        } else {
            ?>
<p><?php 
            _e('Subscriptions will appear here for you to view and manage once purchased by a customer.', WC_Subscriptions::$text_domain);
            ?>
</p>
<p><?php 
            printf(__('%sLearn more about managing subscriptions%s', WC_Subscriptions::$text_domain), '<a href="http://docs.woothemes.com/document/store-manager-guide/#managingsubscriptions" target="_blank">', ' &raquo;</a>');
            ?>
</p>
<p><?php 
            printf(__('%sAdd a subscription product%s', WC_Subscriptions::$text_domain), '<a href="' . WC_Subscriptions_Admin::add_subscription_url() . '">', ' &raquo;</a>');
            ?>
</p>
		<?php 
        }
    }
예제 #2
0
 /**
  * Method that returns the not found text. If the user has created at least one subscription, the standard message
  * will appear. If that's empty, the long, explanatory one will appear in the table.
  *
  * Filters:
  * - woocommerce_subscriptions_not_empty: gets passed the option value. false or 'yes'. 'yes' means the subscriptions
  * list is not empty, the user is familiar with how it works, and standard message appears.
  * - woocommerce_subscriptions_not_found_label: gets the original message for other plugins to modify, in case
  * they want to add more links, or modify any of the messages.
  * @since  2.0
  *
  * @return string 						what appears in the list table of the subscriptions
  */
 private static function get_not_found_text()
 {
     if (true === apply_filters('woocommerce_subscriptions_not_empty', wcs_do_subscriptions_exist())) {
         $not_found_text = __('No Subscriptions found', 'woocommerce-subscriptions');
     } else {
         $not_found_text = '<p>' . __('Subscriptions will appear here for you to view and manage once purchased by a customer.', 'woocommerce-subscriptions') . '</p>';
         // translators: placeholders are opening and closing link tags
         $not_found_text .= '<p>' . sprintf(__('%sLearn more about managing subscriptions &raquo;%s', 'woocommerce-subscriptions'), '<a href="http://docs.woothemes.com/document/subscriptions/store-manager-guide/#section-3" target="_blank">', '</a>') . '</p>';
         // translators: placeholders are opening and closing link tags
         $not_found_text .= '<p>' . sprintf(__('%sAdd a subscription product &raquo;%s', 'woocommerce-subscriptions'), '<a href="' . esc_url(WC_Subscriptions_Admin::add_subscription_url()) . '">', '</a>') . '</p>';
     }
     return apply_filters('woocommerce_subscriptions_not_found_label', $not_found_text);
 }
    /**
     * The text to display before any sign-ups. 
     *
     * @since 1.0
     */
    public function no_items()
    {
        if (isset($_GET['_customer_user']) && !empty($_GET['_customer_user'])) {
            $user = get_user_by('id', intval($_GET['_customer_user']));
        }
        if (isset($_REQUEST['_product_id']) && !empty($_GET['_product_id'])) {
            $product = get_product(intval($_GET['_product_id']));
        }
        if (isset($_GET['_customer_user']) && !empty($_GET['_customer_user'])) {
            if (isset($_REQUEST['_product_id'])) {
                if (isset($_GET['status']) && 'all' !== $_GET['status']) {
                    ?>
<p><?php 
                    printf(__('%s has no subscription to %s%s%s (#%s) with the status "%s".', WC_Subscriptions::$text_domain), $user->display_name, '<em>', $product->get_title(), '</em>', intval($_GET['_product_id']), $_GET['status']);
                    ?>
</p>
				<?php 
                } else {
                    ?>
<p><?php 
                    printf(__('%s has not purchased %s%s%s (#%s).', WC_Subscriptions::$text_domain), $user->display_name, '<em>', $product->get_title(), '</em>', intval($_GET['_product_id']));
                    ?>
</p>
				<?php 
                }
                ?>
		<?php 
            } else {
                ?>
<p><?php 
                printf(__('%s has not purchased any subscriptions.', WC_Subscriptions::$text_domain), $user->display_name);
                ?>
</p>
		<?php 
            }
            ?>
	<?php 
        } elseif (isset($_REQUEST['_product_id']) && !empty($_GET['_product_id'])) {
            ?>
		<?php 
            if (isset($_GET['status']) && 'all' !== $_GET['status']) {
                ?>
<p><?php 
                printf(__('There are no subscriptions to %s%s%s (#%s) with the status "%s".', WC_Subscriptions::$text_domain), '<em>', $product->get_title(), '</em>', intval($_GET['_product_id']), $_GET['status']);
                ?>
</p>
		<?php 
            } else {
                ?>
<p><?php 
                printf(__('No one has purchased %s%s%s (#%s) yet.', WC_Subscriptions::$text_domain), '<em>', $product->get_title(), '</em>', intval($_GET['_product_id']));
                ?>
</p>
		<?php 
            }
            ?>
	<?php 
        } else {
            ?>
<p><?php 
            _e('Subscriptions will appear here for you to view and manage once purchased by a customer.', WC_Subscriptions::$text_domain);
            ?>
</p>
<p><?php 
            printf(__('%sLearn more about managing subscriptions%s', WC_Subscriptions::$text_domain), '<a href="http://docs.woothemes.com/document/store-manager-guide/#section-3" target="_blank">', ' &raquo;</a>');
            ?>
</p>
<p><?php 
            printf(__('%sAdd a subscription product%s', WC_Subscriptions::$text_domain), '<a href="' . WC_Subscriptions_Admin::add_subscription_url() . '">', ' &raquo;</a>');
            ?>
</p>
		<?php 
        }
    }
 /**
  * The text to display before any sign-ups. 
  *
  * @since 1.0
  */
 public function no_items()
 {
     echo '<p>';
     _e('Subscriptions will appear here for you to view and manage once purchased by a customer.', WC_Subscriptions::$text_domain);
     echo '</p>';
     echo '<p>';
     printf(__('%sMore about managing subscriptions%s', WC_Subscriptions::$text_domain), '<a href="http://wcdocs.woothemes.com/user-guide/extensions/subscriptions/store-manager-guide/#section-3" target="_blank">', ' &raquo;</a>');
     echo '</p>';
     echo '<p>';
     printf(__('%sAdd a subscription product%s', WC_Subscriptions::$text_domain), '<a href="' . WC_Subscriptions_Admin::add_subscription_url() . '">', ' &raquo;</a>');
     echo '</p>';
 }
    /**
     * The text to display before any sign-ups. 
     *
     * @since 1.0
     */
    public function no_items()
    {
        if (isset($_REQUEST['s'])) {
            ?>
<p><?php 
            printf(__('No subscriptions found to have a subscriber name, email, title or order ID matching "%s".', WC_Subscriptions::$text_domain), '<em>' . esc_attr($_REQUEST['s']) . '</em>');
            ?>
</p>
		<?php 
        } else {
            ?>
<p><?php 
            _e('Subscriptions will appear here for you to view and manage once purchased by a customer.', WC_Subscriptions::$text_domain);
            ?>
</p>
<p><?php 
            printf(__('%sMore about managing subscriptions%s', WC_Subscriptions::$text_domain), '<a href="http://wcdocs.woothemes.com/user-guide/extensions/subscriptions/store-manager-guide/#section-4" target="_blank">', ' &raquo;</a>');
            ?>
</p>
<p><?php 
            printf(__('%sAdd a subscription product%s', WC_Subscriptions::$text_domain), '<a href="' . WC_Subscriptions_Admin::add_subscription_url() . '">', ' &raquo;</a>');
            ?>
</p>
		<?php 
        }
    }