?> <?php if (isset($custom_item_fields['category'])) { ?> <div class="woo-product-category"><?php echo $cat; ?> </div> <?php } ?> <?php if (isset($custom_item_fields['star'])) { ?> <?php echo '<div class="woo-starcnt">' . pw_woo_ad_search_rating_grid($my_query->post->ID) . '</div>'; ?> <?php } ?> <?php if (isset($custom_item_fields['excerpt'])) { ?> <div class="woo-product-desc"><?php echo $pw_woo_ad_main_class->excerpt(get_the_excerpt(), $pw_woo_ad_main_class->check_isset(__PW_WOO_AD_SEARCH_FIELDS_PERFIX__ . 'excerpt_len', 'custom_field', '10')); ?> </div> <?php } ?>
function pw_woo_ad_sesarch_quickview() { global $wpdb, $pw_woo_ad_main_class, $post, $woocommerce; $product_id = $_POST['post_id']; $id = $_POST['post_id']; $product = get_product($product_id); $title = $product->get_title(); $excerpt = $product->post->post_excerpt; $postd = get_post($id); // echo $excerpt.'<br/>'; // echo $id.'<br/>'; //print_r($post); // $postd->post_excerpt; // echo '<br/>'.$postd->post_excerpt; $thumbnail_id = $product->get_image_id(); $src_featured = wp_get_attachment_image($thumbnail_id, 'thumbnail'); //Featured Image with size $img = $product->get_image(); //Featured Image $permalink = $product->get_permalink(); $add_to_cart_url = $product->add_to_cart_url(); $regular_price = $product->get_regular_price(); $sale_price = $product->get_sale_price(); $price = $product->get_price_html(); //$rating = $product->get_rating_html(); $rating = pw_woo_ad_search_rating_grid($id); $cat = $product->get_categories(); $tag = $product->get_tags(); $sku = $product->get_sku(); $stock_status = $product->is_in_stock(); //1 : in ,0 :out $stock_quantity = $product->get_stock_quantity(); $featured = $product->is_featured(); $on_sale = $product->is_on_sale(); // 1:0 $thumb_index = 0; $product_thumb = $product_slide = ''; $img_url = array(); $img_url_default = ''; if ($product->get_image_id() != NULL) { $img_url = wp_get_attachment_image_src($product->get_image_id(), 'large'); $img_url_thumb = wp_get_attachment_image_src($product->get_image_id(), 'thumbnail'); $product_slide .= '<li><img src="' . $img_url[0] . '" ></li>'; $product_thumb .= '<a data-slide-index="' . $thumb_index++ . '" href=""><img src="' . $img_url_thumb[0] . '" /></a>'; } $this_product_gallery = $product->get_gallery_attachment_ids(); if ($this_product_gallery != NULL) { foreach ($this_product_gallery as $this_image) { $img_url = wp_get_attachment_image_src($this_image, 'large'); $img_url_thumb = wp_get_attachment_image_src($this_image, 'thumbnail'); $product_slide .= '<li><img src="' . $img_url[0] . '" ></li>'; $product_thumb .= '<a data-slide-index="' . $thumb_index++ . '" href=""><img src="' . $img_url_thumb[0] . '" /></a>'; } } if ($product->get_image_id() == NULL && $this_product_gallery == NULL) { $img_url_default = wc_placeholder_img_src(); } $add_to_cart_btn = ''; $add_to_cart_label = pw_woo_ad_search_add_to_cart_grid('label', $id); if ($product->is_type('simple')) { $add_to_cart_btn = "<div class='woo-addcard-btn back-btn'><a href='" . $product->add_to_cart_url() . "' data-quantity='1' data-product_sku='" . $product->get_sku() . "' data-product_id={$id} rel='nofollow' ><span>" . $add_to_cart_label . "</span></a></div>"; } else { $add_to_cart_btn = "<div class='woo-addcard-btn back-btn'><a href='" . $product->add_to_cart_url() . "' data-quantity='1' data-product_sku='" . $product->get_sku() . "' data-product_id={$id} rel='nofollow' ><span>" . $add_to_cart_label . "</span></a></div>"; } echo '<div class="woo-row">'; echo '<div class="woo-col-md-7 woo-quick-image-cnt"> <ul id="woo-quick-car" class="woo-quick-car woo-bxslider woo-single-car woo-carousel-layout">' . $product_slide . '</ul> <div id="woo-pager" class="woo-pager"> ' . $product_thumb . ' </div> </div>'; echo '<div class="woo-col-md-5"> <div class="woo-quick-detail-cnt">'; echo '<h3 class="woo-quick-title"><a href="' . $permalink . '" >' . $title . '</a></h3>'; echo '<div class="woo-quick-rating">' . $rating . '</div>'; echo '<div class="woo-quick-price"><span class="woo-quick-sale-price">' . $price . '</div>'; echo '<div class="woo-quick-excerpt">' . $excerpt . '</div>'; print_r('<div class="woo-quick-cat">' . $cat . '</div>'); print_r('<div class="woo-quick-tag">' . $tag . '</div>'); echo '<div class="woo-quick-add add_to_cart_button product_type_simple add-to-cart" data-product_id="' . $id . '" data-quantity="1">' . $add_to_cart_btn . '</div>'; echo ' </div> </div>'; echo '</div>'; exit(0); }
if (isset($custom_item_fields['excerpt'])) { ?> <div class="woo-product-desc"><?php echo $pw_woo_ad_main_class->excerpt(get_the_excerpt(), $pw_woo_ad_main_class->check_isset(__PW_WOO_AD_SEARCH_FIELDS_PERFIX__ . 'excerpt_len', 'custom_field', '10')); ?> </div> <?php } ?> <?php if (isset($custom_item_fields['price'])) { ?> <?php echo '<span class="woo-product-price">' . $price . '</span>'; ?> <?php } ?> <?php if (isset($custom_item_fields['star'])) { ?> <?php echo pw_woo_ad_search_rating_grid($my_query->post->ID); ?> <?php } ?> </div> </div> </div>