Ajax Search Form

jQuery(document).ready(function() {jQuery jQuery('#schoolword').on('input', function() { var searchKeyword = jQuery(this).val(); var searchType = jQuery('#searchby').val(); if (searchKeyword.length >= 3) { jQuery.post('/includes/schoolsearch-ajax.php', { keywords: searchKeyword,searchtype: searchType }, function(data) { jQuery('ul#schoollist').empty() jQuery.each(data, function() {jQuery('ul#schoollist').append('<li>//<a href="//'+this.link+'">' + this.t//itle + '</a></li//>');   '); }); }, 'json'); } }); }); Search Form " value="" name="s" /> ajax-search.php <?php require_once('../../../wp-load.php'); global $wpdb; if... Continue Reading →

Woocommerce Category Image show

add_action( 'woocommerce_archive_description', 'woocommerce_category_image', 2 ); function woocommerce_category_image() { if ( is_product_category() ){ global $wp_query; $cat = $wp_query->get_queried_object(); $thumbnail_id = get_woocommerce_term_meta( $cat->term_id, 'thumbnail_id', true ); $image = wp_get_attachment_url( $thumbnail_id ); if ( $image ) { echo '////////</div>'; } } } function category_has_children() { if ( is_product_category() ){ global $wp_query; $cat = $wp_query->get_queried_object(); $children = get_categories( array(... Continue Reading →

Woocommerce Product Thumbanail size

function wptt_single_image_size( $size ){ $size['width'] = '360'; $size['height'] = '412'; return $size; } // wptt_single_image_size add_filter( 'woocommerce_get_image_size_shop_single', 'wptt_single_image_size' ); remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_upsell_display', 15);

Woocommerce Add New Hook With Function

function my_title_wrapper_start() { echo '<section class="mdlcontaner"> '; } function my_title_wrapper_end() { echo '</section>'; } add_action('woocommerce_before_main_content', 'my_title_wrapper_start', 10); add_action('woocommerce_after_main_content', 'my_title_wrapper_end', 10);

jQuery-php-ajax Calling

jQuery(document).ready(function(){ jQuery('#pfilter li').css('cursor', 'pointer'); jQuery("#pfilter li").click(function(){ jQuery('#spinner').show(); jQuery('#spinner').html('/images/oudarya2.GIF" alt="Loading..."/>'); var slug = jQuery(this).attr('id'); jQuery.ajax({ url: "/filter-product.php", type: 'POST', data: 'slg=' +slug, success: function(data) { jQuery('#spinner').hide(); jQuery("#prd").html(data); } }); }); }); In HTML : <?php $level = get_queried_object()->term_id; //echo $level; $parent_id = $level; $termchildren = get_terms('product_cat',array('child_of' => $parent_id)); echo '<ul id="pfilter" class="sidemenu">'; foreach($termchildren as $sub_category) {... Continue Reading →

Woocommerce Featured Products

<h2 class="head">Featured Products</h2> <?php $args = array( 'post_type' => 'product', 'meta_key' => '_featured', 'meta_value' => 'yes', 'posts_per_page' => 3 ); $loop = new WP_Query( $args ); if ( $loop->have_posts() ) { //$i=0; while ( $loop->have_posts() ) : $loop->the_post(); /* print_r($loop->post); echo $loop->post->ID; exit; */ $thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id($loop->post->ID, array(400,300) )); $price = get_post_meta( $loop->post->ID, '_regular_price', true);... Continue Reading →

Woocommerce Top Rated Products

<h2 class="head">Top Rated Products</h2> <?php global $woocommerce_loop; $meta_query = WC()->query->get_meta_query(); //print_r($meta_query); $args = array( 'post_type' => 'product', 'post_status' => 'publish', 'ignore_sticky_posts' => 1, 'orderby' => 'title', 'posts_per_page' => '3', 'meta_query' => $meta_query ); $loop = new WP_Query( $args ); if ( $loop->have_posts() ) { //$i=0; while ( $loop->have_posts() ) : $loop->the_post(); //print_r($loop->post); global $product; $thumbnail... Continue Reading →

Woocommerce Latest Product

<h2 class="head">Latest Products</h2> <?php $args = array( 'post_type' => 'product', 'posts_per_page' => 3, 'orderby' => 'date', 'order' => 'desc' ); $loop = new WP_Query( $args ); if ( $loop->have_posts() ) { //$i=0; while ( $loop->have_posts() ) : $loop->the_post(); /* print_r($loop->post); echo $loop->post->ID; exit; */ $thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id($loop->post->ID, array(400,300) )); $price = get_post_meta( $loop->post->ID, '_regular_price', true);... Continue Reading →

Blog at WordPress.com.

Up ↑

%d bloggers like this: