"Advanced Woo Products Sliders", "category" => 'Advanced Elements', "description" => "Products Are On Move", "base" => "awavc_woo_slider", "class" => "", "icon" => "woo-product-slider-icon", "params" => array( array( "type" => "dropdown", "holder" => "", "class" => "", "heading" => __("Product Layout Style", "awavcl"), "param_name" => "woo_style", "value" => array( "Style 1" => 'product-item-1', "Style 2" => 'product-item-2', "Style 3" => 'product-item-3', "Style 4" => 'product-item-4', "Style 5" => 'product-item-5', "Style 6" => 'product-item-6', "Style 7" => 'product-item-7', "Style 8" => 'product-item-8', "Style 9" => 'product-item-9', "Style 10" => 'product-item-10', "Style 11" => 'product-item-11', "Style 12" => 'product-item-12', "Style 13" => 'product-item-13', ), "description" => __("custom image height for product image", "awavcl"), "group" => __( "Image Size", "awavcl" ), 'admin_label' => true, ), array( "type" => "textfield", "heading" => __( "Number Of Products", "awavcl" ), "param_name" => "products", 'value' => '', 'admin_label' => true, ), array( "type" => "textfield", "heading" => __( "Products Category Slug", "awavcl" ), "param_name" => "categories_id", 'admin_label' => true, 'value' => '', "description" => __("Type products category slug to get specific category products into carousel. Leave empty for all categories products", "awavcl") ), array( "type" => "textfield", "heading" => __( "Product Tag", "awavcl" ), "param_name" => "tag", 'value' => 'New', "description" => __("If you dont want to show any tag mark then leave it blank.", "awavcl") ), array( "type" => "dropdown", "holder" => "", "class" => "", "heading" => __("Show Rating", "awavcl"), "param_name" => "rating_enable", "value" => array( "Yes" => 'yes', "No" => 'no', ), ), array( "type" => "dropdown", "holder" => "", "class" => "", "heading" => __("Custom Image Height", "awavcl"), "param_name" => "image_size", "value" => array( "No" => 'no', "Yes" => 'yes', ), "description" => __("custom image height for product image", "awavcl"), "group" => __( "Image Size", "awavcl" ), ), array( "type" => "dropdown", "holder" => "", "class" => "", "heading" => __("Column", "awavcl"), "param_name" => "col_num", "value" => array( "1 Col" => '1', "2 Col" => '2', "3 Col" => '3', "4 Col" => '4', "5 Col" => '5', "6 Col" => '6', ), "description" => __("custom image height for product image", "awavcl"), "group" => __( "Image Size", "awavcl" ), ), array( "type" => "dropdown", "holder" => "", "class" => "", "heading" => __("Column In Tablet", "awavcl"), "param_name" => "col_num_tab", "value" => array( "1 Col" => '1', "2 Col" => '2', "3 Col" => '3', ), "description" => __("custom image height for product image", "awavcl"), "group" => __( "Image Size", "awavcl" ), ), array( "type" => "dropdown", "holder" => "", "class" => "", "heading" => __("Column In Mobile", "awavcl"), "param_name" => "col_num_mob", "value" => array( "1 Col" => '1', "2 Col" => '2', "3 Col" => '3', ), "description" => __("custom image height for product image", "awavcl"), "group" => __( "Image Size", "awavcl" ), ), array( 'type' => 'prime_slider', 'heading' => __( 'Image Height', 'awavcl' ), 'param_name' => 'image_height', "value" => 260, "min" => 5, "max" => 500, "step" => 1, "unit" => "px", "dependency" => Array('element' => "image_size", 'value' => 'yes'), "group" => __( "Image Size", "awavcl" ), ), array( 'type' => 'prime_slider', 'heading' => __( 'Padding Bottom', 'awavcl' ), 'param_name' => 'pd_btm', "value" => 40, "min" => 5, "max" => 100, "step" => 1, "unit" => "px", "group" => __( "Settings", "awavcl" ), ), array( 'type' => 'prime_slider', 'heading' => __( 'Title Font Size', 'awavcl' ), 'param_name' => 'ttl_size', "value" => 18, "min" => 5, "max" => 100, "step" => 1, "unit" => "px", "group" => __( "Settings", "awavcl" ), ), array( 'type' => 'prime_slider', 'heading' => __( 'Sale Price Font Size', 'awavcl' ), 'param_name' => 'price_size', "value" => 20, "min" => 5, "max" => 100, "step" => 1, "unit" => "px", "group" => __( "Settings", "awavcl" ), ), array( 'type' => 'prime_slider', 'heading' => __( 'Regular Price Font Size', 'awavcl' ), 'param_name' => 'del_price_size', "value" => 15, "min" => 5, "max" => 100, "step" => 1, "unit" => "px", "group" => __( "Settings", "awavcl" ), "description" => __("Make it less then sale price font size would be better view", "awavcl") ), array( "type" => "dropdown", "holder" => "", "class" => "", "heading" => __("Nav Type", "awavcl"), "param_name" => "nav_type", "value" => array( "Both: Nav+Button" => 'nav_btn', "Only Nav" => 'nav', "Only Button" => 'btn', ), "group" => __( "NAV", "awavcl" ), ), array( 'type' => 'prime_slider', 'heading' => __( 'Navigator Angle Size', 'awavcl' ), 'param_name' => 'nav_size', "value" => 50, "min" => 5, "max" => 100, "step" => 1, "unit" => "px", "group" => __( "NAV", "awavcl" ), "description" => __("", "awavcl") ), array( "type" => "colorpicker", "heading" => __("Nav Color", 'awavcl'), "param_name" => "nav_clr", "value" => "", "group" => __( "NAV", "awavcl" ), ), array( "type" => "colorpicker", "heading" => __("Title Color", 'awavcl'), "param_name" => "ttl_clr", "value" => "", "group" => __("Colors", 'awavcl'), ), array( "type" => "colorpicker", "heading" => __("Price Color", 'awavcl'), "param_name" => "price_clr", "value" => "", "group" => __("Colors", 'awavcl'), ), array( "type" => "colorpicker", "heading" => __("Tag Text Color", 'awavcl'), "param_name" => "tag_txt_clr", "value" => "", "group" => __("Colors", 'awavcl'), ), array( "type" => "colorpicker", "heading" => __("Tag Background Color", 'awavcl'), "param_name" => "tag_bg", "value" => "", "group" => __("Colors", 'awavcl'), "dependency" => array( 'element' => "woo_style", 'value' => array('product-item-6','product-item-7','product-item-8','product-item-9','product-item-10','product-item-11','product-item-12','product-item-13') ), ), array( "type" => "colorpicker", "heading" => __("Color On Hover", 'awavcl'), "param_name" => "hvr_clr", "value" => "", "group" => __("Colors", 'awavcl'), ), array( "type" => "colorpicker", "heading" => __("Add to Cart Text Color", 'awavcl'), "param_name" => "cart_txt_clr", "value" => "", "group" => __("Colors", 'awavcl'), "dependency" => array( 'element' => "woo_style", 'value' => array('product-item-3','product-item-6','product-item-8','product-item-10','product-item-11','product-item-12','product-item-13') ), ), array( "type" => "colorpicker", "heading" => __("Add to Cart Background", 'awavcl'), "param_name" => "cart_bg", "value" => "", "group" => __("Colors", 'awavcl'), "dependency" => array( 'element' => "woo_style", 'value' => array('product-item-3','product-item-6','product-item-8','product-item-10','product-item-11','product-item-12','product-item-13',) ), ), array( "type" => "textfield", "heading" => __("Extra class name", "awavcl"), "param_name" => "extraclass", "value" => "", "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.", "awavcl") ), ) )); function awavc_woo_slider_shortcode($atts, $content = null) { extract(shortcode_atts(array( 'woo_style' => 'product-item-1', 'css_animation' => '', 'image_size' => '', 'image_height' => '300', 'products' => '-1', 'pd_btm' => '50', 'tag' => 'Sale', 'col_num' => '4', 'col_num_tab' => '2', 'col_num_mob' => '1', 'categories_id' => 'all', 'items' => '6', 'ttl_size' => '', 'price_size' => '', 'del_price_size' => '', 'ttl_clr' => '', 'price_clr' => '', 'hvr_clr' => '', 'cart_txt_clr' => '', 'cart_bg' => '', 'nav_type' => '', 'nav_size' => '', 'nav_clr' => '', 'tag_txt_clr' => '', 'tag_bg' => '', 'rating_enable' => 'yes', 'extraclass' => '', ), $atts)); wp_register_style( 'blog-style', plugins_url( '/css/woo-products.css', __FILE__) ); wp_enqueue_style( 'blog-style' ); wp_register_style( 'awavcl.owl.carousel', plugins_url( '/css/owl.carousel.css', __FILE__) ); wp_enqueue_style( 'awavcl.owl.carousel' ); wp_register_style( 'awavcl.owl.transitions', plugins_url( '/css/owl.transitions.css', __FILE__) ); wp_enqueue_style( 'awavcl.owl.transitions' ); wp_register_style( 'awavcl.owl.theme', plugins_url( '/css/owl.theme.css', __FILE__) ); wp_enqueue_style( 'awavcl.owl.theme' ); wp_register_script('adv.owl.carousel.min', plugins_url('/js/owl.carousel.min.js', __FILE__), array('jquery')); wp_enqueue_script('adv.owl.carousel.min'); wp_register_script('awavc-woo.x', plugins_url('/js/woo-js.js', __FILE__), array('jquery')); wp_enqueue_script('awavc-woo.x'); //$image_url = wp_get_attachment_url( $image, 'full' ); //$image = aq_resize( $image_url, 296, 289, false ); //resize & crop the image //var_dump($image); $slide = rand(99,99999); $html = ''; $ratting = ''; global $post; static $product_slider_id = 1; global $wp; $current_url = home_url(add_query_arg(array(),$wp->request)); $query_args = array( 'post_type' => 'product', 'post_status' => 'publish', 'posts_per_page' => $products, 'orderby' => 'date', 'order' => 'DESC', ); if( $categories_id != 'all' ) { $query_args['tax_query'] = array( array( 'taxonomy' => 'product_cat', 'field' => 'slug', 'terms' => $categories_id ) ); } $latest_product_query = new WP_Query( $query_args ); $html .= ' '; } return $html; } add_shortcode("awavc_woo_slider", "awavc_woo_slider_shortcode");