Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function send_mail(){
- $helper = $_POST["helper"];
- /*Очищаем корзину перед добавлением новых товаров*/
- global $woocommerce;
- $woocommerce->cart->empty_cart( $clear_persistent_cart = true );
- if($helper > 0){
- $woocommerce->cart->add_to_cart( 264 );
- }
- if(isset($_POST["country_name"])){
- $country_name = $_POST["country_name"];
- }
- else{
- $country_name = null;
- }
- if(isset($_POST["city_name"])){
- $city_name = $_POST["city_name"];
- }
- else{
- $city_name = null;
- }
- if(isset($_POST["count_day"])){
- $count_day = $_POST["count_day"];
- }
- else{
- $count_day = null;
- }
- if(isset($_POST["date_range_start"])){
- $date_range_start = $_POST["date_range_start"];
- }
- else{
- $date_range_start = null;
- }
- if(isset($_POST["date_range_end"])){
- $date_range_end = $_POST["date_range_end"];
- }
- else{
- $date_range_end = null;
- }
- if(isset($_POST["date_can_move"])){
- $date_can_move = $_POST["date_can_move"];
- }
- else{
- $date_can_move = null;
- }
- if(isset($_POST["count_people"])){
- $count_people = $_POST["count_people"];
- }
- else{
- $count_people = null;
- }
- if(isset($_POST["home_type"])){
- $home_type = $_POST["home_type"];
- }
- else{
- $home_type = null;
- }
- if(isset($_POST["budget_type"])){
- $budget_type = $_POST["budget_type"];
- }
- else{
- $budget_type = null;
- }
- if(isset($_POST["email"])){
- $email = $_POST["email"];
- }
- else{
- $email = null;
- }
- if(isset($_POST["soc_link"])){
- $soc_link = $_POST["soc_link"];
- }
- else{
- $soc_link = null;
- }
- if(isset($_POST["wanted"])){
- $wanted = $_POST["wanted"];
- }
- else{
- $wanted = null;
- }
- $country_string = '';
- $validate = validate_individual($count_day, $date_range_start,$date_range_end, $count_people, $home_type, $budget_type, $email);
- foreach ($validate as $v) {
- echo '<p class="error-message">'. $v . '</p>';
- }
- foreach ($country_name as $key => $country) {
- $country_string .= ++$key . ') ' . $country . '('. $city_name[$key-1] .')<br>';
- }
- $to = 'excelsiorer@yandex.ru';
- $subject = 'Заявка на Индивидуальный Трип';
- $message = '
- <strong>Почта:</strong> ' . $email . '<br>
- <strong>Социальная сеть:</strong>' . $soc_link . '<br>
- <strong>ФИО:</strong>' . $name . '<br>
- <strong>Телефон:</strong>' . $phone . '<br><br><br><br>' . '
- <strong>Выбранные страны и города:</strong>' . $country_string . '<br><strong>Количество дней</strong>' . $count_day . '<br>
- <strong>Диапазон дат:</strong>' . $date_range . '<br>
- <strong>Есть ли возможность сдвинуть?</strong>' . $date_can_move . '<br>
- <strong>Количество путешественников</strong>' . $count_people . '<br>
- <strong>Жилье</strong>' . $home_type_name . '<br>
- <strong>Бюджет</strong>' . $budget_type_name . '<br>' . '<strong>Пожелания:</stron><br>' . $wanted . '<br>' ;
- $headers = 'From: ' . $email . "\r\n" .
- 'Reply-To: '. $email . "\r\n" .
- "Content-type: text/html; charset=$send_charset\r\n" .
- 'X-Mailer: PHP/' . phpversion();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement