function cobian_vc_theme_pricetable($atts){
extract(shortcode_atts(array(
'section_id' => '',
'css' => '',
'orderby' => 'date',
'order' => 'DESC',
'post_number' => '4',
'price_category' => 'all',
'heading' => '',
'subtitle' => '',
'sectioniconname' => ''
), $atts));
global $post;
$args = array( 'post_type' => 'price',
'posts_per_page' => $post_number,
'order' => $order,
'orderby' => $orderby,
'post_status' => 'publish'
);
if($price_category != 'all'){
$str = $price_category;
$arr = explode(',', $str);
$args['tax_query'][] = array( 'taxonomy' => 'price_category', 'field' => 'slug', 'terms' => $arr );
}
query_posts( $args );
$out = '';
$css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, vc_shortcode_custom_css_class( $css, ' ' ), $atts );
$id = ($section_id != '') ? 'id="'. esc_attr($section_id) . '"' : '';
$out = '';
$out .= '<!-- Start Pricing -->';
$out .= '<section '.$id.' class="gray'. esc_attr($css_class) . '">';
$out .= '<div class="container">';
$out .= '<!-- Start Title -->';
$out .= '<div class="row">';
$out .= '<div class="col-md-10 col-md-offset-1 title-section">';
$out .= '<h4 class="title"><span>'. esc_html($heading) . '</span>'. esc_html($subtitle) . '</h4>';
$out .= '<div class="line"><i class="iconi '. esc_attr($sectioniconname) . '"></i></div>';
$out .= '</div>';
$out .= '</div>';
$out .= '<!-- End Title -->';
$out .= '<!-- Start Pricing -->';
$out .= '<div class="row wrap-price">';
if( have_posts() ) :
$count = 0;
while ( have_posts() ) : the_post();
$count++;
$pricecategories = get_post_meta( get_the_ID(), 'ninetheme_cobian_pricecategories', true );
$packname = get_post_meta( get_the_ID(), 'ninetheme_cobian_packname', true );
$currency = get_post_meta( get_the_ID(), 'ninetheme_cobian_table_currency', true );
$pricenumber1 = get_post_meta( get_the_ID(), 'ninetheme_cobian_price_firsttext', true );
$pricenumber2 = get_post_meta( get_the_ID(), 'ninetheme_cobian_price_secondtext', true );
$btn_link = get_post_meta( get_the_ID(), 'ninetheme_cobian_btn_link', true );
$btn_title = get_post_meta( get_the_ID(), 'ninetheme_cobian_btn_title', true );
$disablesecondtext = get_post_meta( get_the_ID(), 'ninetheme_cobian_disablesecondtext', true );
$tablefeatures = get_post_meta( get_the_ID(), 'ninetheme_cobian_features_list', true );
$current = get_post_meta( get_the_ID(), 'ninetheme_cobian_features_list_current', true );
$out .= '<div class="col-md-3">';
$out .= ' <!-- Start Pricing Info -->';
$out .= '<div class="table-price '. esc_html($pricecategories) . '">';
$out .= '<div class="title-price">';
$out .= '<h4>'. $packname . '</h4>';
$out .= ' </div>';
$out .= '<div class="price">';
$out .= '<h2>'. esc_html($pricenumber1) . '';if($disablesecondtext != '1') {$out .= '<small class="point">'. esc_html($pricenumber2) . '</small>';}
$out .= '<span> '. $currency . '</span></h2>';
$out .= '</div>';
$out .= '<ul class="list-feature">';
foreach ($tablefeatures as $listitem) {
$out .= '<li>'.$listitem.'</li>';}
$out .= '</ul>';
$out .= '<div class="footer-price">';
$out .= '<a href="'. esc_html($btn_link) . '" class="btn btn-'. esc_attr($pricecategories) . '">'. esc_html($btn_title) . '</a>';
$out .= '</div>';
$out .= ' </div>';
$out .= '<!-- End Pricing Info -->';
$out .= '</div>';
endwhile;
$out .= '</div>';
$out .= '<!-- End Pricing -->';
$out .= '</div>';
$out .= '</section>';
$out .= '<!-- End Pricing -->';
$out .= '<div class="clearfix"></div>';
endif; return $out;
}
add_shortcode('vc_price_table', 'cobian_vc_theme_pricetable');