Posts Categorized: Wordpress

Few word About Google Analytics – Quick Start

Knowing website audience and from where coming and what they search is an important success factor for any website. The best way to know this is through your traffic stats using Google Analytics.

“Web analytic is the study, of online behaviour in order to improve it.” …wikipedia

Google Analytics shows all this information as:

Continue reading

WooCommerce products ID

This code create a new column on the products list page that will show each product ID.

<?php
/**
 * Plugin Name: WooCommerce - Show products IDs
 * Plugin URI: http://www.remicorson.com/easily-find-woocommerce-products-id/
 * Description: Adds a new columns to products list page to display product IDs
 * Version: 1.0
 * Author: Remi Corson
 * Author URI: http://remicorson.com
 * Requires at least: 3.5
 * Tested up to: 3.5
 *
 * Text Domain: -
 * Domain Path: -
 *
 */
 
 /*
|--------------------------------------------------------------------------
| WooCommerce Product Extra Columns
|--------------------------------------------------------------------------
*/

/**
 * Load Custom Product Columns
 *
 * @access      public
 * @since       1.0 
 * @return      
*/
function woo_product_extra_columns($columns)
{

	$newcolumns = array(
		"cb"       		=> "<input type  = \"checkbox\" />",
		"product_ID"    => esc_html__('ID', 'woocommerce'),
	);

	$columns = array_merge($newcolumns, $columns);
	
	return $columns;
}
add_filter("manage_edit-product_columns", "woo_product_extra_columns");


/**
 * Charge Product Columns Content
 *
 * @access      public
 * @since       1.0 
 * @return      
*/
function woo_product_extra_columns_content($column)
{
	global $post;
	
	$product_id = $post->ID;

	switch ($column)
	{
		case "product_ID":
			echo $product_id;
		break;	
		
	}
}
add_action("manage_posts_custom_column",  "woo_product_extra_columns_content");