Jump to content

lupillus

Members
  • Posts

    8
  • Joined

  • Last visited

Profile Information

  • Activity
    Freelancer

lupillus's Achievements

Newbie

Newbie (1/14)

  • Week One Done Rare
  • One Month Later Rare
  • One Year In Rare

Recent Badges

3

Reputation

  1. Hi all, So I have this situation. Order is placed, and I have to update quantites (sometime remove products if I don't have them), but when customer goes to History page and click reorder the same order, the quanitites and products are the same that was on initial order. In order details updated order is showing. Is there a solution to reorder order but with updated conditions? Thanks!
  2. Hi danielevigi, Can you please show the code of the controller you made? It would really help me to achive the same thing on my shop, Thank you very much!
  3. For anyone with the same issue, I had the same problem and found out that when you edit css file, first turn off Smart cache for CSS, upload edited css, than turn on the Smart cache for CSS again. Also work after you edit it again, just repeat the steps. It looks like when you turn it on it generates the new file (obviously ) It was very anoying! Hopefully this will work for others too
  4. Of course Vekia Here it is: if (isset($_POST['quickcontact'])){ $name = $_POST["name"]; $email = $_POST["email"]; $message = $_POST["message"]; if ( $_POST['subject'] != '' ) { $this->errors[] = Tools::displayError('An error occurred while sending the message.'); } else if ($name =='' || $email =='' || $message ==''){ $this->errors[] = Tools::displayError('Please fill all required fields'); } else if (!filter_var($email, FILTER_VALIDATE_EMAIL)){ $this->errors[] = Tools::displayError('Invalid email format'); } else{ $formcontent="From: $name \n Email: $email \n Message: $message"; $recipient = Configuration::get('PS_SHOP_EMAIL'); $subject = "Quick Contact Form"; $mailheader = "From: $email \r\n"; mail($recipient, $subject, $formcontent, $mailheader) or die("Error"); header( 'Location: http://www.google.com' ) ; } } But I have another problem with this. When I submit form it is displaying errors, but emptying all values from fileds. Maybe my solution isn't good And there is no way to put php into cms page via admin UPDATE: And I found solution for that also using jquery. If anyone is interested here is the solution. if (isset($_POST['quickcontact'])){ $name = $_POST["name"]; $email = $_POST["email"]; $message = $_POST["message"]; echo '<script>'; print "var name = '$name'; var message = '$message'; var email = '$message';"; echo '</script>'; if ( $_POST['subject'] != '' ) { $this->errors[] = Tools::displayError('An error occurred while sending the message.'); } else if ($name =='' || $email =='' || $message ==''){ $this->errors[] = Tools::displayError('Please fill all required fields'); } else if (!filter_var($email, FILTER_VALIDATE_EMAIL)){ $this->errors[] = Tools::displayError('Invalid email format'); } else{ $formcontent="From: $name \n Email: $email \n Message: $message"; $recipient = Configuration::get('PS_SHOP_EMAIL'); $subject = "Quick Contact Form"; $mailheader = "From: $email \r\n"; mail($recipient, $subject, $formcontent, $mailheader) or die("Error"); header( 'Location: http://www.google.com' ) ; } } And in CMS page inserted the jquery code <script type="text/javascript"> // <![CDATA[ $(document).ready(function (){ $('input[name=name]').val(name); $('textarea[name=message]').val(message); $('input[name=email]').val(email); }); // ]]> </script> Please Vekia tell me if this is OK way to do it
  5. Is it possible to make some fields mandatory and to validate email using this method? tnx! Nevermind, I've done it myself
  6. I found a little workaround, i know it is not a problem sloved solution but until someone smarter comes up with better solution i'm using this (i am using 1.5.2) in admin folder yourAdminFolder\themes\default\template\controllers\orders in file _customized_data.tpl i changed this <a href="displayImage.php?img={$data['value']}&name={$order->id}-file{$data@iteration}" target="_blank"><img src="{$smarty.const._THEME_PROD_PIC_DIR_}{$data['value']}_small" alt="" /></a> into this <a href="{$smarty.const._THEME_PROD_PIC_DIR_}{$data['value']}" target="_blank"><img src="{$smarty.const._THEME_PROD_PIC_DIR_}{$data['value']}_small" alt="" /></a> In opera and Chrome it shows me jpg file, and if i save it it saves with extension jpeg, but in ff it is offering me to download a file and i have to add extension jpg to save it as image file
  7. i sloved this by changing function dateYears() in tools.php, so now it is showing only allowed years for registration, like it was in previous versions of presta in classes/tools.php replace this one: public static function dateYears() { $tab = array(); for ($i = date('Y'); $i >= 1900; $i--) $tab[] = $i; return $tab; } with this one: public static function dateYears() { $tab = array(); for ($i = date('Y') - 10; $i >= 1900; $i--) $tab[] = $i; return $tab; }
×
×
  • Create New...