浏览代码

convert strings

andre 3 年之前
父节点
当前提交
b38621cf4c
共有 1 个文件被更改,包括 12 次插入3 次删除
  1. 12 3
      check_billing_cycle.php

+ 12 - 3
check_billing_cycle.php

@@ -1,7 +1,16 @@
 <?php
 
 /**
-* push current product billing cycle to upgrade form 
+* push current product billing cycle to upgrade form
+* converts the string into a format which matches {$upgradepackage.pricing.type}
+* "Free Account" => free
+* "One Time" => onetime
+* "Monthly" => monthly
+* "Quarterly" => quarterly
+* "Semi-Annually" => semiannually
+* "Annually" => annually
+* "Biennially" => biennially
+* "Triennially" => triennially
 * @author Thurdata
 */
 
@@ -15,8 +24,8 @@ function current_billingcycle_hook($vars)
        $billingcycle = Capsule::table('tblhosting')
                ->where('id',$id)
                ->value('billingcycle');
-       return array("curbillingcycle" => $billingcycle);
-   }
+        return array("curbillingcycle" => strtolower(str_replace('Account','',str_replace(' ','',str_replace('-','',$billingcycle)))));
+    }
 }
 add_hook("ClientAreaPageUpgrade", 1, "current_billingcycle_hook");