1

I noticed in my e-shop that there were a couple of mysterious customers that were signing up and I decided to stop it. The way I chose to do it was to create an extra field in the sign up page in

app/design/frontend/xlcloset/deafault/template/officience/customerattributeform/register.phtml

Its style would be style="display:none" so that it would be not visible. This form sends tits data with the $this->getPostActionUrl(). So the concept would be to check if the field is filled and if yes, stop the execution of the program (like die(); ). I found the getFormData() function which is:

  public function getFormData()
{    

    $data = $this->getData('form_data');
    $china = $data['firstname'];      

    if (is_null($data)) {          
        $formData = Mage::getSingleton('customer/session')->getCustomerFormData(true);             
        $data = new Varien_Object();          
        if ($formData) {                                
            $data->addData($formData);
            $data->setCustomerData(1); 
        }
        if (isset($data['region_id'])) {
            $data['region_id'] = (int)$data['region_id'];                  
        }            
        $variable = $this->setData('form_data', $data);           

    }    

    return $data;
}

What I am trying to figure out is how to perform the check in this method in order to check if the hidden field is filled. Thank you for the help in advance!!!

1 Answer 1

0

OK, for this approach, I was looking in the wrong file. The right one was in the AccountController.php file and the createPostAction() in which I had to perform the test like:

if (!empty($_POST['name'])){
         $this->_redirect('*/*/');    
         return;
    }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.