Web Tutorials

BIGGEST AND FASTEST Web Tutorials – live24u.com

img
Home / PHP / Mysql / woocommerce Ajax wordpress click to categories ajax call

woocommerce Ajax wordpress click to categories ajax call

/
/
/
5 Views

woocommerce Ajax wordpress click to categories ajax call

In this Post We Will Explain About is woocommerce Ajax wordpress click to categories ajax call With Example and Demo.

Welcome on live24u.com – Examples ,The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to woocommerce ajax product filter – wordpress plugin free download

In this post we will show you Best way to implement WooCommerce Product Filtering with AJAX, hear for How to Ajax-Enabled, Enhanced Layered Navigation – WooCommerce with Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

You can download source code and Demo from below link.




woocommerce product filter Coding the plugin

To start simple coding our plugin we making a new file named PHP pageSimple_Custom_Items_Tabs.php and we load it up with simple or Standard WordPress Plugin display Information header.

<?php
/*
Plugin Name: GWP Custom Items Tabs
Plugin URI:
Description: A plugin to add Custom product tabs for wordpress woocomm web plugins
Version: 1.0
Author: dsp patel
Author URI: http://live24u.com
*/

Then we making a main class for the wp plugin with the methods as well as function we want to implement:

/**
* GWP_Custom_Items_Tabs for devloped by Live24u.com
*/
class GWP_Custom_Items_Tabs{
    /**
     * $post_type 
     * holds custo post type name
     * @var string
     */
    public $post_type = 'c_p_tab';
    /**
     * $id for devloped by Live24u.com
     * holds settings tab id
     * @var string
     */
    public $id = 'gwp_custom_tabs';
 
    /**
    * __construct
    * class constructor will set the needed filter and action hooks
    */
    function __construct(){}
 
    /**
     * woocommerce_settings_tabs_array  for devloped by Live24u.com
     * Used to add a wordpress woocomm web plugins settings tab
     * @param  array $settings_tabs for devloped by Live24u.com
     * @return array
     */
    function woocommerce_settings_tabs_array( $settings_tabs ) {}
 
    /**
     * show_settings_tab for devloped by Live24u.com
     * Used to display the wordpress woocomm web plugins settings tab content
     * @return void
     */
    function show_settings_tab(){}
 
    /**
     * update_settings_tab for devloped by Live24u.com
     * Used to save the wordpress woocomm web plugins settings tab values
     * @return void
     */
    function update_settings_tab(){}
 
    /**
     * get_settings for devloped by Live24u.com
     * Used to define the wordpress woocomm web plugins settings tab fields
     * @return void
     */
    function get_settings(){}
 
    /**
     * show_c_p_tab_field  for devloped by Live24u.com
     * Used to print the settings field of the custom type c_p_tab
     * @param  array $field for devloped by Live24u.com
     * @return void for devloped by Live24u.com
     */
    function show_c_p_tab_field($field){}
 
    /** 
     * save_c_p_tab_field for devloped by Live24u.com
     * Used to save the settings field of the custom type c_p_tab
     * @param  array $field
     * @return void for devloped by Live24u.com
     */
    function save_c_p_tab_field($field){}
 
    /**
     * ajax_footer_js for devloped by Live24u.com
     * Used to add needed javascript to product edit screen and custom settings tab
     * @return void for devloped by Live24u.com
     */
    function ajax_footer_js(){}
 
    /**
     * woocommerce_product_write_panel_tabs for devloped by Live24u.com
     * Used to add a product custom tab to product edit screen
     * @return void for devloped by Live24u.com
     */ 
    function woocommerce_product_write_panel_tabs(){}
 
    /**
     * woocommerce_product_write_panels for devloped by Live24u.com
     * Used to display a product custom tab content (fields) to product edit screen
     * @return void for devloped by Live24u.com
     */
    function woocommerce_product_write_panels() {}
 
    /**
     * woocommerce_process_product_meta for devloped by Live24u.com
     * used to save product custom tabs meta
     * @param  int $post_id  for devloped by Live24u.com
     * @return void for devloped by Live24u.com
     */
    function woocommerce_process_product_meta( $post_id ) {}
     
    /**
     * woocommerce_json_custom_tabs for devloped by Live24u.com
     * An AJAX handler to list tabs for tabs field for devloped by Live24u.com
     * prints out json of {tab_id: tab_name}
     * @return void for devloped by Live24u.com
     */
    function woocommerce_json_custom_tabs(){}
 
    /**
     * woocommerce_product_tabs 
     * Used to add tabs to product view page for devloped by Live24u.com
     * @param  array $tabs for devloped by Live24u.com
     * @return array
     */
    function woocommerce_product_tabs($tabs){}
 
    /**
     * render_tab for devloped by Live24u.com
     * Used to render tabs on product view page
     * @param  string $key for devloped by Live24u.com
     * @param  array  $tab
     * @return void for devloped by Live24u.com
     */
    function render_tab($key,$tab){}
 
    /**
     * custom_product_tabs_post_type  for devloped by Live24u.com
     * Register custom tabs Post Type for devloped by Live24u.com
     * @return void for devloped by Live24u.com
     */
    function custom_product_tabs_post_type() {}
}//end GWP_Custom_Items_Tabs class.
new GWP_Custom_Items_Tabs();

custom_product_tabs_post_type function

// Register Custom Post Type for devloped by Live24u.com
function custom_product_tabs_post_type() {
 
    $labels = array(
        'name'                => _x( 'Items Tabs', 'Laptop', 'GWP' ),
        'singular_name'       => _x( 'Items Tab', 'Post Type Singular Name', 'GWP' ),
        'menu_name'           => __( 'product Tabs', 'GWP' ),
        'parent_item_colon'   => __( '', 'GWP' ),
        'all_items'           => __( 'Items Tabs', 'GWP' ),
        'view_item'           => __( '', 'GWP' ),
        'add_new_item'        => __( 'Add Items Tab', 'GWP' ),
        'add_new'             => __( 'Add New', 'GWP' ),
        'edit_item'           => __( 'Edit Items Tab', 'GWP' ),
        'update_item'         => __( 'Update Items Tab', 'GWP' ),
        'search_items'        => __( 'Search Items Tab', 'GWP' ),
        'not_found'           => __( 'Not found', 'GWP' ),
        'not_found_in_trash'  => __( 'Not found in Trash', 'GWP' ),
    );
    $args = array(
        'label'               => __( 'Items Tabs', 'GWP' ),
        'description'         => __( 'Custom Items Tabs', 'GWP' ),
        'labels'              => $labels,
        'supports'            => array( 'title', 'editor', ),
        'hierarchical'        => false,
        'public'              => true,
        'show_ui'             => true,
        'show_in_menu'        => 'edit.php?post_type=product',
        'show_in_nav_menus'   => false,
        'show_in_admin_bar'   => true,
        'menu_position'       => 5,
        'menu_icon'           => 'dashicons-feedback',
        'can_export'          => true,
        'has_archive'         => false,
        'exclude_from_search' => true,
        'publicly_queryable'  => false,
        'capability_type'     => 'post',
    );
    register_post_type( 'c_p_tab', $args );
 
}
 
// Hook into the 'init' action for devloped by Live24u.com
add_action( 'init', 'custom_product_tabs_post_type', 0 );

add_action function

/**
* __construct 
* class constructor will set the needed filter and action hooks for devloped by Live24u.com
*/
function __construct(){
    //register_post_type for devloped by Live24u.com
    add_action( 'init', array($this,'custom_product_tabs_post_type'), 0 );
}

You can download source code and Demo from below link.




Example

I hope you have Got Advanced AJAX Product Filters And how it works.I would Like to have FeadBack From My Blog(live24u.com) readers.Your Valuable FeadBack,Any Question,or any Comments abaout This Article(live24u.com) Are Most Always Welcome.

  • Facebook
  • Twitter
  • Google+
  • Linkedin
  • Pinterest

Vestibulum nec placerat orci. Mauris vehicula

Vestibulum nec placerat orci. Mauris vehicula,Vestibulum nec placerat orci. Mauris vehicula

It is main inner container footer text