TFPtMaster Posted January 8, 2015 Share Posted January 8, 2015 Hello guys I was trying to make some changes to my contact page. I want to make the client be obligated to put is Order ID when he choses Returns in the subjet theme. I mean i want to make the field Order ID/Number to be required when the client choose "Retour Product". I would like to know if any good soul here can help me. Cheers Luis Link to comment Share on other sites More sharing options...
fred-vinapresta Posted January 8, 2015 Share Posted January 8, 2015 Hi, have a look in the controllers/front/ContactController.php file, that's where information are checked before being sent. You ll need to override this file to add the condition you want Link to comment Share on other sites More sharing options...
TFPtMaster Posted January 8, 2015 Author Share Posted January 8, 2015 Hi, have a look in the controllers/front/ContactController.php file, that's where information are checked before being sent. You ll need to override this file to add the condition you want Hi Those were my toughts... However i really need help to change the code. The theme i can handle but controllers are a thing i can't really handle. Ty Link to comment Share on other sites More sharing options...
TFPtMaster Posted January 12, 2015 Author Share Posted January 12, 2015 Hi Those were my toughts... However i really need help to change the code. The theme i can handle but controllers are a thing i can't really handle. Ty Anyone? Link to comment Share on other sites More sharing options...
vekia Posted January 13, 2015 Share Posted January 13, 2015 controllers/front/contactController.php add this code if (Tools::getValue('id_contact')==2){ if (Tools::getValue('id_order')==0){ $this->errors[] = Tools::displayError('Enter ID of order'); return; } } right before: if (empty($contact->email)) Mail::Send($this->context->language->id, 'contact_form', ((isset($ct) && Validate::isLoadedObject($ct)) ? sprintf(Mail::l('Your message has been correctly sent #ct%1$s #tc%2$s'), $ct->id, $ct->token) : Mail::l('Your message has been correctly sent')), $var_list, $from, null, null, null, $fileAttachment); remember to change 2 in: Tools::getValue('id_contact')==2 to id that is equal to "returns" effect Link to comment Share on other sites More sharing options...
TFPtMaster Posted January 16, 2015 Author Share Posted January 16, 2015 controllers/front/contactController.php add this code if (Tools::getValue('id_contact')==2){ if (Tools::getValue('id_order')==0){ $this->errors[] = Tools::displayError('Enter ID of order'); return; } } right before: if (empty($contact->email)) Mail::Send($this->context->language->id, 'contact_form', ((isset($ct) && Validate::isLoadedObject($ct)) ? sprintf(Mail::l('Your message has been correctly sent #ct%1$s #tc%2$s'), $ct->id, $ct->token) : Mail::l('Your message has been correctly sent')), $var_list, $from, null, null, null, $fileAttachment); remember to change 2 in: Tools::getValue('id_contact')==2 to id that is equal to "returns" effect Vekia... your are the men. Thankssssss Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now