当前位置: 首页>>代码示例>>PHP>>正文


PHP WC_Product_Variable::__construct方法代码示例

本文整理汇总了PHP中WC_Product_Variable::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP WC_Product_Variable::__construct方法的具体用法?PHP WC_Product_Variable::__construct怎么用?PHP WC_Product_Variable::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WC_Product_Variable的用法示例。


在下文中一共展示了WC_Product_Variable::__construct方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 /**
  * Create a simple subscription product object.
  *
  * @access public
  * @param mixed $product
  */
 public function __construct($product)
 {
     parent::__construct($product);
     $this->product_type = 'variable-subscription';
     // Load all meta fields
     $this->product_custom_fields = get_post_meta($this->id);
     // Convert selected subscription meta fields for easy access
     if (!empty($this->product_custom_fields['_subscription_price'][0])) {
         $this->subscription_price = $this->product_custom_fields['_subscription_price'][0];
     }
     if (!empty($this->product_custom_fields['_subscription_sign_up_fee'][0])) {
         $this->subscription_sign_up_fee = $this->product_custom_fields['_subscription_sign_up_fee'][0];
     }
     if (!empty($this->product_custom_fields['_subscription_period'][0])) {
         $this->subscription_period = $this->product_custom_fields['_subscription_period'][0];
     }
     if (!empty($this->product_custom_fields['_subscription_period_interval'][0])) {
         $this->subscription_period_interval = $this->product_custom_fields['_subscription_period_interval'][0];
     }
     if (!empty($this->product_custom_fields['_subscription_length'][0])) {
         $this->subscription_length = $this->product_custom_fields['_subscription_length'][0];
     }
     if (!empty($this->product_custom_fields['_subscription_trial_length'][0])) {
         $this->subscription_trial_length = $this->product_custom_fields['_subscription_trial_length'][0];
     }
     if (!empty($this->product_custom_fields['_subscription_trial_period'][0])) {
         $this->subscription_trial_period = $this->product_custom_fields['_subscription_trial_period'][0];
     }
     $this->limit_subscriptions = !isset($this->product_custom_fields['_subscription_limit'][0]) ? 'no' : $this->product_custom_fields['_subscription_limit'][0];
     add_filter('woocommerce_add_to_cart_handler', array(&$this, 'add_to_cart_handler'), 10, 2);
 }
开发者ID:bulats,项目名称:chef,代码行数:37,代码来源:class-wc-product-variable-subscription.php

示例2: __construct

 /**
  * Create a variable registration product object.
  *
  * @access public
  * @param mixed $product
  */
 public function __construct($product)
 {
     parent::__construct($product);
     $this->parent_product_type = $this->product_type;
     $this->product_type = 'registrations';
     add_filter('woocommerce_add_to_cart_handler', array(&$this, 'add_to_cart_handler'), 10, 2);
 }
开发者ID:HasteDesign,项目名称:Registrations-for-WooCommerce,代码行数:13,代码来源:class-wc-product-registrations.php

示例3: __construct

 /**
  * Construct.
  *
  * @access public
  * @param mixed $product
  */
 public function __construct($product)
 {
     parent::__construct($product);
     $this->product_type = 'tour';
     $this->virtual = 'yes';
     $this->downloadable = 'no';
 }
开发者ID:j-kenneth,项目名称:Expeero,代码行数:13,代码来源:WC_Product_Tour_Variable.php

示例4: __construct

 /**
  * Create a simple subscription product object.
  *
  * @access public
  * @param mixed $product
  */
 public function __construct($product)
 {
     parent::__construct($product);
     $this->parent_product_type = $this->product_type;
     $this->product_type = 'variable-subscription';
     // Load all meta fields
     $this->product_custom_fields = get_post_meta($this->id);
     // Convert selected subscription meta fields for easy access
     if (!empty($this->product_custom_fields['_subscription_price'][0])) {
         $this->subscription_price = $this->product_custom_fields['_subscription_price'][0];
     }
     if (!empty($this->product_custom_fields['_subscription_sign_up_fee'][0])) {
         $this->subscription_sign_up_fee = $this->product_custom_fields['_subscription_sign_up_fee'][0];
     }
     if (!empty($this->product_custom_fields['_subscription_period'][0])) {
         $this->subscription_period = $this->product_custom_fields['_subscription_period'][0];
     }
     if (!empty($this->product_custom_fields['_subscription_period_interval'][0])) {
         $this->subscription_period_interval = $this->product_custom_fields['_subscription_period_interval'][0];
     }
     if (!empty($this->product_custom_fields['_subscription_length'][0])) {
         $this->subscription_length = $this->product_custom_fields['_subscription_length'][0];
     }
     if (!empty($this->product_custom_fields['_subscription_trial_length'][0])) {
         $this->subscription_trial_length = $this->product_custom_fields['_subscription_trial_length'][0];
     }
     if (!empty($this->product_custom_fields['_subscription_trial_period'][0])) {
         $this->subscription_trial_period = $this->product_custom_fields['_subscription_trial_period'][0];
     }
     $this->subscription_payment_sync_date = 0;
     $this->subscription_one_time_shipping = !isset($this->product_custom_fields['_subscription_one_time_shipping'][0]) ? 'no' : $this->product_custom_fields['_subscription_one_time_shipping'][0];
     if (!isset($this->product_custom_fields['_subscription_limit'][0])) {
         $this->limit_subscriptions = 'no';
     } elseif ('yes' == $this->product_custom_fields['_subscription_limit'][0]) {
         // backward compatibility
         $this->limit_subscriptions = 'any';
     } else {
         $this->limit_subscriptions = $this->product_custom_fields['_subscription_limit'][0];
     }
     add_filter('woocommerce_add_to_cart_handler', array(&$this, 'add_to_cart_handler'), 10, 2);
 }
开发者ID:DustinHartzler,项目名称:TheCLEFT,代码行数:47,代码来源:class-wc-product-variable-subscription.php


注:本文中的WC_Product_Variable::__construct方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。