keithg

Distance between two places

function distance($lat1, $lon1, $lat2, $lon2, $unit) { $theta = $lon1 – $lon2; $dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta)); $dist = acos($dist); $dist = rad2deg($dist); $miles = $dist * 60 * 1.1515; $unit = strtoupper($unit); if ($unit == “K”) { return ($miles * 1.609344); } else...Read more …
keithg

Remove specific category product on Shop page(Product Listing)

Add in function.php add_action( ‘pre_get_posts’, ‘custom_pre_get_posts_query’ ); function custom_pre_get_posts_query( $q ) { if ( ! $q->is_main_query() ) return; if ( ! $q->is_post_type_archive() ) return; if ( ! is_admin() && is_shop() ) { $q->set( ‘tax_query’, array(array( ‘taxonomy’ => ‘product_cat’, ‘field’ => ‘slug’, ‘terms’ => array( ‘clearance’ ), // Don’t display products...Read more …
keithg

Woocommerce related free plugins-basic information

An Introduction to Theming WooCommerce for WordPress http://code.tutsplus.com/articles/an-introduction-to-theming-woocommerce-for-wordpress–wp-31577 Template Structure + overriding templates via a theme http://docs.woothemes.com/document/template-structure/  Tab Add in woocomerce http://docs.woothemes.com/document/editing-product-data-tabs/ http://fivera.net/woocommerce-customization-free-wp-plugins/ WooCommerce customization – How to display Free instead of zero [crayon-59977cbd37f73343589186/] Add Another Extra price (textbox) in  product page  add in function.php //OLD Price add_action(‘woocommerce_product_options_pricing’,’custom_cost_price’); function custom_cost_price()...Read more …