Start of form customization for billing

This commit is contained in:
Albert Santoni 2014-06-24 15:52:43 -04:00
parent 5d69ba5f91
commit 8c20592423
5 changed files with 144 additions and 54 deletions

View file

@ -4,7 +4,7 @@ require_once 'Zend/Locale.php';
class Application_Form_BillingClient extends Zend_Form
{
public function init()
{
{
/*$this->setDecorators(array(
array('ViewScript', array('viewScript' => 'form/billing-purchase.phtml'))));*/
$client = BillingController::getClientDetails();

View file

@ -6,7 +6,7 @@ class Application_Form_BillingUpgradeDowngrade extends Zend_Form
$productPrices = array();
$productTypes = array();
$products = BillingController::getProducts();
foreach ($products as $k => $p) {
$productPrices[$p["name"]] = array(
"monthly" => $p["pricing"]["USD"]["monthly"],
@ -18,23 +18,26 @@ class Application_Form_BillingUpgradeDowngrade extends Zend_Form
//$currentPlanType = ucfirst(Application_Model_Preference::GetPlanLevel());
$currentPlanType = "Hobbyist";
if (($key = array_search($currentPlanType, $productTypes)) !== false) {
unset($productTypes[$key]);
//unset($productTypes[$key]);
}
$pid = new Zend_Form_Element_Radio('newproductid');
$pid->setLabel(_('Plan type:'))
->setMultiOptions($productTypes)
->setRequired(true)
->setValue(26);
$this->addElement($pid);
$this->addElement($pid);
$billingcycle = new Zend_Form_Element_Radio('newproductbillingcycle');
$billingcycle->setLabel(_('Billing cycle:'))
->setMultiOptions(array('monthly' => 'monthly', 'annually' => 'annually'))
->setRequired(true)
->setValue('monthly');
$this->addElement($billingcycle);
$paymentmethod = new Zend_Form_Element_Radio('paymentmethod');
$paymentmethod->setLabel(_('Payment method:'))
->setRequired(true)
->setMultiOptions(array(
'paypal' => _('PayPal'),
'tco' => _('Credit Card via 2Checkout')))