Exemplo n.º 1
0
    public function dhvc_woo_products_shortcode($atts, $content = null)
    {
        extract(shortcode_atts(array('id' => '', 'heading' => '', 'heading_color' => '#47A3DA', 'heading_font_size' => '20px', 'query_options' => '', 'query_type' => '1', 'products' => '', 'exclude_products' => '', 'category' => '', 'exclude_category' => '', 'brand' => '', 'exclude_brand' => '', 'tag' => '', 'exclude_tag' => '', 'attribute' => '', 'posts_per_page' => '6', 'post_per_row' => '2', 'show' => '', 'orderby' => 'date', 'order' => 'ASC', 'hide_free' => '', 'show_hidden' => '', 'style_options' => '', 'display' => 'grid', 'hide_result_count' => '', 'hide_ordering_list' => '', 'show_grid_pagination' => '', 'show_masonry_filter' => '1', 'masonry_filters_background' => '#ffffff', 'masonry_filters_selected_background' => '#47A3DA', 'masonry_filters_color' => '#666666', 'masonry_filters_selected_color' => '#ffffff', 'masonry_filters_border_color' => '#ffffff', 'masonry_filters_selected_border_color' => '#47A3DA', 'masonry_gutter' => 10, 'hide_carousel_arrows' => '1', 'show_carousel_pagination' => '', 'carousel_arrow_background' => '#CFCDCD', 'carousel_arrow_hover_background' => '#47A3DA', 'carousel_arrow_color' => '#ffffff', 'carousel_arrow_hover_color' => '#ffffff', 'carousel_arrow_size' => '24px', 'carousel_arrow_front_size' => '12px', 'carousel_arrow_border_radius' => '3px', 'carousel_pagination_background' => '#869791', 'carousel_pagination_active_background' => '#47A3DA', 'carousel_pagination_size' => '12px', 'item_border_style' => 'solid', 'item_border_color' => '#e1e1e1', 'item_border_width' => '1px', 'row_separator_color' => '#e1e1e1', 'row_separator_height' => '20px', 'row_separator_border_style' => 'solid', 'hide_thumbnail' => '1', 'thumbnail_background_color' => '#ffffff', 'thumbnail_border_style' => 'solid', 'thumbnail_border_color' => '#e1e1e1', 'thumbnail_border_width' => '1px', 'thumbnail_border_radius' => '3px', 'thumbnail_padding' => '', 'thumbnail_margin' => '', 'thumbnail_width' => '', 'thumbnail_height' => '', 'hide_title' => '1', 'title_align' => 'center', 'title_color' => '#47A3DA', 'title_hover_color' => '#98D2F7', 'title_font_size' => '14px', 'title_padding' => '', 'title_margin' => '', 'show_excerpt' => '', 'excerpt_length' => '15', 'excerpt_align' => '', 'excerpt_color' => '#333333', 'excerpt_font_size' => '12px', 'excerpt_padding' => '', 'excerpt_margin' => '', 'hide_price' => '1', 'price_color' => '#47A3DA', 'no_discount_price_color' => '#333333', 'price_font_size' => '14px', 'no_discount_price_font_size' => '12px', 'price_padding' => '', 'price_margin' => '', 'hide_addtocart' => '1', 'addtocart_text' => 'Add to cart', 'addtocart_color' => '', 'addtocart_font_size' => '14px', 'addtocart_padding' => '', 'addtocart_margin' => '', 'add_cart_price_style' => '2column', 'show_rating' => '1', 'show_sale_flash' => '1', 'el_class' => ''), $atts));
        $inline_style = '

#' . $id . ' .dhvc-woo-heading {
	color:' . $heading_color . ';
	font-size:' . $heading_font_size . ';
}
			
#' . $id . ' .dhvc-woo-item {
	border: ' . $item_border_width . ' ' . $item_border_style . ' ' . $item_border_color . ';
}
#' . $id . ' .dhvc-woo-separator{
	border-top-color:' . $row_separator_color . ';
	margin-top:' . absint($row_separator_height) / 2 . 'px;
	margin-bottom:' . absint($row_separator_height) / 2 . 'px;
	border-top-style:' . $row_separator_border_style . ';
}
#' . $id . ' .dhvc-woo-images{
	background-color:' . $thumbnail_background_color . ';	
}
#' . $id . ' .dhvc-woo-images img{
	border-style:' . $thumbnail_border_style . ';
	border-width:' . $thumbnail_border_width . ';
	border-color:' . $thumbnail_border_color . ';
	border-radius:' . $thumbnail_border_radius . ';
	-webkit-border-radius:' . $thumbnail_border_radius . ';
	padding:' . $thumbnail_padding . ';
	margin:' . $thumbnail_margin . ';
}
#' . $id . ' .dhvc-woo-title{
	text-align:' . $title_align . ';
	padding:' . $title_padding . ';
	margin:' . $title_margin . ';		
}		
#' . $id . ' .dhvc-woo-title a{
	color:' . $title_color . ';
	font-size:' . $title_font_size . ';
				
}
#' . $id . ' .dhvc-woo-title a:hover{
	color:' . $title_hover_color . '
}
#' . $id . ' .dhvc-woo-excerpt{
	text-align:' . $excerpt_align . ';
	color:' . $excerpt_color . ';
	font-size:' . $excerpt_font_size . ';
	padding:' . $excerpt_padding . ';
	margin:' . $excerpt_margin . ';
}
#' . $id . ' .dhvc-woo-price{
	padding:' . $price_padding . ';
	margin:' . $price_margin . ';			
}
#' . $id . ' .dhvc-woo-price .amount,
#' . $id . ' .dhvc-woo-price ins .amount{
	color:' . $price_color . ';
	font-size:' . $price_font_size . ';
	
}
#' . $id . ' .dhvc-woo-price del .amount{
	color:' . $no_discount_price_color . ';
	font-size:' . $no_discount_price_font_size . '
}
#' . $id . ' .dhvc-woo-addtocart a{
	padding:' . $addtocart_padding . ';
	margin:' . $addtocart_margin . ';
}

#' . $id . ' .dhvc-woo-masonry-list .dhvc-woo-masonry-item{
	margin-bottom:' . absint($masonry_gutter) . 'px;
}
#' . $id . ' .dhvc-woo-filters a {
	border-color:' . $masonry_filters_border_color . ';
    background-color:' . $masonry_filters_background . ';
    color:' . $masonry_filters_color . ';
    				
}
#' . $id . ' .dhvc-woo-filters a.selected,
#' . $id . ' .dhvc-woo-filters a:hover{
	background-color:' . $masonry_filters_selected_background . ';
	color:' . $masonry_filters_selected_color . ';
	border-color:' . $masonry_filters_selected_border_color . ';
}
#' . $id . ' .dhvc-woo-carousel-arrows a{
	background:' . $carousel_arrow_background . ';
	width:' . $carousel_arrow_size . ';
	height:' . $carousel_arrow_size . ';
	border-radius:' . $carousel_arrow_border_radius . ';
	-webkit-border-radius:' . $carousel_arrow_border_radius . ';
}
#' . $id . ' .dhvc-woo-carousel-arrows a:hover{
	background:' . $carousel_arrow_hover_background . ';
}	
#' . $id . ' .dhvc-woo-carousel-arrows a i{
	color:' . $carousel_arrow_color . ';
	font-size:' . $carousel_arrow_front_size . ';
}
#' . $id . ' .dhvc-woo-carousel-arrows a:hover i{
	color:' . $carousel_arrow_hover_color . ';
}						
#' . $id . ' .owl-controls .owl-page span{
	width:' . $carousel_pagination_size . ';
	height:' . $carousel_pagination_size . ';
	background:' . $carousel_pagination_background . ';
}
			
#' . $id . ' .owl-controls .owl-page.active span,
#' . $id . ' .owl-controls.clickable .owl-page:hover span{
	background:' . $carousel_pagination_active_background . ';
}
';
        if (defined('YITH_WCWL')) {
            $label = apply_filters('yith_wcwl_button_label', get_option('yith_wcwl_add_to_wishlist_text'));
            $br = apply_filters('yith-wcwl-browse-wishlist-label', __('Browse Wishlist', 'yit'));
            $inline_style .= '#' . $id . ' .dhvc-woo-images .add_to_wishlist:after{
	content:"' . $label . '";
}	
#' . $id . ' .dhvc-woo-images .yith-wcwl-wishlistexistsbrowse a:after,
#' . $id . ' .dhvc-woo-images .yith-wcwl-wishlistaddedbrowse a:after{
	content:"' . $br . '";
}
';
        }
        //wp_enqueue_style('dhvc-woo');
        global $woocommerce, $product, $wp_the_query;
        $posts_per_page = $posts_per_page;
        $show = sanitize_title($show);
        $orderby = sanitize_title($orderby);
        $order = sanitize_title($order);
        if (is_front_page()) {
            $paged = get_query_var('page') ? get_query_var('page') : 1;
        } else {
            $paged = get_query_var('paged') ? get_query_var('paged') : 1;
        }
        $query_args = array('paged' => $paged, 'posts_per_page' => $posts_per_page, 'post_status' => 'publish', 'post_type' => 'product', 'offset' => 0, 'order' => $order == 'asc' ? 'ASC' : 'DESC');
        if ($query_type == '1') {
            if (!empty($products)) {
                $products_ids = explode(',', $products);
                $query_args['post__in'] = $products_ids;
            }
            if (!empty($exclude_products)) {
                $exclude_products_ids = explode(',', $exclude_products);
                $query_args[' post__not_in'] = $exclude_products_ids;
            }
            $categories = array();
            if (is_product()) {
                $cat_terms = get_the_terms($product->id, 'product_cat');
                if ($cat_terms) {
                    foreach ($cat_terms as $cat) {
                        $categories[] = $cat->term_id;
                    }
                }
            }
            if (!empty($category)) {
                $category = str_replace('-1', implode(',', $categories), $category);
                $query_args['tax_query'][] = array('taxonomy' => 'product_cat', 'field' => 'id', 'terms' => explode(',', $category), 'operator' => 'IN');
            }
            if (!empty($exclude_category)) {
                $exclude_category = str_replace('-1', implode(',', $categories), $exclude_category);
                $query_args['tax_query'][] = array('taxonomy' => 'product_cat', 'field' => 'id', 'terms' => explode(',', $exclude_category), 'operator' => 'NOT IN');
            }
            if (!empty($brand)) {
                $query_args['tax_query'][] = array('taxonomy' => 'product_brand', 'field' => 'id', 'terms' => explode(',', $brand), 'operator' => 'IN');
            }
            if (!empty($exclude_brand)) {
                $query_args['tax_query'][] = array('taxonomy' => 'product_brand', 'field' => 'id', 'terms' => explode(',', $exclude_brand), 'operator' => 'NOT IN');
            }
            if (!empty($tag)) {
                $query_args['tax_query'][] = array('taxonomy' => 'product_tag', 'field' => 'id', 'terms' => explode(',', $tag), 'operator' => 'IN');
            }
            if (!empty($exclude_tag)) {
                $query_args['tax_query'][] = array('taxonomy' => 'product_tag', 'field' => 'id', 'terms' => explode(',', $exclude_tag), 'operator' => 'NOT IN');
            }
            if (!empty($attribute)) {
                $attribute_arr = explode(',', $attribute);
                $t = array();
                foreach ($attribute_arr as $attr) {
                    $attr_arr = explode('|', $attr);
                    $t[$attr_arr[0]][] = $attr_arr[1];
                }
                if (!empty($t)) {
                    foreach ($t as $key => $tarr) {
                        $query_args['tax_query'][] = array('taxonomy' => $key, 'field' => 'slug', 'terms' => $tarr, 'operator' => 'IN');
                    }
                }
            }
        }
        if ($query_type == 'upsell') {
            $query_args = $this->_get_upsell_product($query_args);
            if (empty($query_args)) {
                return;
            }
        }
        if ($query_type == 'related') {
            $query_args = $this->_get_related_product($query_args);
            if (empty($query_args)) {
                return;
            }
        }
        if ($query_type == 'crosssell') {
            $query_args = $this->_get_crosssell_product($query_args);
            if (empty($query_args)) {
                return;
            }
        }
        $query_args['meta_query'] = array();
        if ($show_hidden == '0') {
            $query_args['meta_query'][] = array('key' => '_visibility', 'value' => array('visible', 'catalog'), 'compare' => 'IN');
            $query_args['post_parent'] = 0;
        }
        if (!empty($hide_free)) {
            $query_args['meta_query'][] = array('key' => '_price', 'value' => 0, 'compare' => '>', 'type' => 'DECIMAL');
        }
        $stock_status = array();
        if (get_option('woocommerce_hide_out_of_stock_items') == 'yes') {
            $stock_status = array('key' => '_stock_status', 'value' => 'instock', 'compare' => '=');
        }
        $query_args['meta_query'][] = $stock_status;
        $query_args['meta_query'] = array_filter($query_args['meta_query']);
        switch ($show) {
            case 'featured':
                $query_args['meta_query'][] = array('key' => '_featured', 'value' => 'yes');
                break;
            case 'onsale':
                $product_ids_on_sale = wc_get_product_ids_on_sale();
                $product_ids_on_sale[] = 0;
                $query_args['post__in'] = $product_ids_on_sale;
                break;
        }
        if (isset($_GET['orderby']) && !empty($_GET['orderby'])) {
            $orderby = sanitize_text_field($_GET['orderby']);
        }
        $query_args['order'] = $order;
        switch ($orderby) {
            case 'title':
                $query_args['orderby'] = 'title';
                break;
            case 'modified':
                $query_args['orderby'] = 'modified';
                break;
            case 'comment_count':
                $query_args['orderby'] = 'comment_count';
                break;
            case 'popularity':
                $args['meta_key'] = 'total_sales';
                // Sorting handled later though a hook
                add_filter('posts_clauses', array($woocommerce->query, 'order_by_popularity_post_clauses'));
                break;
            case 'rating':
                // Sorting handled later though a hook
                add_filter('posts_clauses', array($woocommerce->query, 'order_by_rating_post_clauses'));
                break;
            case 'date':
                $query_args['orderby'] = 'date';
                //$query_args['order']    = 'ASC' ? 'ASC' : 'DESC';
                break;
            case 'rand':
                $query_args['orderby'] = 'rand';
                break;
            case 'sales':
                $query_args['meta_key'] = 'total_sales';
                $query_args['orderby'] = 'meta_value_num';
                break;
            case 'price':
                $query_args['meta_key'] = '_price';
                $query_args['orderby'] = 'meta_value_num';
                $query_args['order'] = 'asc';
                break;
            case 'price-desc':
                $query_args['meta_key'] = '_price';
                $query_args['orderby'] = 'meta_value_num';
                $query_args['order'] = 'desc';
                break;
            default:
                $ordering_args = $woocommerce->query->get_catalog_ordering_args($orderby, $order);
                $query_args['orderby'] = $ordering_args['orderby'];
                //$query_args['order'] =$ordering_args['order'];
                break;
        }
        $query_args = apply_filters('dhvc_woo_query_args', $query_args, $atts, $content);
        $r = new WP_Query($query_args);
        $output = '';
        if (defined('WPB_VC_VERSION') && function_exists('vc_add_param')) {
            if (!dhvc_is_editor() && !dhvc_is_editor()) {
                //wp_add_inline_style('dhvc-woo',$inline_style);
                $output .= '<style type="text/css">' . $inline_style . '</style>';
            } else {
                $output .= '<style type="text/css">' . $inline_style . '</style>';
            }
        } else {
            //wp_add_inline_style('dhvc-woo',$inline_style);
            $output .= '<style type="text/css">' . $inline_style . '</style>';
        }
        // 		wp_enqueue_style('dhvc-woo-font-awesome');
        // 		wp_enqueue_style('dhvc-woo-chosen');
        // 		wp_enqueue_style('dhvc-woo');
        $output .= '<div id="' . $id . '" class="woocommerce dhvc-woo ' . $el_class . '">';
        if (!empty($heading)) {
            $output .= '<div class="dhvc-woo-heading">';
            $output .= $heading;
            $output .= '</div>';
        }
        if ($display == 'masonry' && $show_masonry_filter !== '0') {
            $output .= '<div class="dhvc-woo-filters dhvc-woo-clearfix">';
            $output .= '<ul data-option-key="filter">';
            $output .= '<li>';
            $output .= '<a class="dhvc-woo-filter selected" href="#" data-option-value="*">' . __('All', DHVC_WOO) . '</a>';
            $output .= '</li>';
            $product_cats = array();
            if ($r->have_posts()) {
                while ($r->have_posts()) {
                    $r->the_post();
                    global $product;
                    $cats = get_the_terms($product->id, 'product_cat');
                    if (!empty($cats)) {
                        foreach ($cats as $cat) {
                            $product_cats[$cat->term_id] = $cat->name;
                        }
                    }
                }
                foreach ($product_cats as $term_id => $name) {
                    $output .= '<li>';
                    $output .= '<a href="#" class="dhvc-woo-filter" data-option-value= ".dhvc-woo-cat-' . $term_id . '">' . $name . '</a>';
                    $output .= '</li>';
                }
                wp_reset_postdata();
                wp_reset_query();
            }
            $output .= '</ul>';
            $output .= '</div>';
        }
        if ($display == 'carousel' && $hide_carousel_arrows === '0' && $r->post_count > $post_per_row) {
            $output .= '<div class="dhvc-woo-carousel-arrows dhvc-woo-clearfix">';
            $output .= '<a href="#" class="dhvc-woo-carousel-prev"><i class="fa fa-chevron-left"></i></a>';
            $output .= '<a href="#" class="dhvc-woo-carousel-next"><i class="fa fa-chevron-right"></i></a>';
            $output .= '</div>';
        }
        if ($display != 'carousel' && $display != 'masonry') {
            if (empty($hide_result_count) || empty($hide_ordering_list)) {
                $output .= '<div class="dhvc-woo-row-fluid dhvc-woo-toolbar">';
                if (empty($hide_result_count)) {
                    ob_start();
                    dhvc_result_count($r);
                    $output .= ob_get_clean();
                }
                if (empty($hide_ordering_list)) {
                    ob_start();
                    dhvc_woo_orderby($orderby);
                    $output .= ob_get_clean();
                }
                $output .= '</div>';
            }
        }
        $output .= '<div class="dhvc-woo-row-fluid dhvc-woo-' . $display . '-list"' . ($display == 'masonry' ? ' data-masonry-gutter="' . absint($masonry_gutter) . '"' : '') . '' . ($display == 'carousel' ? ' data-items="' . absint($post_per_row) . '"' : '') . ($display == 'carousel' && !empty($show_carousel_pagination) ? ' data-pagination="true"' : '') . '>';
        if ($r->have_posts()) {
            $i = 0;
            while ($r->have_posts()) {
                $r->the_post();
                global $product, $post;
                $cats = get_the_terms($product->id, 'product_cat');
                $product_cats = array();
                if (!empty($cats)) {
                    foreach ($cats as $cat) {
                        $product_cats[] = 'dhvc-woo-cat-' . $cat->term_id;
                    }
                }
                if ($display == 'grid') {
                    if ($i++ % $post_per_row == 0) {
                        $output .= '<div class="dhvc-woo-row-fluid">';
                    }
                }
                $output .= '<div class="dhvc-woo-item';
                if ($display != 'carousel' && $display != 'list') {
                    $output .= ' dhvc-woo-span' . 12 / absint($post_per_row);
                }
                $output .= ' dhvc-woo-' . $display . '-item ' . implode(' ', $product_cats);
                $output .= '">';
                $output_image = '';
                if ($hide_thumbnail !== '0') {
                    $output_image .= '<div class="dhvc-woo-images">';
                    if (defined('YITH_WCWL')) {
                        $output_image .= do_shortcode('[yith_wcwl_add_to_wishlist]');
                    }
                    if ($show_sale_flash !== '0' && $product->is_on_sale()) {
                        ob_start();
                        woocommerce_show_product_loop_sale_flash();
                        $output_image .= ob_get_clean();
                    }
                    if (function_exists('dhwcpl_product_sale')) {
                        ob_start();
                        dhwcpl_product_sale();
                        dhwcpl_product_out_of_store();
                        dhwcpl_shop_loop_item();
                        $output_image .= ob_get_clean();
                    }
                    if (has_post_thumbnail()) {
                        $image_title = esc_attr(get_the_title(get_post_thumbnail_id()));
                        $image_link = esc_url(get_permalink());
                        $thumb_size = 'shop_catalog';
                        $thumbnail_image = get_the_post_thumbnail($post->ID, 'shop_catalog');
                        if (!empty($thumbnail_height) && !empty($thumbnail_width)) {
                            $thumb_size = $thumbnail_width . 'x' . $thumbnail_height;
                            $thumbnail_data = dhvc_woo_getImageBySize(array('post_id' => $product->id, 'thumb_size' => $thumb_size));
                            $thumbnail_image = $thumbnail_data['thumbnail'];
                        }
                        $output_image .= '<a href="' . $image_link . '" itemprop="image" title="' . $image_title . '" >' . $thumbnail_image . '</a>';
                    } else {
                        $output_image .= apply_filters('woocommerce_single_product_image_html', sprintf('<a href="%s" itemprop="image" title="%s"><img src="%s" alt="Placeholder" /></a>', esc_url(get_permalink()), $image_title, wc_placeholder_img_src()), $product->id);
                    }
                    $output_image .= '</div>';
                }
                $output .= apply_filters('dhvc_woo_images', $output_image, $product, $display);
                $output .= '<div class="dhvc-woo-info"';
                $image_config_size = absint($thumbnail_width);
                if (empty($image_config_size)) {
                    $shop_single_image_arr = wc_get_image_size('shop_single');
                    $image_config_size = $shop_single_image_arr['width'];
                }
                $image_config_size = $image_config_size + absint($thumbnail_border_width) + absint($thumbnail_border_width);
                if ($display == 'list') {
                    $output .= 'style="width: calc(100% - ' . $image_config_size . 'px);"';
                }
                $output .= '>';
                $output_title = '';
                if ($hide_title !== '0') {
                    $output_title .= '<h2 class="dhvc-woo-title dhvc-woo-clearfix">';
                    $output_title .= '<a href="' . get_permalink() . '">' . the_title('', '', false) . '</a>';
                    $output_title .= '</h2>';
                }
                $output .= apply_filters('dhvc_woo_title', $output_title, $product, $display);
                $output_excerpt = '';
                if (!empty($show_excerpt)) {
                    $output_excerpt .= '<div class="dhvc-woo-excerpt">';
                    $output_excerpt .= apply_filters('dhvc-woo-excerpt', wp_trim_words($post->post_excerpt, $excerpt_length), $post);
                    $output_excerpt .= '</div>';
                }
                $output .= apply_filters('dhvc_woo_excerpt', $output_excerpt, $product, $display);
                $output_rating = '';
                if ($show_rating !== '0') {
                    $output_rating .= '<div class="woocommerce dhvc-woo-rating dhvc-woo-clearfix">';
                    $rating = $product->get_average_rating();
                    $rating = absint($rating);
                    $rating_html = '<div class="star-rating" title="' . sprintf(__('Rated %s out of 5', 'woocommerce'), $rating) . '">';
                    $rating_html .= '<span style="width:' . $rating / 5 * 100 . '%"><strong class="rating">' . $rating . '</strong> ' . __('out of 5', 'woocommerce') . '</span>';
                    $rating_html .= '</div>';
                    $output_rating .= $rating_html;
                    $output_rating .= '</div>';
                }
                $output .= apply_filters('dhvc_woo_rating', $output_rating, $product, $display);
                $output .= '<div class="dhvc-woo-extra dhvc-woo-row-fluid">';
                if ($display == 'list') {
                    $output_price = '';
                    if ($hide_price !== '0') {
                        $output_price .= '<div class="dhvc-woo-price">';
                        $output_price .= $product->get_price_html();
                        $output_price .= '</div>';
                    }
                    $output .= apply_filters('dhvc_woo_price', $output_price, $product, $display);
                    $output_addtocart = '';
                    if ($hide_addtocart !== '0') {
                        $output_addtocart .= '<div class="dhvc-woo-addtocart">';
                        ob_start();
                        wc_get_template('loop/add-to-cart.php');
                        $add_to_cart = ob_get_clean();
                        $output_addtocart .= apply_filters('dhvc-woo-add-to-cart', $add_to_cart, $product);
                        $output_addtocart .= '</div>';
                    }
                    $output .= apply_filters('dhvc_woo_addtocart', $output_addtocart, $product, $display);
                } else {
                    //'add_cart_price_style'=>'2column',
                    if ($add_cart_price_style == '1column') {
                        $output_price = '';
                        if ($hide_price !== '0') {
                            $output_price .= '<div class="dhvc-woo-price dhvc-woo-span12">';
                            $output_price .= $product->get_price_html();
                            $output_price .= '</div>';
                        }
                        $output .= apply_filters('dhvc_woo_price', $output_price, $product, $display);
                        $output_addtocart = '';
                        if ($hide_addtocart !== '0') {
                            $output_addtocart .= '<div class="dhvc-woo-addtocart dhvc-woo-span12">';
                            ob_start();
                            wc_get_template('loop/add-to-cart.php');
                            $add_to_cart = ob_get_clean();
                            $output_addtocart .= apply_filters('dhvc-woo-add-to-cart', $add_to_cart, $product);
                            $output_addtocart .= '</div>';
                        }
                        $output .= apply_filters('dhvc_woo_addtocart', $output_addtocart, $product, $display);
                    } else {
                        $output_addtocart = '';
                        if ($hide_addtocart !== '0') {
                            $output_addtocart .= '<div class="dhvc-woo-addtocart dhvc-woo-span6">';
                            ob_start();
                            wc_get_template('loop/add-to-cart.php');
                            $add_to_cart = ob_get_clean();
                            $output_addtocart .= apply_filters('dhvc-woo-add-to-cart', $add_to_cart, $product);
                            $output_addtocart .= '</div>';
                        }
                        $output .= apply_filters('dhvc_woo_addtocart', $output_addtocart, $product, $display);
                        $output_price = '';
                        if ($hide_price !== '0') {
                            $output_price .= '<div class="dhvc-woo-price dhvc-woo-span6">';
                            $output_price .= $product->get_price_html();
                            $output_price .= '</div>';
                        }
                        $output .= apply_filters('dhvc_woo_price', $output_price, $product, $display);
                    }
                }
                $output .= '</div>';
                $output .= '</div>';
                $output .= '</div>';
                if ($display == 'grid') {
                    if ($i % $post_per_row == 0 || $i == $r->post_count) {
                        $output .= '</div>';
                        $output .= '<div class="dhvc-woo-separator"></div>';
                    }
                }
            }
        }
        $output .= '</div>';
        if (!empty($show_grid_pagination) && $display != 'carousel' && $display != 'masonry') {
            $pagination = dhvc_woo_pagination(array('echo' => false), $r);
            $output .= $pagination;
        }
        $output .= '</div>';
        wp_reset_postdata();
        wp_reset_query();
        return $output;
    }
Exemplo n.º 2
0
    $post_id = (int) $_GET['post'];
} elseif (isset($_POST['post_ID'])) {
    $post_id = (int) $_POST['post_ID'];
} elseif (isset($_POST['post_id'])) {
    $post_id = (int) $_POST['post_id'];
}
if (isset($_GET['post_type']) && $_GET['post_type'] === 'dhvcform' || get_post_type($post_id) === 'dhvcform' || dhvc_is_editor() && (isset($_GET['post_type']) && $_GET['post_type'] === 'dhvcform' || get_post_type($post_id) === 'dhvcform') || dhvc_is_inline() && (isset($_GET['post_type']) && $_GET['post_type'] === 'dhvcform' || get_post_type($post_id) === 'dhvcform') || dhvc_is_editable() && (isset($_GET['post_type']) && $_GET['post_type'] === 'dhvcform' || get_post_type($post_id) === 'dhvcform')) {
    if (function_exists('vc_disable_frontend')) {
        vc_disable_frontend();
    } else {
        if (class_exists('NewVisualComposer')) {
            NewVisualComposer::disableInline();
        }
    }
}
if (isset($_GET['page']) && ($_GET['page'] === 'vc_settings' || $_GET['page'] === 'wpb_vc_settings' || $_GET['page'] === 'vc-general') || isset($_GET['post_type']) && $_GET['post_type'] === 'dhvcform' || get_post_type($post_id) === 'dhvcform' || dhvc_is_editor() && (isset($_GET['post_type']) && $_GET['post_type'] === 'dhvcform' || get_post_type($post_id) === 'dhvcform') || !is_admin() || dhvc_is_inline() && (isset($_GET['post_type']) && $_GET['post_type'] === 'dhvcform' || get_post_type($post_id) === 'dhvcform') || dhvc_is_editable() && (isset($_GET['post_type']) && $_GET['post_type'] === 'dhvcform' || get_post_type($post_id) === 'dhvcform')) {
    vc_map(array("name" => __("DHVC Form", DHVC_FORM), "base" => "dhvc_form", 'show_settings_on_create' => false, 'content_element' => false));
    vc_map(array("name" => __("Form Text", DHVC_FORM), "base" => "dhvc_form_text", "category" => __("Form Control", DHVC_FORM), "icon" => "icon-dhvc-form-text", "params" => array(array("type" => "textfield", "heading" => __("Label", DHVC_FORM), "param_name" => "control_label", 'admin_label' => true), array("type" => "dhvc_form_name", "heading" => __("Name", DHVC_FORM), "param_name" => "control_name", 'admin_label' => true, "description" => __('Field name is required.  Please enter single word, no spaces. Underscores(_) allowed', DHVC_FORM)), array("type" => "textfield", "heading" => __("Default value", DHVC_FORM), "param_name" => "default_value"), array("type" => "textfield", "heading" => __("Maximum length characters", DHVC_FORM), "param_name" => "maxlength"), array("type" => "textfield", "heading" => __("Placeholder text", DHVC_FORM), "param_name" => "placeholder"), array("type" => "dropdown", "heading" => __("Icon", DHVC_FORM), "param_name" => "icon", "param_holder_class" => 'dhvc-form-font-awesome', "value" => dhvc_form_font_awesome(), 'description' => __('Select icon add-on for this control.', DHVC_FORM)), array("type" => "textarea", "heading" => __("Help text", DHVC_FORM), "param_name" => "help_text", 'description' => __('This is the help text for this form control.', DHVC_FORM)), array("type" => "checkbox", "heading" => __("Required ? ", DHVC_FORM), "param_name" => "required", "value" => array(__('Yes, please', DHVC_FORM) => '1')), array("type" => "dropdown", "heading" => __("Read only ? ", DHVC_FORM), "param_name" => "readonly", "value" => array(__('No', DHVC_FORM) => 'no', __('Yes', DHVC_FORM) => 'yes')), array("type" => "dhvc_form_validator", "heading" => __("Add validator", DHVC_FORM), "param_name" => "validator", "dependency" => array('element' => "readonly", 'value' => array('no'))), array("type" => "textfield", "heading" => __("Attributes", DHVC_FORM), "param_name" => "attributes", 'description' => __('Add attribute for this form control,eg: <em>onclick="" onchange="" </em> or \'<em>data-*</em>\'  attributes HTML5, not in attributes: <span style="color:#ff0000">type, value, name, required, placeholder, maxlength, id</span>', DHVC_FORM)), array('type' => 'textfield', 'heading' => __('Extra class name', DHVC_FORM), 'param_name' => 'el_class', 'description' => __('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', DHVC_FORM)))));
    vc_map(array("name" => __("Form Email", DHVC_FORM), "base" => "dhvc_form_email", "category" => __("Form Control", DHVC_FORM), "icon" => "icon-dhvc-form-email", "params" => array(array("type" => "textfield", "heading" => __("Label", DHVC_FORM), "param_name" => "control_label", 'admin_label' => true), array("type" => "dhvc_form_name", "heading" => __("Name", DHVC_FORM), "param_name" => "control_name", 'admin_label' => true, "description" => __('Field name is required.  Please enter single word, no spaces. Underscores(_) allowed', DHVC_FORM)), array("type" => "textfield", "heading" => __("Default value", DHVC_FORM), "param_name" => "default_value"), array("type" => "textfield", "heading" => __("Maximum length characters", DHVC_FORM), "param_name" => "maxlength"), array("type" => "textfield", "heading" => __("Placeholder text", DHVC_FORM), "param_name" => "placeholder"), array("type" => "dropdown", "heading" => __("Icon", DHVC_FORM), "param_name" => "icon", "param_holder_class" => 'dhvc-form-font-awesome', "value" => dhvc_form_font_awesome(), 'description' => __('Select icon add-on for this control.', DHVC_FORM)), array("type" => "textarea", "heading" => __("Help text", DHVC_FORM), "param_name" => "help_text", 'description' => __('This is the help text for this form control.', DHVC_FORM)), array("type" => "checkbox", "heading" => __("Required ? ", DHVC_FORM), "param_name" => "required", "value" => array(__('Yes, please', DHVC_FORM) => '1')), array("type" => "dropdown", "heading" => __("Read only ? ", DHVC_FORM), "param_name" => "readonly", "value" => array(__('No', DHVC_FORM) => 'no', __('Yes', DHVC_FORM) => 'yes')), array("type" => "textfield", "heading" => __("Attributes", DHVC_FORM), "param_name" => "attributes", 'description' => __('Add attribute for this form control,eg: <em>onclick="" onchange="" </em> or \'<em>data-*</em>\'  attributes HTML5, not in attributes: <span style="color:#ff0000">type, value, name, required, placeholder, maxlength, id</span>', DHVC_FORM)), array('type' => 'textfield', 'heading' => __('Extra class name', DHVC_FORM), 'param_name' => 'el_class', 'description' => __('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', DHVC_FORM)))));
    vc_map(array("name" => __("Form Label", DHVC_FORM), "base" => "dhvc_form_label", "category" => __("Form Control", DHVC_FORM), "icon" => "icon-dhvc-form-label", "params" => array(array("type" => "dhvc_form_name", "heading" => __("Name", DHVC_FORM), "param_name" => "control_name", 'admin_label' => true, "description" => __('Field name is required.  Please enter single word, no spaces. Underscores(_) allowed', DHVC_FORM)), array('type' => 'textarea_html', 'holder' => 'div', 'heading' => __('Text', DHVC_FORM), 'param_name' => 'content', 'value' => __('<p>I am text block. Click edit button to change this text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.</p>', DHVC_FORM)), array('type' => 'textfield', 'heading' => __('Extra class name', DHVC_FORM), 'param_name' => 'el_class', 'description' => __('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', DHVC_FORM)))));
    vc_map(array("name" => __("Form Slider", DHVC_FORM), "base" => "dhvc_form_slider", "category" => __("Form Control", DHVC_FORM), "icon" => "icon-dhvc-form-slider", "params" => array(array("type" => "dropdown", "heading" => __("Type", DHVC_FORM), "param_name" => "type", "value" => array(__('Slider', DHVC_FORM) => 'slider', __('Range', DHVC_FORM) => 'range'), 'admin_label' => true), array("type" => "textfield", "heading" => __("Label", DHVC_FORM), "param_name" => "control_label", 'admin_label' => true), array("type" => "dhvc_form_name", "heading" => __("Name", DHVC_FORM), "param_name" => "control_name", 'admin_label' => true, "description" => __('Field name is required.  Please enter single word, no spaces. Underscores(_) allowed', DHVC_FORM)), array("type" => "textfield", "heading" => __("Minimum Value", DHVC_FORM), "param_name" => "minimum_value", "value" => 0), array("type" => "textfield", "heading" => __("Maximum Value", DHVC_FORM), "param_name" => "maximum_value", "value" => 100), array("type" => "textfield", "heading" => __("Step", DHVC_FORM), "param_name" => "step", "value" => 5), array("type" => "textfield", "heading" => __("Default value", DHVC_FORM), "param_name" => "default_value"), array("type" => "textarea", "heading" => __("Help text", DHVC_FORM), "param_name" => "help_text", 'description' => __('This is the help text for this form control.', DHVC_FORM)), array("type" => "dhvc_form_conditional", "heading" => __("Conditional Logic", DHVC_FORM), "param_name" => "conditional", "dependency" => array('element' => "type", 'value' => array('slider')), 'description' => __('Create rules to show or hide this field depending on the values of other fields ', DHVC_FORM)), array('type' => 'textfield', 'heading' => __('Extra class name', DHVC_FORM), 'param_name' => 'el_class', 'description' => __('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', DHVC_FORM)))));
    vc_map(array("name" => __("Form Rate", DHVC_FORM), "base" => "dhvc_form_rate", "category" => __("Form Control", DHVC_FORM), "icon" => "icon-dhvc-form-rate", "params" => array(array("type" => "textfield", "heading" => __("Label", DHVC_FORM), "param_name" => "control_label", 'admin_label' => true), array("type" => "dhvc_form_name", "heading" => __("Name", DHVC_FORM), "param_name" => "control_name", 'admin_label' => true, "description" => __('Field name is required.  Please enter single word, no spaces. Underscores(_) allowed', DHVC_FORM)), array("type" => "dhvc_form_rate_option", "heading" => __("Options", DHVC_FORM), "param_name" => "rate_option"), array("type" => "textarea", "heading" => __("Help text", DHVC_FORM), "param_name" => "help_text", 'description' => __('This is the help text for this form control.', DHVC_FORM)), array("type" => "dhvc_form_conditional", "heading" => __("Conditional Logic", DHVC_FORM), "param_name" => "conditional", 'description' => __('Create rules to show or hide this field depending on the values of other fields ', DHVC_FORM)), array('type' => 'textfield', 'heading' => __('Extra class name', DHVC_FORM), 'param_name' => 'el_class', 'description' => __('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', DHVC_FORM)))));
    vc_map(array("name" => __("Form Hidden", DHVC_FORM), "base" => "dhvc_form_hidden", "category" => __("Form Control", DHVC_FORM), "icon" => "icon-dhvc-form-hidden", "params" => array(array("type" => "dhvc_form_name", "heading" => __("Name", DHVC_FORM), "param_name" => "control_name", 'admin_label' => true, "description" => __('Field name is required.  Please enter single word, no spaces. Underscores(_) allowed', DHVC_FORM)), array("type" => "textfield", "heading" => __("Default value", DHVC_FORM), "param_name" => "default_value"))));
    vc_map(array("name" => __("Form Captcha", DHVC_FORM), "base" => "dhvc_form_captcha", "category" => __("Form Control", DHVC_FORM), "icon" => "icon-dhvc-form-captcha", "params" => array(array("type" => "textfield", "heading" => __("Label", DHVC_FORM), "param_name" => "control_label", 'admin_label' => true), array("type" => "dhvc_form_name", "heading" => __("Name", DHVC_FORM), "param_name" => "control_name", 'admin_label' => true, "description" => __('Field name is required.  Please enter single word, no spaces. Underscores(_) allowed', DHVC_FORM)), array("type" => "textfield", "heading" => __("Placeholder text", DHVC_FORM), "param_name" => "placeholder"), array("type" => "textarea", "heading" => __("Help text", DHVC_FORM), "param_name" => "help_text", 'description' => __('This is the help text for this form control.', DHVC_FORM)), array('type' => 'textfield', 'heading' => __('Extra class name', DHVC_FORM), 'param_name' => 'el_class', 'description' => __('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', DHVC_FORM)))));
    vc_map(array("name" => __("Form reCaptcha", DHVC_FORM), "base" => "dhvc_form_recaptcha", "category" => __("Form Control", DHVC_FORM), "icon" => "icon-dhvc-form-recaptcha", "params" => array(array("type" => "dropdown", "heading" => __("reCaptcha Version", DHVC_FORM), "param_name" => "captcha_type", 'std' => '2', "value" => array(__('Version 1', DHVC_FORM) => '1', __('Version 2', DHVC_FORM) => '2'), 'description' => __('Select reCaptcha version you want use.', DHVC_FORM)), array("type" => "dropdown", "heading" => __("Theme", DHVC_FORM), "param_name" => "theme", "value" => array(__('Red', DHVC_FORM) => 'red', __('Clean', DHVC_FORM) => 'clean', __('White', DHVC_FORM) => 'white', __('BlackGlass', DHVC_FORM) => 'blackglass'), "dependency" => array('element' => "captcha_type", 'value' => array('1')), 'description' => __('Defines which theme to use for reCAPTCHA.', DHVC_FORM)), array("type" => "dropdown", "heading" => __("Language", DHVC_FORM), "param_name" => "language", "dependency" => array('element' => "captcha_type", 'value' => array('1')), "value" => dhvc_form_get_recaptcha_lang(), 'description' => __('Select the language you would like to use for the reCAPTCHA display from the available options.', DHVC_FORM)), array("type" => "textfield", "heading" => __("Label", DHVC_FORM), "param_name" => "control_label", 'admin_label' => true), array("type" => "dhvc_form_name", "heading" => __("Name", DHVC_FORM), "param_name" => "control_name", 'admin_label' => true, "description" => __('Field name is required.  Please enter single word, no spaces. Underscores(_) allowed', DHVC_FORM)), array("type" => "textarea", "heading" => __("Help text", DHVC_FORM), "param_name" => "help_text", 'description' => __('This is the help text for this form control.', DHVC_FORM)), array('type' => 'textfield', 'heading' => __('Extra class name', DHVC_FORM), 'param_name' => 'el_class', 'description' => __('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', DHVC_FORM)))));
    vc_map(array("name" => __("Form DateTime", DHVC_FORM), "base" => "dhvc_form_datetime", "category" => __("Form Control", DHVC_FORM), "icon" => "icon-dhvc-form-datetime", "params" => array(array("type" => "dropdown", "heading" => __("Type", DHVC_FORM), "param_name" => "type", 'admin_label' => true, "value" => array(__('Date', DHVC_FORM) => 'date', __('Time', DHVC_FORM) => 'time')), array("type" => "textfield", "heading" => __("Label", DHVC_FORM), "param_name" => "control_label", 'admin_label' => true), array("type" => "dhvc_form_name", "heading" => __("Name", DHVC_FORM), "param_name" => "control_name", 'admin_label' => true, "description" => __('Field name is required.  Please enter single word, no spaces. Underscores(_) allowed', DHVC_FORM)), array("type" => "textfield", "heading" => __("Maximum length characters", DHVC_FORM), "param_name" => "maxlength"), array("type" => "textfield", "heading" => __("Placeholder text", DHVC_FORM), "param_name" => "placeholder"), array("type" => "textarea", "heading" => __("Help text", DHVC_FORM), "param_name" => "help_text", 'description' => __('This is the help text for this form control.', DHVC_FORM)), array("type" => "checkbox", "heading" => __("Required ? ", DHVC_FORM), "param_name" => "required", "value" => array(__('Yes, please', DHVC_FORM) => '1')), array("type" => "checkbox", "heading" => __("Read only ? ", DHVC_FORM), "param_name" => "readonly", "value" => array(__('Yes, please', DHVC_FORM) => '1')), array("type" => "textfield", "heading" => __("Attributes", DHVC_FORM), "param_name" => "attributes", 'description' => __('Add attribute for this form control,eg: <em>onclick="" onchange="" </em> or \'<em>data-*</em>\'  attributes HTML5, not in attributes: <span style="color:#ff0000">type, value, name, required, placeholder, maxlength, id</span>', DHVC_FORM)), array('type' => 'textfield', 'heading' => __('Extra class name', DHVC_FORM), 'param_name' => 'el_class', 'description' => __('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', DHVC_FORM)))));
    vc_map(array("name" => __("Form Color", DHVC_FORM), "base" => "dhvc_form_color", "category" => __("Form Control", DHVC_FORM), "icon" => "icon-dhvc-form-color", "params" => array(array("type" => "textfield", "heading" => __("Label", DHVC_FORM), "param_name" => "control_label", 'admin_label' => true), array("type" => "dhvc_form_name", "heading" => __("Name", DHVC_FORM), "param_name" => "control_name", 'admin_label' => true, "description" => __('Field name is required.  Please enter single word, no spaces. Underscores(_) allowed', DHVC_FORM)), array("type" => "colorpicker", "heading" => __("Default value", DHVC_FORM), "param_name" => "default_value"), array("type" => "textfield", "heading" => __("Placeholder text", DHVC_FORM), "param_name" => "placeholder"), array("type" => "textarea", "heading" => __("Help text", DHVC_FORM), "param_name" => "help_text", 'description' => __('This is the help text for this form control.', DHVC_FORM)), array("type" => "checkbox", "heading" => __("Required ? ", DHVC_FORM), "param_name" => "required", "value" => array(__('Yes, please', DHVC_FORM) => '1')), array("type" => "checkbox", "heading" => __("Read only ? ", DHVC_FORM), "param_name" => "readonly", "value" => array(__('Yes, please', DHVC_FORM) => '1')), array("type" => "textfield", "heading" => __("Attributes", DHVC_FORM), "param_name" => "attributes", 'description' => __('Add attribute for this form control,eg: <em>onclick="" onchange="" </em> or \'<em>data-*</em>\'  attributes HTML5, not in attributes: <span style="color:#ff0000">type, value, name, required, placeholder, maxlength, id</span>', DHVC_FORM)), array('type' => 'textfield', 'heading' => __('Extra class name', DHVC_FORM), 'param_name' => 'el_class', 'description' => __('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', DHVC_FORM)))));
    vc_map(array("name" => __("Form Password", DHVC_FORM), "base" => "dhvc_form_password", "category" => __("Form Control", DHVC_FORM), "icon" => "icon-dhvc-form-password", "params" => array(array("type" => "textfield", "heading" => __("Label", DHVC_FORM), "param_name" => "control_label", 'admin_label' => true), array("type" => "dhvc_form_name", "heading" => __("Name", DHVC_FORM), "param_name" => "control_name", 'admin_label' => true, "description" => __('Field name is required.  Please enter single word, no spaces. Underscores(_) allowed', DHVC_FORM)), array("type" => "checkbox", "heading" => __("Is confirmation ? ", DHVC_FORM), "param_name" => "confirmation", "value" => array(__('Yes, please', DHVC_FORM) => '1')), array("type" => "textfield", "heading" => __("Password field ", DHVC_FORM), "param_name" => "password_field", "dependency" => array('element' => "confirmation", 'not_empty' => true), 'description' => __('enter passwords field name to validate match', DHVC_FORM)), array("type" => "textfield", "heading" => __("Placeholder text", DHVC_FORM), "param_name" => "placeholder"), array("type" => "dropdown", "heading" => __("Icon", DHVC_FORM), "param_name" => "icon", "param_holder_class" => 'dhvc-form-font-awesome', "value" => dhvc_form_font_awesome(), 'description' => __('Select icon add-on for this control.', DHVC_FORM)), array("type" => "textarea", "heading" => __("Help text", DHVC_FORM), "param_name" => "help_text", 'description' => __('This is the help text for this form control.', DHVC_FORM)), array("type" => "checkbox", "heading" => __("Required ? ", DHVC_FORM), "param_name" => "required", "value" => array(__('Yes, please', DHVC_FORM) => '1')), array("type" => "checkbox", "heading" => __("Read only ? ", DHVC_FORM), "param_name" => "readonly", "value" => array(__('Yes, please', DHVC_FORM) => '1')), array("type" => "checkbox", "heading" => __("Password validator ? ", DHVC_FORM), "param_name" => "validator", "value" => array(__('Yes, please', DHVC_FORM) => '1')), array("type" => "textfield", "heading" => __("Attributes", DHVC_FORM), "param_name" => "attributes", 'description' => __('Add attribute for this form control,eg: <em>onclick="" onchange="" </em> or \'<em>data-*</em>\'  attributes HTML5, not in attributes: <span style="color:#ff0000">type, value, name, required, placeholder, maxlength, id</span>', DHVC_FORM)), array('type' => 'textfield', 'heading' => __('Extra class name', DHVC_FORM), 'param_name' => 'el_class', 'description' => __('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', DHVC_FORM)))));
    vc_map(array("name" => __("Form Radio", DHVC_FORM), "base" => "dhvc_form_radio", "category" => __("Form Control", DHVC_FORM), "icon" => "icon-dhvc-form-radio", "params" => array(array("type" => "textfield", "heading" => __("Label", DHVC_FORM), "param_name" => "control_label", 'admin_label' => true), array("type" => "dhvc_form_name", "heading" => __("Name", DHVC_FORM), "param_name" => "control_name", 'admin_label' => true, "description" => __('Field name is required.  Please enter single word, no spaces. Underscores(_) allowed', DHVC_FORM)), array("type" => "dhvc_form_option", "heading" => __("Options", DHVC_FORM), "param_name" => "options"), array("type" => "textarea", "heading" => __("Help text", DHVC_FORM), "param_name" => "help_text", 'description' => __('This is the help text for this form control.', DHVC_FORM)), array("type" => "checkbox", "heading" => __("Required ? ", DHVC_FORM), "param_name" => "required", "value" => array(__('Yes, please', DHVC_FORM) => '1')), array("type" => "checkbox", "heading" => __("Disabled ? ", DHVC_FORM), "param_name" => "disabled", "value" => array(__('Yes, please', DHVC_FORM) => '1')), array("type" => "dhvc_form_conditional", "heading" => __("Conditional Logic", DHVC_FORM), "param_name" => "conditional", 'description' => __('Create rules to show or hide this field depending on the values of other fields ', DHVC_FORM)), array('type' => 'textfield', 'heading' => __('Extra class name', DHVC_FORM), 'param_name' => 'el_class', 'description' => __('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', DHVC_FORM)))));
    vc_map(array("name" => __("Form File", DHVC_FORM), "base" => "dhvc_form_file", "category" => __("Form Control", DHVC_FORM), "icon" => "icon-dhvc-form-file", "params" => array(array("type" => "textfield", "heading" => __("Label", DHVC_FORM), "param_name" => "control_label", 'admin_label' => true), array("type" => "dhvc_form_name", "heading" => __("Name", DHVC_FORM), "param_name" => "control_name", 'admin_label' => true, "description" => __('Field name is required.  Please enter single word, no spaces. Underscores(_) allowed', DHVC_FORM)), array("type" => "textarea", "heading" => __("Help text", DHVC_FORM), "param_name" => "help_text", 'description' => __('This is the help text for this form control.', DHVC_FORM)), array("type" => "checkbox", "heading" => __("Required ? ", DHVC_FORM), "param_name" => "required", "value" => array(__('Yes, please', DHVC_FORM) => '1')), array("type" => "textfield", "heading" => __("Attributes", DHVC_FORM), "param_name" => "attributes", 'description' => __('Add attribute for this form control,eg: <em>onclick="" onchange="" </em> or \'<em>data-*</em>\'  attributes HTML5, not in attributes: <span style="color:#ff0000">type, value, name, required, placeholder, maxlength, id</span>', DHVC_FORM)), array('type' => 'textfield', 'heading' => __('Extra class name', DHVC_FORM), 'param_name' => 'el_class', 'description' => __('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', DHVC_FORM)))));
    vc_map(array("name" => __("Form Checkboxes", DHVC_FORM), "base" => "dhvc_form_checkbox", "category" => __("Form Control", DHVC_FORM), "icon" => "icon-dhvc-form-checkbox", "params" => array(array("type" => "textfield", "heading" => __("Label", DHVC_FORM), "param_name" => "control_label", 'admin_label' => true), array("type" => "dhvc_form_name", "heading" => __("Name", DHVC_FORM), "param_name" => "control_name", 'admin_label' => true, "description" => __('Field name is required.  Please enter single word, no spaces. Underscores(_) allowed', DHVC_FORM)), array("type" => "dhvc_form_option", "heading" => __("Options", DHVC_FORM), "param_name" => "options", 'option_checkbox' => true), array("type" => "textarea", "heading" => __("Help text", DHVC_FORM), "param_name" => "help_text", 'description' => __('This is the help text for this form control.', DHVC_FORM)), array("type" => "checkbox", "heading" => __("Required ? ", DHVC_FORM), "param_name" => "required", "value" => array(__('Yes, please', DHVC_FORM) => '1')), array("type" => "checkbox", "heading" => __("Disabled ? ", DHVC_FORM), "param_name" => "disabled", "value" => array(__('Yes, please', DHVC_FORM) => '1')), array("type" => "dhvc_form_conditional", "heading" => __("Conditional Logic", DHVC_FORM), "param_name" => "conditional", 'description' => __('Create rules to show or hide this field depending on the values of other fields ', DHVC_FORM)), array('type' => 'textfield', 'heading' => __('Extra class name', DHVC_FORM), 'param_name' => 'el_class', 'description' => __('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', DHVC_FORM)))));