Jump to content

AgustinCecotec

Members
  • Posts

    7
  • Joined

  • Last visited

Profile Information

  • First Name
    Agustin
  • Last Name
    Cecotec

AgustinCecotec's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Thanks Vekia I will search/try for other options, but I think there's not much to do with prestashop... I think the best way is to merge both methods...do a Media class override to check the files adeded by AddJs and if they not exist as the standard names...search them inside the most typical directories where we can found these files.
  2. Hi phinq1910, is that the only way to find if the file exists? if the user has a "custom" theme and the bootsrap files are in other place it will not find them and it will include mines. This way there will be duplicated files in the page....
  3. I'm developing a module using some bootstrap code, and I want to know how I can use addCSS and addJS to add bootstrap core files inside the module and override the existing ones in case the theme is already using them...to avoid enqueuing duplicated files. Is there a way to do this? In Woocommerce it's possible to do cheking if the files are already enqueued or not, but I don't know if Prestashop has something similar.
  4. Hi, recently I needed to use the Mobile_Detect php library inside prestashop to add a custom code when my webpage is shown in a mobile/tablet device. Searching through PS Front Controller i saw how many values are given to smarty, between them is 'mobile_device' who calls the function getMobileDevice inside Context.php. Well...when it's used as a variable in a .tpl folder like {$mobile_device} it prints nothing (and it must print a boolean). Finally I ended doing an override of the Front Controller and adding a new assignment to smarty which calls to getDevice function (inside Context.php too). This is working well, but I don't understand what's wrong with getMobileDevice code. If this is a general issue, maybe it can be solved in the next updates. See ya!
  5. I want to know if it's possible to change the $from variable to receive the mails from the contact form directly from the customer mail and not from our website mail, because it's a nuissance to have in our e-mail all the emails coming from the same email address due to how they appear (in vertical alignment, one below another), and it's horrible to manage what mails have been responded or not. I'm trying to do this, and I think the "magic" could be done somewhere between this lines inside the "ContactController.php" 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, $file_attachment); } else { if (!Mail::Send($this->context->language->id, 'contact', Mail::l('Message from contact form').' [no_sync]', $var_list, $contact->email, $contact->name, null, null, $file_attachment, null, _PS_MAIL_DIR_, false, null, null, $from) || !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, $file_attachment, null, _PS_MAIL_DIR_, false, null, null, $contact->email)) { $this->errors[] = Tools::displayError('An error occurred while sending the message.'); } } I tried to change the $contact->email for the $from variable(because it appears to have stored the customer email from the form), but this way the mails are not sending, although the succes message is appering. Thanks to someone who can help. Greetings, Agustin.
  6. I want to know if it's possible to change the $from variable to receive the mails from the contact form directly from the customer mail and not from our website mail, because it's a nuissance to have in our e-mail all the emails coming from the same email address due to how they appear (in vertical alignment, one below another), and it's horrible to manage what mails have been responded or not. I'm trying to do this, and I think the "magic" could be done somewhere between this lines inside the "ContactController.php" 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, $file_attachment); } else { if (!Mail::Send($this->context->language->id, 'contact', Mail::l('Message from contact form').' [no_sync]', $var_list, $contact->email, $contact->name, null, null, $file_attachment, null, _PS_MAIL_DIR_, false, null, null, $from) || !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, $file_attachment, null, _PS_MAIL_DIR_, false, null, null, $contact->email)) { $this->errors[] = Tools::displayError('An error occurred while sending the message.'); } } I tried to change the $contact->email for the $from variable(because it appears to have stored the customer email from the form), but this way the mails are not sending, although the succes message is appering. Thanks to someone who can help. Greetings, Agustin.
×
×
  • Create New...