本文整理汇总了PHP中WC_Subscriptions_Order::get_formatted_order_total方法的典型用法代码示例。如果您正苦于以下问题:PHP WC_Subscriptions_Order::get_formatted_order_total方法的具体用法?PHP WC_Subscriptions_Order::get_formatted_order_total怎么用?PHP WC_Subscriptions_Order::get_formatted_order_total使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WC_Subscriptions_Order
的用法示例。
在下文中一共展示了WC_Subscriptions_Order::get_formatted_order_total方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_content_plain
/**
* get_content_plain function.
*
* @access public
* @return string
*/
function get_content_plain()
{
$order = new WC_Order($this->object['order_id']);
$item_name = WC_Subscriptions_Order::get_item_name($this->object['order_id'], $this->object['product_id']);
$order_item = WC_Subscriptions_Order::get_item_by_product_id($order, $this->object['product_id']);
$product = $order->get_product_from_item($order_item);
if (isset($product->variation_data)) {
$item_name .= ' (' . woocommerce_get_formatted_variation($product->variation_data, true) . ')';
}
WC_Subscriptions_Order::$recurring_only_price_strings = true;
$recurring_total = WC_Subscriptions_Order::get_formatted_order_total(0, $order);
WC_Subscriptions_Order::$recurring_only_price_strings = false;
if ($end_of_prepaid_term = wp_next_scheduled('scheduled_subscription_end_of_prepaid_term', array('user_id' => (int) $order->user_id, 'subscription_key' => $this->subscription_key))) {
$end_of_prepaid_term = date_i18n(woocommerce_date_format(), $end_of_prepaid_term + get_option('gmt_offset') * 3600);
}
ob_start();
woocommerce_get_template($this->template_plain, array('subscription_key' => $this->subscription_key, 'subscription' => $this->object, 'order' => $order, 'email_heading' => $this->get_heading(), 'item_name' => $item_name, 'recurring_total' => $recurring_total, 'last_payment' => date_i18n(woocommerce_date_format(), WC_Subscriptions_Manager::get_last_payment_date($this->subscription_key, '', 'timestamp')), 'end_of_prepaid_term' => $end_of_prepaid_term), '', $this->template_base);
return ob_get_clean();
}