Ejemplo n.º 1
0
Archivo: cars.php Proyecto: zruiz/NG
    function widget($args, $instance)
    {
        extract($args);
        // these are the widget options
        $post_title = apply_filters('widget_title', $instance['title']);
        $post_title = $post_title == '' ? __('Latest Added', 'imic-framework-admin') : $post_title;
        $category = apply_filters('widget-category', empty($instance['category']) ? '' : $instance['category'], $instance, $this->id_base);
        $number = apply_filters('widget-number', $instance['number']);
        echo $args['before_widget'];
        global $imic_options;
        if (!empty($instance['title'])) {
            echo $args['before_title'];
            echo apply_filters('widget_title', $post_title, $instance, $this->id_base);
            echo $args['after_title'];
        }
        if (isset($imic_options['enable_rtl']) && $imic_options['enable_rtl'] == 1) {
            $DIR = 'data-rtl="rtl"';
        } else {
            $DIR = 'data-rtl="ltr"';
        }
        echo '
                            <div class="carousel-wrapper">
                                <div class="row">
                                    <ul class="owl-carousel single-carousel" id="vehicle-slider" data-columns="1" data-autoplay="" data-pagination="no" data-arrows="no" data-single-item="no" data-items-desktop="1" data-items-desktop-small="1" data-items-tablet="2" data-items-mobile="1" ' . $DIR . '>';
        $badges_type = isset($imic_options['badges_type']) ? $imic_options['badges_type'] : '0';
        $specification_type = isset($imic_options['short_specifications']) ? $imic_options['short_specifications'] : '0';
        if ($badges_type == "0") {
            $badge_ids = $imic_options['badge_specs'];
        } else {
            $badge_ids = array();
        }
        $img_src = '';
        if ($specification_type == 0) {
            $detailed_specs = isset($imic_options['specification_list']) ? $imic_options['specification_list'] : array();
        } else {
            $detailed_specs = array();
        }
        $additional_specs = isset($imic_options['additional_specs']) ? $imic_options['additional_specs'] : '';
        //$detailed_specs = $imic_options['vehicle_specs'];
        $additional_specs_all = get_post_meta($additional_specs, 'specifications_value', true);
        $highlighted_specs = isset($imic_options['highlighted_specs']) ? $imic_options['highlighted_specs'] : '';
        $unique_specs = $imic_options['unique_specs'];
        $listing_page_url = imic_get_template_url('template-listing.php');
        $args_cars = array('post_type' => 'cars', 'posts_per_page' => $number, 'post_status' => 'publish', 'meta_query' => array(array('key' => 'imic_plugin_ad_payment_status', 'value' => $category, 'compare' => '=')));
        $cars_listing = new WP_Query($args_cars);
        if ($cars_listing->have_posts()) {
            while ($cars_listing->have_posts()) {
                $cars_listing->the_post();
                if (is_plugin_active("imi-classifieds/imi-classified.php")) {
                    $badge_ids = imic_classified_badge_specs(get_the_ID(), $badge_ids);
                    $detailed_specs = imic_classified_short_specs(get_the_ID(), $detailed_specs);
                }
                $post_author_id = get_post_field('post_author', get_the_ID());
                $user_info_id = get_user_meta($post_author_id, 'imic_user_info_id', true);
                $author_role = get_option('blogname');
                if (!empty($user_info_id)) {
                    $term_list = wp_get_post_terms($user_info_id, 'user-role', array("fields" => "names"));
                    if (!empty($term_list)) {
                        $author_role = $term_list[0];
                    } else {
                        $author_role = get_option('blogname');
                    }
                }
                $specifications = get_post_meta(get_the_ID(), 'feat_data', true);
                $unique_value = imic_vehicle_price(get_the_ID(), $unique_specs, $specifications);
                $new_highlighted_specs = imic_filter_lang_specs_admin($highlighted_specs, get_the_ID());
                $highlighted_specs = $new_highlighted_specs;
                $highlight_value = imic_vehicle_title(get_the_ID(), $highlighted_specs, $specifications);
                $highlight_value = $highlight_value != '' ? $highlight_value : get_the_title();
                $details_value = imic_vehicle_all_specs(get_the_ID(), $detailed_specs, $specifications);
                if (!empty($additional_specs)) {
                    if ($imic_options['specification_fields_type'] == "0") {
                        $image_key = array_search($additional_specs, $specifications['sch_title']);
                        $additional_specs_value = $specifications['start_time'][$image_key];
                    } else {
                        $img_char = imic_the_slug($additional_specs);
                        $additional_specs_value = get_post_meta(get_the_ID(), 'char_' . $img_char, true);
                    }
                    $this_key = find_car_with_position($additional_specs_all, $additional_specs_value);
                    $img_src = $additional_specs_all[$this_key]['imic_plugin_spec_image'];
                }
                ?>
                                    <li class="item">
                                        <div class="vehicle-block format-standard">
                                        <?php 
                if (has_post_thumbnail()) {
                    if ($category == 1) {
                        ?>
                                            <a href="<?php 
                        echo esc_url(get_permalink());
                        ?>
" class="media-box"><?php 
                        the_post_thumbnail('600x400');
                        ?>
</a><?php 
                    } else {
                        ?>
<a href="javascript:void(0);" class="media-box"><?php 
                        the_post_thumbnail('600x400');
                        ?>
</a><?php 
                    }
                }
                ?>
                                            <div class="vehicle-block-content">
                                            <?php 
                if ($category == 1) {
                    ?>
                                                <h5 class="vehicle-title"><a href="<?php 
                    echo esc_url(get_permalink());
                    ?>
"><?php 
                    echo esc_attr($highlight_value);
                    ?>
</a></h5><?php 
                } else {
                    ?>
                                                <h5 class="vehicle-title"><?php 
                    echo esc_attr($highlight_value);
                    ?>
</h5><?php 
                }
                ?>
<span class="vehicle-meta"><?php 
                if (!empty($details_value)) {
                    foreach ($details_value as $value) {
                        echo esc_attr($value) . ', ';
                    }
                }
                echo esc_attr_e(' by ', 'framework');
                ?>
<abbr class="user-type" title="<?php 
                echo esc_attr_e('Listed by', 'framework');
                echo esc_attr($author_role);
                ?>
"><?php 
                echo esc_attr($author_role);
                ?>
</abbr></span>
                                                <?php 
                if ($img_src != '') {
                    ?>
                                                <a href="<?php 
                    echo esc_url($listing_page_url);
                    ?>
" title="<?php 
                    echo esc_attr_e('View all ', 'framework');
                    echo esc_attr($additional_specs_all[$this_key]['imic_plugin_specification_values']);
                    ?>
" class="vehicle-body-type"><img src="<?php 
                    echo esc_url($additional_specs_all[$this_key]['imic_plugin_spec_image']);
                    ?>
" alt=""></a><?php 
                }
                ?>
                                                <span class="vehicle-cost"><?php 
                echo esc_attr($unique_value);
                ?>
</span>
                                            </div>
                                        </div>
                                    </li>
                                    <?php 
            }
        }
        wp_reset_postdata();
        echo '</ul>
                                </div>
                            </div>';
        echo $args['after_widget'];
    }
Ejemplo n.º 2
0
 $car_author = get_post_field('post_author', get_the_ID());
 $user_info_id = get_user_meta($car_author, 'imic_user_info_id', true);
 $author_role = get_option('blogname');
 if (!empty($user_info_id)) {
     $term_list = wp_get_post_terms($user_info_id, 'user-role', array("fields" => "names"));
     if (!empty($term_list)) {
         $author_role = $term_list[0];
     } else {
         $author_role = get_option('blogname');
     }
 }
 $specifications = get_post_meta(get_the_ID(), 'feat_data', true);
 $new_highlighted_specs = imic_filter_lang_specs_admin($highlighted_specs, get_the_ID());
 $highlighted_specs = $new_highlighted_specs;
 $unique_value = imic_vehicle_price(get_the_ID(), $unique_specs, $specifications);
 $highlight_value = imic_vehicle_title(get_the_ID(), $highlighted_specs, $specifications);
 $details_value = imic_vehicle_all_specs(get_the_ID(), $detailed_specs, $specifications);
 if (!empty($additional_specs)) {
     if ($imic_options['specification_fields_type'] == "0") {
         $image_key = array_search($additional_specs, $specifications['sch_title']);
         $additional_specs_value = $specifications['start_time'][$image_key];
     } else {
         $img_char = imic_the_slug($additional_specs);
         $additional_specs_value = get_post_meta(get_the_ID(), 'char_' . $img_char, true);
     }
     $this_key = find_car_with_position($additional_specs_all, $additional_specs_value);
     $img_src = $additional_specs_all[$this_key]['imic_plugin_spec_image'];
 }
 $badges = imic_vehicle_all_specs(get_the_ID(), $badge_ids, $specifications);
 ?>
                     <li class="item">
Ejemplo n.º 3
0
        	<div class="container">
			<?php 
    if (!empty($compare)) {
        ?>
            	<!-- Vehicle Comparision -->
                <div class="comparision-table-resp">
                <div class="col3 comparision-table">
                	<div class="tsticky thead-sticky comp-table-row">
                    	<div class="comp-table-col">&nbsp;</div>
                        <?php 
        foreach ($compare as $comp) {
            $completed = get_post_meta($comp, 'imic_plugin_ad_payment_status', true);
            $specifications = get_post_meta($comp, 'feat_data', true);
            $new_highlighted_specs = imic_filter_lang_specs_admin($highlighted_specs, $comp);
            $highlighted_specs = $new_highlighted_specs;
            $highlighted_specs_val = imic_vehicle_title($comp, $highlighted_specs, $specifications);
            $unique_value = imic_vehicle_price($comp, $unique_specs, $specifications);
            if ($completed == 1) {
                ?>
                        <div class="comp-table-col">
                        	<strong><?php 
                echo esc_attr($highlighted_specs_val);
                ?>
</strong>
                            <span class="price"><?php 
                echo esc_attr($unique_value);
                ?>
</span>
                        </div><?php 
            } else {
                ?>
Ejemplo n.º 4
0
                    $detailed_specs = isset($imic_options['vehicle_specs']) ? $imic_options['vehicle_specs'] : array();
                } else {
                    $detailed_specs = array();
                }
                $detailed_title = $imic_options['highlighted_specs'];
                $saved_four = 1;
                foreach ($saved_cars as $save) {
                    $specifications = get_post_meta($save[0], 'feat_data', true);
                    $details_value = imic_vehicle_all_specs($save[0], $detailed_specs, $specifications);
                    if (is_plugin_active("imi-classifieds/imi-classified.php")) {
                        $details_value = imic_classified_short_specs($save, $details_value);
                    }
                    $price = imic_vehicle_price($save[0], $additional_specs, $specifications);
                    $new_highlighted_specs = imic_filter_lang_specs_admin($detailed_title, $save[0]);
                    $detailed_title = $new_highlighted_specs;
                    $title = imic_vehicle_title($save[0], $detailed_title, $specifications);
                    ?>
                                            <tr>
                                                <td valign="middle" class="checkb"><input id="saved-<?php 
                    echo esc_attr($save[0]);
                    ?>
" value="1" class="remove-saved compare-check" type="checkbox"></td>
                                                <td>
                                                    <!-- Result -->
                                                    <a href="<?php 
                    echo esc_url(get_permalink($save[0]));
                    ?>
" class="car-image"><?php 
                    echo get_the_post_thumbnail($save[0]);
                    ?>
</a>
Ejemplo n.º 5
0
function imic_mostviewed($atts, $content = null)
{
    extract(shortcode_atts(array("title" => "", "number" => "5", "view" => '1'), $atts));
    $output = '';
    $starts = 1;
    $most_viewed = array();
    global $imic_options;
    if ($view == 1 || $view == 3) {
        $logged_user_pin = '';
        $user_id = get_current_user_id();
        $logged_user = get_user_meta($user_id, 'imic_user_info_id', true);
        $logged_user_pin = get_post_meta($logged_user, 'imic_user_zip_code', true);
        if ($imic_options['badges_type'] == "0") {
            $badge_ids = isset($imic_options['badge_specs']) ? $imic_options['badge_specs'] : array();
        } else {
            $badge_ids = array();
        }
        $args_cats = array('orderby' => 'name', 'order' => 'ASC', 'fields' => 'all');
        $classifieds_data = get_option('imic_classifieds');
        $img_src = '';
        $additional_specs = isset($imic_options['additional_specs']) ? $imic_options['additional_specs'] : '';
        $additional_spec_slug = imic_the_slug($additional_specs);
        if ($imic_options['short_specifications'] == 0) {
            $detailed_specs = isset($imic_options['specification_list']) ? $imic_options['specification_list'] : array();
        } else {
            $detailed_specs = array();
        }
        $category_rail = isset($imic_options['category_rail']) ? $imic_options['category_rail'] : '0';
        $browse_listing = imic_get_template_url("template-listing.php");
        $additional_specs_all = get_post_meta($additional_specs, 'specifications_value', true);
        $highlighted_specs = isset($imic_options['highlighted_specs']) ? $imic_options['highlighted_specs'] : array();
        $unique_specs = isset($imic_options['unique_specs']) ? $imic_options['unique_specs'] : '';
        if ($view == 1) {
            $most_viewed = get_option('imic_most_viewed');
            $most_viewed = !empty($most_viewed) ? $most_viewed : array();
        } elseif ($view == 3) {
            $args_cars = array('post_type' => 'yachts', 'orderby' => 'meta_value', 'meta_query' => array('relation' => 'AND', array('key' => 'imic_plugin_ad_payment_status', 'value' => '1', 'compare' => '='), array('key' => 'imic_plugin_listing_end_dt', 'value' => date('Y-m-d'), 'compare' => '>=')), 'meta_key' => 'imic_most_visited', 'order' => 'DESC', 'posts_per_page' => $number);
            $cars_listing = new WP_Query($args_cars);
            if ($cars_listing->have_posts()) {
                while ($cars_listing->have_posts()) {
                    $cars_listing->the_post();
                    $most_viewed[] = get_the_ID();
                }
            }
            wp_reset_postdata();
        }
        if (!empty($most_viewed)) {
            $output .= '<section class="listing-block recent-vehicles">
                	<div class="listing-header">
                    	<h3>' . esc_attr($title) . '</h3>
                    </div>
                    <div class="listing-container">
                        <div class="carousel-wrapper">
                            <div class="row">
                                <ul class="owl-carousel carousel-fw" id="vehicle-slider" data-columns="4" data-autoplay="5000" data-pagination="yes" data-arrows="no" data-single-item="no" data-items-desktop="4" data-items-desktop-small="3" data-items-tablet="2" data-items-mobile="1">';
            foreach ($most_viewed as $most) {
                $listing_status = get_post_status($most);
                if ($listing_status == "publish") {
                    if (is_plugin_active("imi-classifieds/imi-classified.php")) {
                        $badge_ids = imic_classified_badge_specs($most, $badge_ids);
                        $detailed_specs = imic_classified_short_specs($most, $detailed_specs);
                    }
                    $post_author_id = get_post_field('post_author', $most);
                    $user_info_id = get_user_meta($post_author_id, 'imic_user_info_id', true);
                    $author_role = get_option('blogname');
                    if (!empty($user_info_id)) {
                        $term_list = wp_get_post_terms($user_info_id, 'user-role', array("fields" => "names"));
                        if (!empty($term_list)) {
                            $author_role = $term_list[0];
                        } else {
                            $author_role = get_option('blogname');
                        }
                    }
                    $specifications = get_post_meta($most, 'feat_data', true);
                    $unique_value = imic_vehicle_price($most, $unique_specs, $specifications);
                    $new_highlighted_specs = imic_filter_lang_specs_admin($highlighted_specs, $most);
                    $highlighted_specs = $new_highlighted_specs;
                    $highlight_value = imic_vehicle_title($most, $highlighted_specs, $specifications);
                    $highlight_value = $highlight_value != '' ? $highlight_value : get_the_title(get_the_ID());
                    $details_value = imic_vehicle_all_specs($most, $detailed_specs, $specifications);
                    if (!empty($additional_specs)) {
                        $image_key = array_search($additional_specs, $specifications['sch_title']);
                        $additional_specs_value = $specifications['start_time'][$image_key];
                        $this_key = find_car_with_position($additional_specs_all, $additional_specs_value);
                        $img_src = $additional_specs_all[$this_key]['imic_plugin_spec_image'];
                    }
                    $badges = imic_vehicle_all_specs($most, $badge_ids, $specifications);
                    $output .= '<li class="item">
            	<div class="vehicle-block format-standard">';
                    if (has_post_thumbnail($most)) {
                        $output .= '<a href="' . esc_url(get_permalink($most)) . '" class="media-box">' . get_the_post_thumbnail($most) . '</a>';
                    }
                    $output .= '<div class="vehicle-block-content">';
                    $start = 1;
                    $badge_position = array('vehicle-age', 'premium-listing', 'third-listing', 'fourth-listing');
                    foreach ($badges as $badge) {
                        $badge_class = $start == 1 ? 'default' : 'success';
                        $output .= '<span class="label label-' . esc_attr($badge_class) . ' ' . esc_attr($badge_position[$start - 1]) . '">' . esc_attr($badge) . '</span>';
                        $start++;
                        if ($start == 4) {
                            break;
                        }
                    }
                    if (!empty($highlight_value)) {
                        $output .= '<h5 class="vehicle-title"><a href="' . esc_url(get_permalink($most)) . '">' . esc_attr($highlight_value) . '</a></h5>';
                    }
                    $output .= '<span class="vehicle-meta">';
                    $total = 1;
                    if (!empty($details_value)) {
                        foreach ($details_value as $value) {
                            $output .= esc_attr($value) . ', ';
                            if ($total++ == 4) {
                                break;
                            }
                        }
                    }
                    $output .= __('by', 'framework') . '
				<abbr class="user-type" title="' . __('Listed by ', 'framework') . esc_attr($author_role) . '">' . esc_attr($author_role) . '</abbr></span>';
                    if ($img_src != '') {
                        $output .= '<a href="' . esc_url(add_query_arg($additional_spec_slug, $additional_specs_all[$this_key]['imic_plugin_specification_values'], $browse_listing)) . '" title="' . __('View all', 'framework') . esc_attr($additional_specs_all[$this_key]['imic_plugin_specification_values']) . '" class="vehicle-body-type"><img src="' . esc_url($additional_specs_all[$this_key]['imic_plugin_spec_image']) . '" alt=""></a>';
                    }
                    $output .= '<span class="vehicle-cost">' . esc_attr($unique_value) . '</span>';
                    if ($category_rail == "1" && is_plugin_active("imi-classifieds/imi-classified.php")) {
                        $output .= imic_get_cats_list($most, "list");
                    }
                    $output .= '</div>
        		</div>
        		</li>';
                    if ($starts == $number) {
                        break;
                    }
                    $starts++;
                }
            }
            $output .= '</ul>
                            </div>
                        </div>
                    </div>
                </section>';
        }
    }
    return $output;
}
Ejemplo n.º 6
0
                                                <span class="price"><?php 
    echo esc_attr($unique_value);
    ?>
</span>
                                           	</div>
                                            <div id="eight" class="delete session-save-car"><a href="#"><i class="icon-delete"></i></a></div>
                                        </li><?php 
}
if (!empty($_SESSION['viewed_vehicle_id3'])) {
    $highlighted_specs = $imic_options['highlighted_specs'];
    $new_highlighted_specs = imic_filter_lang_specs_admin($highlighted_specs, $_SESSION['viewed_vehicle_id3']);
    $highlighted_specs = $new_highlighted_specs;
    $unique_specs = $imic_options['unique_specs'];
    $specifications = get_post_meta($_SESSION['viewed_vehicle_id3'], 'feat_data', true);
    $unique_value = imic_vehicle_price($_SESSION['viewed_vehicle_id3'], $unique_specs, $specifications);
    $highlight_value = imic_vehicle_title($_SESSION['viewed_vehicle_id3'], $highlighted_specs, $specifications);
    ?>
                                        <li>
                                        	<div class="checkb"><input value="0" id="view-<?php 
    echo esc_attr($_SESSION["viewed_vehicle_id3"]);
    ?>
" class="compare-viewed" type="checkbox"></div>
                                            <div class="imageb"><a href="<?php 
    echo esc_url(get_permalink($_SESSION['viewed_vehicle_id3']));
    ?>
"><?php 
    echo get_the_post_thumbnail($_SESSION['viewed_vehicle_id3']);
    ?>
</a></div>
                                            <div class="textb">
                                            	<a href="<?php 
Ejemplo n.º 7
0
 function imic_vehicle_add()
 {
     //echo "sai";
     global $imic_options;
     $highlighted_specs = $imic_options['highlighted_specs'];
     $unique_specs = $imic_options['unique_specs'];
     if (is_user_logged_in()) {
         //echo "ss";
         if (isset($_SESSION['saved_vehicle_id1']) || isset($_SESSION['saved_vehicle_id2']) || isset($_SESSION['saved_vehicle_id3'])) {
             $vehicle_1 = isset($_SESSION['saved_vehicle_id1']) ? $_SESSION['saved_vehicle_id1'] : '';
             $vehicle_2 = isset($_SESSION['saved_vehicle_id2']) ? $_SESSION['saved_vehicle_id2'] : '';
             $vehicle_3 = isset($_SESSION['saved_vehicle_id3']) ? $_SESSION['saved_vehicle_id3'] : '';
             $ids = array($vehicle_1, $vehicle_2, $vehicle_3);
             $time = date('U');
             $car = array();
             $user_id = get_current_user_id();
             $user_info_id = get_user_meta($user_id, 'imic_user_info_id', true);
             $saved_cars_user = get_post_meta($user_info_id, 'imic_user_saved_cars', true);
             if (!empty($saved_cars_user)) {
                 foreach ($saved_cars_user as $cars) {
                     $car[] = $cars;
                 }
             }
             foreach ($ids as $id) {
                 if ($id != '') {
                     if (!imic_search_array($id, $car)) {
                         $car[] = array($id, $time);
                     }
                 }
             }
             update_post_meta($user_info_id, 'imic_user_saved_cars', $car);
             $saved_cars = get_post_meta($user_info_id, 'imic_user_saved_cars', true);
             $i = 0;
             foreach ($saved_cars as $car) {
                 $specifications = get_post_meta($car[0], 'feat_data', true);
                 $unique_values = imic_vehicle_price($car[0], $unique_specs, $specifications);
                 $new_highlighted_specs = imic_filter_lang_specs_admin($highlighted_specs, $car[0]);
                 $highlighted_specs = $new_highlighted_specs;
                 $highlight_values = imic_vehicle_title($car[0], $highlighted_specs, $specifications);
                 $highlight_values = $highlight_values == '' ? get_the_title($car[0]) : $highlight_values;
                 echo '
                                     <li>
                                         <div class="checkb"><input class="compare-check" type="checkbox" value="0" id="saved-' . $car[0] . '"></div>
                                         <div class="imageb"><a href="' . esc_url(get_permalink($car[0])) . '">' . get_the_post_thumbnail($car[0]) . '</a></div>
                                         <div class="textb">
                                             <a href="' . esc_url(get_permalink($car[0])) . '">' . $highlight_values . '</a>
                                             <span class="price">' . $unique_values . '</span>
                                         </div>
                                         <div rel="specific-saved-ad" class="delete delete-box-saved"><div class="specific-id" style="display:none;"><span class="saved-id">' . $car[0] . '</span></div><a href="#"><i class="icon-delete"></i></a></div>
                                     </li>';
                 if ($i++ >= 3) {
                     break;
                 }
             }
             unset($_SESSION['saved_vehicle_id1']);
             unset($_SESSION['saved_vehicle_id2']);
             unset($_SESSION['saved_vehicle_id3']);
         } else {
             $print = '';
             $car = array();
             $vehicle_id = $_POST['vehicle_id'];
             $date = date('U');
             $save_car_data = array($vehicle_id, $date);
             $user_id = get_current_user_id();
             $user_info_id = get_user_meta($user_id, 'imic_user_info_id', true);
             $saved_cars_user = get_post_meta($user_info_id, 'imic_user_saved_cars', true);
             if (!empty($saved_cars_user)) {
                 foreach ($saved_cars_user as $cars) {
                     $car[] = $cars;
                 }
             }
             if (!imic_search_array($save_car_data[0], $car)) {
                 $print = 1;
                 $car[] = $save_car_data;
             }
             //print_r($car);
             update_post_meta($user_info_id, 'imic_user_saved_cars', $car);
             if ($print == 1) {
                 $specifications = get_post_meta($vehicle_id, 'feat_data', true);
                 if (!empty($specifications)) {
                     $unique_values = imic_vehicle_price($vehicle_id, $unique_specs, $specifications);
                     $new_highlighted_specs = imic_filter_lang_specs_admin($highlighted_specs, $vehicle_id);
                     $highlighted_specs = $new_highlighted_specs;
                     $highlight_values = imic_vehicle_title($vehicle_id, $highlighted_specs, $specifications);
                     $highlight_values = $highlight_values == '' ? get_the_title($vehicle_id) : $highlight_values;
                     echo '
                                     <li>
                                         <div class="checkb"><input class="compare-check" type="checkbox" value="0" id="saved-' . $vehicle_id . '"></div>
                                         <div class="imageb"><a href="' . esc_url(get_permalink($vehicle_id)) . '">' . get_the_post_thumbnail($vehicle_id) . '</a></div>
                                         <div class="textb">
                                             <a href="' . esc_url(get_permalink($vehicle_id)) . '">' . $highlight_values . '</a>
                                             <span class="price">' . $unique_values . '</span>
                                         </div>
                                         <div rel="specific-saved-ad" class="delete delete-box-saved"><div class="specific-id" style="display:none;"><span class="saved-id">' . $vehicle_id . '</span></div><a href="#"><i class="icon-delete"></i></a></div>
                                     </li>';
                 }
             }
         }
     } else {
         if (empty($_SESSION['saved_vehicle_id1'])) {
             $vehicle_id = $_POST['vehicle_id'];
         } elseif (empty($_SESSION['saved_vehicle_id2'])) {
             $vehicle_id = $_POST['vehicle_id'];
         } elseif (empty($_SESSION['saved_vehicle_id3'])) {
             $vehicle_id = $_POST['vehicle_id'];
         }
         if (empty($_SESSION['saved_vehicle_id1'])) {
             $_SESSION['saved_vehicle_id1'] = $vehicle_id;
             $specifications = get_post_meta($_SESSION['saved_vehicle_id1'], 'feat_data', true);
             $unique_value = imic_vehicle_price($_SESSION['saved_vehicle_id1'], $unique_specs, $specifications);
             $new_highlighted_specs = imic_filter_lang_specs_admin($highlighted_specs, $_SESSION['saved_vehicle_id1']);
             $highlighted_specs = $new_highlighted_specs;
             $highlight_value = imic_vehicle_title($_SESSION['saved_vehicle_id1'], $highlighted_specs, $specifications);
             $highlight_value = $highlight_value == '' ? get_the_title($_SESSION['saved_vehicle_id1']) : $highlight_value;
             echo '
                                     <li>
                                         <div class="checkb"><input class="compare-check" type="checkbox" value="0" id="saved-' . $_SESSION['saved_vehicle_id1'] . '"></div>
                                         <div class="imageb"><a href="' . esc_url(get_permalink($_SESSION['saved_vehicle_id1'])) . '">' . get_the_post_thumbnail($_SESSION['saved_vehicle_id1']) . '</a></div>
                                         <div class="textb">
                                             <a href="' . esc_url(get_permalink($_SESSION['saved_vehicle_id1'])) . '">' . $highlight_value . '</a>
                                             <span class="price">' . $unique_value . '</span>
                                         </div>
                                         <div id="one" class="delete session-save-car"><a href="#"><i class="icon-delete"></i></a></div>
                                     </li>';
         } elseif (empty($_SESSION['saved_vehicle_id2'])) {
             $_SESSION['saved_vehicle_id2'] = $vehicle_id;
             $specifications = get_post_meta($_SESSION['saved_vehicle_id2'], 'feat_data', true);
             $unique_value = imic_vehicle_price($_SESSION['saved_vehicle_id2'], $unique_specs, $specifications);
             $new_highlighted_specs = imic_filter_lang_specs_admin($highlighted_specs, $_SESSION['saved_vehicle_id2']);
             $highlighted_specs = $new_highlighted_specs;
             $highlight_value = imic_vehicle_title($_SESSION['saved_vehicle_id2'], $highlighted_specs, $specifications);
             $highlight_value = $highlight_value == '' ? get_the_title($_SESSION['saved_vehicle_id2']) : $highlight_value;
             echo '
                                     <li>
                                         <div class="checkb"><input class="compare-check" type="checkbox" value="0" id="saved-' . $_SESSION['saved_vehicle_id2'] . '"></div>
                                         <div class="imageb"><a href="' . esc_url(get_permalink($_SESSION['saved_vehicle_id2'])) . '">' . get_the_post_thumbnail($_SESSION['saved_vehicle_id2']) . '</a></div>
                                         <div class="textb">
                                             <a href="' . esc_url(get_permalink($_SESSION['saved_vehicle_id2'])) . '">' . $highlight_value . '</a>
                                             <span class="price">' . $unique_value . '</span>
                                         </div>
                                         <div id="two" class="delete session-save-car"><a href="#"><i class="icon-delete"></i></a></div>
                                     </li>';
         } elseif (empty($_SESSION['saved_vehicle_id3'])) {
             $_SESSION['saved_vehicle_id3'] = $vehicle_id;
             $specifications = get_post_meta($_SESSION['saved_vehicle_id3'], 'feat_data', true);
             $unique_value = imic_vehicle_price($_SESSION['saved_vehicle_id3'], $unique_specs, $specifications);
             $new_highlighted_specs = imic_filter_lang_specs_admin($highlighted_specs, $_SESSION['saved_vehicle_id3']);
             $highlighted_specs = $new_highlighted_specs;
             $highlight_value = imic_vehicle_title($_SESSION['saved_vehicle_id3'], $highlighted_specs, $specifications);
             $highlight_value = $highlight_value == '' ? get_the_title($_SESSION['saved_vehicle_id3']) : $highlight_value;
             echo '
                                     <li>
                                         <div class="checkb"><input class="compare-check" type="checkbox" value="0" id="saved-' . $_SESSION['saved_vehicle_id3'] . '"></div>
                                         <div class="imageb"><a href="' . esc_url(get_permalink($_SESSION['saved_vehicle_id3'])) . '">' . get_the_post_thumbnail($_SESSION['saved_vehicle_id3']) . '</a></div>
                                         <div class="textb">
                                             <a href="' . esc_url(get_permalink($_SESSION['saved_vehicle_id3'])) . '">' . $highlight_value . '</a>
                                             <span class="price">' . $unique_value . '</span>
                                         </div>
                                         <div id="three" class="delete session-save-car"><a href="#"><i class="icon-delete"></i></a></div>
                                     </li>';
         } else {
             echo '<li>' . __('Please login/register to add more', 'framework') . '</li>';
         }
         //echo "sb";
     }
     die;
 }