Exemplo n.º 1
0
 /**
  * Points and Rewards single product message for per-product priced Bundles.
  *
  * @param  string                    $message
  * @param  WC_Points_Rewards_Product $points_n_rewards
  * @return string
  */
 function points_rewards_bundle_message($message, $points_n_rewards)
 {
     global $product;
     if ($product->product_type == 'bundle') {
         if (!$product->is_priced_per_product()) {
             return $message;
         }
         // Will calculate points based on min_bundle_price
         $bundle_points = WC_Points_Rewards_Product::get_points_earned_for_product_purchase($product);
         $message = $points_n_rewards->create_at_least_message_to_product_summary($bundle_points);
     }
     return $message;
 }
 /**
  * Points and Rewards single product message for per-product priced Bundles.
  * @param  string                    $message
  * @param  WC_Points_Rewards_Product $points_n_rewards
  * @return string
  */
 public static function points_rewards_composite_message($message, $points_n_rewards)
 {
     global $product;
     if ($product->product_type == 'composite') {
         if (!$product->is_priced_per_product()) {
             return $message;
         }
         // Will calculate points based on min_composite_price, which is saved as _price meta
         $composite_points = WC_Points_Rewards_Product::get_points_earned_for_product_purchase($product);
         $message = $points_n_rewards->create_at_least_message_to_product_summary($composite_points);
     }
     return $message;
 }