當前位置: 首頁>>代碼示例>>PHP>>正文


PHP WC_Subscriptions_Product::get_price_html方法代碼示例

本文整理匯總了PHP中WC_Subscriptions_Product::get_price_html方法的典型用法代碼示例。如果您正苦於以下問題:PHP WC_Subscriptions_Product::get_price_html方法的具體用法?PHP WC_Subscriptions_Product::get_price_html怎麽用?PHP WC_Subscriptions_Product::get_price_html使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在WC_Subscriptions_Product的用法示例。


在下文中一共展示了WC_Subscriptions_Product::get_price_html方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: get_price_html

 /**
  * Returns the price in html format.
  *
  * @access public
  * @param string $price (default: '')
  * @return string
  */
 public function get_price_html($price = '')
 {
     $price = parent::get_price_html($price);
     if (!isset($this->subscription_period) || !isset($this->subscription_period_interval) || !isset($this->max_variation_period) || !isset($this->max_variation_period_interval)) {
         $this->variable_product_sync();
     }
     // Only create the subscription price string when a price has been set
     if ($this->subscription_price !== '' || $this->subscription_sign_up_fee !== '') {
         $price = '';
         if ($this->is_on_sale() && isset($this->min_variation_price) && $this->min_variation_regular_price !== $this->get_price()) {
             if (!$this->min_variation_price || $this->min_variation_price !== $this->max_variation_price) {
                 $price .= $this->get_price_html_from_text();
             }
             $price .= $this->get_price_html_from_to($this->get_variation_price('min', true), $this->get_variation_price('max', true));
         } else {
             if ($this->min_variation_price !== $this->max_variation_price) {
                 $price .= $this->get_price_html_from_text();
             }
             $price .= wc_price($this->get_variation_price('min', true));
         }
         // Make sure the price contains "From:" when billing schedule differs between variations
         if (false === strpos($price, $this->get_price_html_from_text())) {
             if ($this->subscription_period !== $this->max_variation_period) {
                 $price = $this->get_price_html_from_text() . $price;
             } elseif ($this->subscription_period_interval !== $this->max_variation_period_interval) {
                 $price = $this->get_price_html_from_text() . $price;
             }
         }
         $price .= $this->get_price_suffix();
         $price = WC_Subscriptions_Product::get_price_html($price, $this);
     }
     return apply_filters('woocommerce_variable_subscription_price_html', $price, $this);
 }
開發者ID:keshvenderg,項目名稱:cloudshop,代碼行數:40,代碼來源:class-wc-product-variable-subscription.php

示例2: get_price_html

 /**
  * Returns the price in html format.
  *
  * @access public
  * @param string $price (default: '')
  * @return string
  */
 public function get_price_html($price = '')
 {
     $price = parent::get_price_html($price);
     if (!isset($this->subscription_period) || !isset($this->subscription_period_interval) || !isset($this->max_variation_period) || !isset($this->max_variation_period_interval)) {
         $this->variable_product_sync();
     }
     // Only create the subscription price string when a price has been set
     if (($this->subscription_price > 0 || $this->subscription_sign_up_fee > 0) && ($this->subscription_price !== '' || $this->subscription_sign_up_fee !== '')) {
         // Make sure the price contains "From:" when billing schedule differs between variations
         if (false === strpos($price, $this->get_price_html_from_text())) {
             if ($this->subscription_period !== $this->max_variation_period) {
                 $price = $this->get_price_html_from_text() . $price;
             } elseif ($this->subscription_period_interval !== $this->max_variation_period_interval) {
                 $price = $this->get_price_html_from_text() . $price;
             }
         }
         $price = WC_Subscriptions_Product::get_price_html($price, $this);
     }
     return apply_filters('woocommerce_variable_subscription_price_html', $price, $this);
 }
開發者ID:bulats,項目名稱:chef,代碼行數:27,代碼來源:class-wc-product-variable-subscription.php


注:本文中的WC_Subscriptions_Product::get_price_html方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。