public static function getForm() { $form = new Form('shipping_form', 'shipping_form', '/store/payment'); $types = self::getAllShippings(); if (isset($_SESSION['cart_checkout']['shipping'])) { $defaultValues['ship_type'] = $_SESSION['cart_checkout']['shipping']->getClass(); $form->setDefaults($defaultValues); } foreach ($types as $type) { $form->addElement('radio', 'ship_type', null, $type->getName(), $type->getClass()); } $form->updateElementAttr('ship_type', array('onchange' => 'return !updateShipping(this);')); return $form; }