I had created a new menu using catalog->Manage Categories->Add subcategory->quick service. In CMS->Static Blocks I have created the form but it is not working properly.The PHP code is not working.Please can anyone help me in creating the form in static blocks and send the mail.

My form

   <form action="" id="quickservice" method="post">
   <li class="fields">
            <div class="field">
                <label for="Servicetype" class="required"> <em>*</em><?php echo $this->__('Service Type') ?></label>
                        <div class="input-box">
                            <select name="servicetype" class="input-text required-entry validate-select" style="width: 150px;" />
                                    <option value=""><?php echo $this->__('--Please Select--')?></option>
                                    <option value="Lab"><?php echo $this->__('Lab')?></option>
                                    <option value="Hospital"><?php echo $this->__('Hospital')?></option>
                                    <option value="Food"><?php echo $this->__('Food')?></option>
                                    <option value="Gym"><?php echo $this->__('Gym')?></option>
                                    <option value="Physio"><?php echo $this->__('Physio')?></option>
                                    <option value="Nurse"><?php echo $this->__('Nurse')?></option>
  • 1
    create form as a .phtnl file then call static block ({{block type="core/template" template="page/page.phtml"}}) – Magento 2 Nov 17 '15 at 10:11
  • Assuming this form is in a template(You can't have PHP code in static blocks), you'll need to show the controller code where this form submits. You don't have action attribute in your form, in that case, it will submit to current URL. Mail will be sent via controller on which the form will be submitted. – Prateek Nov 17 '15 at 10:11
  • "The PHP code is not working" Static Blocks will not parse php tag – Minesh Patel Nov 17 '15 at 10:13
  • Yes created the form.phtml and added the form.phtml in this path app/design/frontend/ultimo/default/template/quickservice/form.phtml.But what I need to write in static block content? – Mouni Nov 17 '15 at 10:14
  • call this in your static block {{block type="core/template" template="quickservice/form.phtml"}} – Magento 2 Nov 17 '15 at 10:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.