本文整理汇总了PHP中WC_Subscriptions::is_duplicate_site方法的典型用法代码示例。如果您正苦于以下问题:PHP WC_Subscriptions::is_duplicate_site方法的具体用法?PHP WC_Subscriptions::is_duplicate_site怎么用?PHP WC_Subscriptions::is_duplicate_site使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WC_Subscriptions
的用法示例。
在下文中一共展示了WC_Subscriptions::is_duplicate_site方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: hook_transactional_emails
/**
* Hooks up all of Skip One transaction emails after the WooCommerce object is constructed.
*
* @since 1.0.0
* @access public
* @static
*/
public static function hook_transactional_emails()
{
// Don't send subscription
if (WC_Subscriptions::is_duplicate_site() && !defined('WCS_FORCE_EMAIL')) {
return;
}
$skip_emails = array('next_payment_date');
foreach ($skip_emails as $email) {
add_action('woocommerce_skip_one_' . $email, __CLASS__ . '::send_' . $email . '_email', 10, 2);
}
}
示例2: hook_transactional_emails
/**
* Hooks up all of Subscription's transaction emails after the WooCommerce object is constructed.
*
* @since 1.4
*/
public static function hook_transactional_emails()
{
// Don't send subscription
if (WC_Subscriptions::is_duplicate_site() && !defined('WCS_FORCE_EMAIL')) {
return;
}
add_action('woocommerce_subscription_status_updated', __CLASS__ . '::send_cancelled_email', 10, 2);
$order_email_actions = array('woocommerce_order_status_pending_to_processing', 'woocommerce_order_status_pending_to_completed', 'woocommerce_order_status_pending_to_on-hold', 'woocommerce_order_status_failed_to_processing_notification', 'woocommerce_order_status_failed_to_completed_notification', 'woocommerce_order_status_failed_to_on-hold_notification', 'woocommerce_order_status_completed', 'woocommerce_generated_manual_renewal_order', 'woocommerce_order_status_failed');
foreach ($order_email_actions as $action) {
add_action($action, __CLASS__ . '::maybe_remove_woocommerce_email', 9);
add_action($action, __CLASS__ . '::send_renewal_order_email', 10);
add_action($action, __CLASS__ . '::send_switch_order_email', 10);
add_action($action, __CLASS__ . '::maybe_reattach_woocommerce_email', 11);
}
}
示例3: add_system_status_items
/**
* Adds Subscriptions specific details to the WooCommerce System Status report.
*
* @param array $attributes Shortcode attributes.
* @return array
*/
public static function add_system_status_items($debug_data)
{
$is_wcs_debug = defined('WCS_DEBUG') ? WCS_DEBUG : false;
$debug_data['wcs_debug'] = array('name' => _x('WCS_DEBUG', 'label that indicates whether debugging is turned on for the plugin', 'woocommerce-subscriptions'), 'note' => $is_wcs_debug ? __('Yes', 'woocommerce-subscriptions') : __('No', 'woocommerce-subscriptions'), 'success' => $is_wcs_debug ? 0 : 1);
$debug_data['wcs_staging'] = array('name' => _x('Subscriptions Mode', 'Live or Staging, Label on WooCommerce -> System Status page', 'woocommerce-subscriptions'), 'note' => '<strong>' . (WC_Subscriptions::is_duplicate_site() ? _x('Staging', 'refers to staging site', 'woocommerce-subscriptions') : _x('Live', 'refers to live site', 'woocommerce-subscriptions')) . '</strong>', 'success' => WC_Subscriptions::is_duplicate_site() ? 0 : 1);
return $debug_data;
}
示例4: requires_manual_renewal
/**
* Checks if a subscription requires manual payment because the payment gateway used to purchase the subscription
* did not support automatic payments at the time of the subscription sign up. Or because we're on a staging site.
*
* @param mixed $order A WC_Order object or the ID of the order which the subscription was purchased in.
* @return bool True if the subscription exists and requires manual payments, false if the subscription uses automatic payments (defaults to false for backward compatibility).
* @since 1.2
*/
public static function requires_manual_renewal($order)
{
if ('true' == self::get_meta($order, '_wcs_requires_manual_renewal', 'false') || WC_Subscriptions::is_duplicate_site()) {
$requires_manual_renewal = true;
} else {
$requires_manual_renewal = false;
}
return $requires_manual_renewal;
}
示例5: is_manual
/**
* Checks if the subscription requires manual renewal payments.
*
* @access public
* @return bool
*/
public function is_manual()
{
if (WC_Subscriptions::is_duplicate_site() || empty($this->payment_gateway) || isset($this->requires_manual_renewal) && 'true' == $this->requires_manual_renewal) {
$is_manual = true;
} else {
$is_manual = false;
}
return $is_manual;
}
示例6: add_system_status_items
/**
* Adds Subscriptions specific details to the WooCommerce System Status report.
*
* @param array $attributes Shortcode attributes.
* @return array
*/
public static function add_system_status_items($debug_data)
{
$is_wcs_debug = defined('WCS_DEBUG') ? WCS_DEBUG : false;
$debug_data['wcs_debug'] = array('name' => __('WCS_DEBUG', 'woocommerce-subscriptions'), 'note' => $is_wcs_debug ? __('Yes', 'woocommerce-subscriptions') : __('No', 'woocommerce-subscriptions'), 'success' => $is_wcs_debug ? 0 : 1);
$debug_data['wcs_staging'] = array('name' => __('Subscriptions Mode', 'woocommerce-subscriptions'), 'note' => WC_Subscriptions::is_duplicate_site() ? __('<strong>Staging</strong>', 'woocommerce-subscriptions') : __('<strong>Live</strong>', 'woocommerce-subscriptions'), 'success' => WC_Subscriptions::is_duplicate_site() ? 0 : 1);
return $debug_data;
}