MS_Addon_Prorate

Add-on: Enable the Pro-Rating function.

Defined (1)

The class is defined in the following location(s).

/app/addon/prorate/class-ms-addon-prorate.php  
  1. class MS_Addon_Prorate extends MS_Addon { 
  2.  
  3. /** 
  4. * The Add-on ID 
  5. * @since 1.0.1.0 
  6. */ 
  7. const ID = 'addon_prorate'; 
  8.  
  9. /** 
  10. * Checks if the current Add-on is enabled. 
  11. * @since 1.0.1.0 
  12. * @return bool 
  13. */ 
  14. static public function is_active() { 
  15. return false; 
  16.  
  17. /** 
  18. * Returns the Add-on ID (self::ID). 
  19. * @since 1.0.1.0 
  20. * @return string 
  21. */ 
  22. public function get_id() { 
  23. return self::ID; 
  24.  
  25. /** 
  26. * Initializes the Add-on. Always executed. 
  27. * @since 1.0.1.0 
  28. */ 
  29. public function init() { 
  30. MS_Model_Addon::disable( self::ID ); 
  31.  
  32. /** 
  33. * Registers the Add-On. 
  34. * @since 1.0.1.0 
  35. * @param array $list The Add-Ons list. 
  36. * @return array The updated Add-Ons list. 
  37. */ 
  38. public function register( $list ) { 
  39. $list[ self::ID ] = (object) array( 
  40. 'name' => __( 'Pro-Rating', 'membership2' ),  
  41. 'description' => __( 'Pro-Rate previous payments when switching memberships.', 'membership2' ),  
  42. 'icon' => 'wpmui-fa wpmui-fa-money',  
  43. 'details' => array( 
  44. array( 
  45. 'type' => MS_Helper_Html::TYPE_HTML_TEXT,  
  46. 'value' => __( 'Pro-Rating is applied when a user upgrades/downgrades a membership. Not when he cancels and subscribes in two steps.<br><br>Reason:<br>When a user cancels a membership he keeps access to the membership until the current period expires (exception: permanent access expires instantly)', 'membership2' ),  
  47. ),  
  48. array( 
  49. 'type' => MS_Helper_Html::TYPE_HTML_TEXT,  
  50. 'title' => '<b>' . __( 'When Multiple Memberships Add-on is disabled', 'membership2' ) . '</b>',  
  51. 'value' => __( 'Changing a membership always expires the old memberships and adds a subscription for the the new membership <em>in one step</em>. Pro Rating is always applied here.', 'membership2' ),  
  52. ),  
  53. array( 
  54. 'type' => MS_Helper_Html::TYPE_HTML_TEXT,  
  55. 'title' => '<b>' . __( 'When Multiple Memberships Add-on is enabled', 'membership2' ) . '</b>',  
  56. 'value' => __( 'Only when you manually set the "Cancel and Pro-Rate" setting in the Upgrade Paths settings of the membership then the change is recognized as upgrade/downgrade. In this case the old membership is deactivated when the new subscription is created.<br>If you do not set this option the default logic applies: The user can access the old membership for the duration he paid, even when he cancels earlier. So no Pro-Rating then.', 'membership2' ),  
  57. ),  
  58. ),  
  59. 'action' => array( __( 'Pro Version', 'membership2' ) ),  
  60. ); 
  61. return $list; 
  62.