Jump to content

Dmcwebd

Members
  • Posts

    35
  • Joined

  • Last visited

Dmcwebd's Achievements

Newbie

Newbie (1/14)

11

Reputation

  1. I'm happy that you guys figured out. if somebody cant figure something out, let us know and we will try helping you. Prestashop should really add an option on the backoffice to add new fields on the next version
  2. As mentioned before i'm not a php programmer but with hard work I figured my self as people on the forum that knows how to do it, couldn't be bothered explaining it for free. This is for 1.4+ to work with your contact form that has attachment enabled. I will show you the lines that I have added to my form, but you can change to the ones that you need by changing the values. There are few files that has to be edited: MAKE SURE TO MAKE A BACK UP OF ALL THESE FILES BEFORE EDITING THEM /controllers/ContactController.php /themes/your-theme/contact-form.tpl /mails/en(or and other languages using)/contact.html /mails/en(or and other languages using)/contact.txt /mails/en(or and other languages using)/contact_form.html /mails/en(or and other languages using)/contact_form.txt /controllers/ContactController.php Around the like 93 you will see: elseif (!empty($_FILES['fileUpload']['name']) AND !in_array(substr($_FILES['fileUpload']['name'], -4), $extension) AND !in_array(substr($_FILES['fileUpload']['name'], -5), $extension)) $this->errors[] = Tools::displayError('Bad file extension'); else After the line $this->errors[] = Tools::displayError('Bad file extension'); and before else make a space and add this code: elseif (!($companyname = nl2br2(Tools::getValue('companyname')))) $errors[] = Tools::displayError('Comapny name cannot be blank'); and it should look like this with many others if you need: elseif (!empty($_FILES['fileUpload']['name']) AND !in_array(substr($_FILES['fileUpload']['name'], -4), $extension) AND !in_array(substr($_FILES['fileUpload']['name'], -5), $extension)) $this->errors[] = Tools::displayError('Bad file extension'); elseif (!($companyname = nl2br2(Tools::getValue('companyname')))) $errors[] = Tools::displayError('Comapny name cannot be blank'); elseif (!($contactperson = nl2br2(Tools::getValue('contactperson')))) $errors[] = Tools::displayError('Contact Person cannot be blank'); elseif (!($phonenumber = nl2br2(Tools::getValue('phonenumber')))) $errors[] = Tools::displayError('Phone Number cannot be blank'); elseif (!($country = nl2br2(Tools::getValue('country')))) $errors[] = Tools::displayError('Country cannot be blank'); else Around the line 156 you have this code: if (Mail::Send((int)(self::$cookie->id_lang), 'contact', Mail::l('Message from contact form'), array('{email}' => $from, '{message}' => stripslashes($message)), $contact->email, $contact->name, $from, ((int)(self::$cookie->id_customer) ? $customer->firstname.' '.$customer->lastname : ''), $fileAttachment) AND Mail::Send((int)(self::$cookie->id_lang), 'contact_form', Mail::l('Your message has been correctly sent'), array('{message}' => stripslashes($message)), $from)) self::$smarty->assign('confirmation', 1); and you have to add: '{companyname}' => stripslashes ( $companyname ), the result should look like this: if (Mail::Send((int)(self::$cookie->id_lang), 'contact', Mail::l('Message from contact form'), array('{email}' => $from, '{message}' => stripslashes($message), '{companyname}' => stripslashes ( $companyname ), '{contactperson}' => stripslashes ( $contactperson ),'{phonenumber}' => stripslashes ( $phonenumber ), '{country}' => stripslashes ( $country )), $contact->email, $contact->name, $from, ((int)(self::$cookie->id_customer) ? $customer->firstname.' '.$customer->lastname : ''), $fileAttachment) AND Mail::Send((int)(self::$cookie->id_lang), 'contact_form', Mail::l('Your message has been correctly sent'), array('{email}' => $from, '{message}' => stripslashes($message), '{companyname}' => stripslashes ( $companyname ), '{contactperson}' => stripslashes ( $contactperson ),'{phonenumber}' => stripslashes ( $phonenumber ), '{country}' => stripslashes ( $country )), $from)) self::$smarty->assign('confirmation', 1); Then on the line 205 you have this: if (empty($contact->email)) Mail::Send((int)(self::$cookie->id_lang), 'contact_form', Mail::l('Your message has been correctly sent'), array('{message}' => stripslashes($message)), $from); self::$smarty->assign('confirmation', 1); And you should add: '{companyname}' => stripslashes ( $companyname ), And should look like this: if (empty($contact->email)) Mail::Send((int)(self::$cookie->id_lang), 'contact_form', Mail::l('Your message has been correctly sent'), array('{message}' => stripslashes($message), '{companyname}' => stripslashes ( $companyname ), '{contactperson}' => stripslashes ( $contactperson ),'{phonenumber}' => stripslashes ( $phonenumber ), '{country}' => stripslashes ( $country )), $from); self::$smarty->assign('confirmation', 1); This was the most complicated part. Now comes the next file which is the contact-form.tpl Find a place where you want to add the new forms on your page and add: <p> <label for="companyname">{l s='Company Name'}</label> <input type="text" id="companyname" name="companyname" value="{if isset($companyname)}{$companyname|escape:'htmlall':'UTF-8'|stripslashes}{/if}" /> </p> then you make sure all the values match the values from the previous file, the complete forms should look like this: <p> <label for="companyname">{l s='Company Name'}</label> <input type="text" id="companyname" name="companyname" value="{if isset($companyname)}{$companyname|escape:'htmlall':'UTF-8'|stripslashes}{/if}" /> </p> <p> <label for="contactperson">{l s='Contact Person'}</label> <input type="text" id="contactperson" name="contactperson" value="{if isset($contactperson)}{$contactperson|escape:'htmlall':'UTF-8'|stripslashes}{/if}" /> </p> <p> <label for="phonenumber">{l s='Phone Number'}</label> <input type="text" id="phonenumber" name="phonenumber" value="{if isset($phonenumber)}{$phonenumber|escape:'htmlall':'UTF-8'|stripslashes}{/if}" /> </p> <p> <label for="country">{l s='Country'}</label> <input type="text" id="country" name="country" value="{if isset($country)}{$country|escape:'htmlall':'UTF-8'|stripslashes}{/if}" /> </p> Now that file is done, the next files are the mail files which you will be able to receive and the customer also receive the mail. For the TXT files you add: Company name: {companyname} Contact person: {contactperson} Phone number: {phonenumber} Country: {country} and for the HTML files you add: Company name: {companyname} <br><br> Contact Person: {contactperson} <br><br> Phone Number: {phonenumber} <br><br> Country: {country} <br><br> And next step is to test it out. if you follow and make sure all the values match for all the files, then it will work without any problem. I hope it helps
  3. I solved the issue, if anyone needs how to add more fields on 1.4.1 let me know.
  4. i understand little bit, i edited the Contact.php under classes and the contact-form.tpl up to there i think is working fine as im not getting any error, the only place im having trouble is the mail, which i set it under {..} but im not getting anything
  5. I need help making a new custom form, i'm not a php programmer so i dont really know what to do, could any one help me? I need: Company name (required) Contact person (required) Email (required) Contact phone (required) Country (required) Project description - multiline textbox (required) File attachment - posibility for user to attach file (not required) (using prestashop 1.4.4.1) EDIT: See Tutorial Below
  6. Hi Mike, I just figure what to do, after importing, I have to go to each product and press save, then got back to the product and the packs will work. So somewhere in the database something isn't being saved.
  7. Hi Mike, Here is the bug url: http://forge.prestashop.com/browse/PSCFI-3186
  8. Further information on the bug, I tried importing many ways and different amount of products from over 1000 to 1. same problem when i try creating a pack with an imported product, when i type a letter it will appear the dropdown box with the suggestion, then when i choose, it wont add the full name, usually adds just a word and it cant be deleted either. when i try to save i get this message: 1 error An error occurred while adding products to the pack. then if i come back to the products, under pack all I see is: 1 x if i try to delete its not possible either. I tested importing a database, then adding a product manually and tried adding a product on the pack that was imported, also doesnt work. but if I add a product that i created manually, then works fine. Now the issue is. Our store consists of 90% of packs. so if we have to add over 1000 products manually it will take ages, so we really need some help resolving this issue.
  9. i'm using the standard prestashop tool on the products,
  10. I'm having a problem that the packs stops working after we import our product database. It work fine if you add a product from the backoffice. Could anyone help me?
  11. what i mean is, i need an url like : http://www.compfitt.com/br/lang-en/c-door/69-wide2door-2800-3800mm&att=SOMETHING=value=SOMETHING do you know what i mean? so when the customer click on that link, it will take him to that page with the values already set for him.
  12. One of my clients is asking if its possible to make a link that will open a product page showing a specific combination. for example: http://www.compfitt.com/br/lang-en/c-door/69-wide2door-2800-3800mm.html this page has Soft-close , Roll of glass gasket.... we are making a calculator, and when it calculates what the customer needs, we want to link them to the product page and have the drop down attribute combinations already set for him just to add to the cart. How Could I do this?
  13. I've been searching on the forum and I can't find anywhere something similar. On the pdf invoice under product tax, is it possible to break down the tax? at the moment it shows total product tax. I need to show Sales tax and product tax. and I have to show both separate. Could anyone help? should look like: Product: ..% Sales: ..% Carrier: ..% thx
×
×
  • Create New...