addElement('hidden', 'productId'); $this->addElement( 'numeric', 'quantity', array('label' => 'Quantity:', 'required' => true, 'precision' => 0) ); $this->getElement('quantity')->addValidator('Int'); $greaterThan = new Zend_Validate_GreaterThan(0); $greaterThan->setMessage( 'Quantity must be greater than zero', Zend_Validate_GreaterThan::NOT_GREATER ); $this->getElement('quantity')->addValidator($greaterThan, false); return $this; } protected function _initButtons() { $this->addElement( 'submit', 'btnSubmit', array( 'label' => 'Add To Cart', 'attribs' => array('class' => 'btn btn-primary') ) ); return $this; } }