May 29, 2014

How to get Woocommerce products categories?

How to get Woocommerce products categories? $current_term = get_term_by( ‘slug’, get_query_var( ‘term’ ), get_query_var( ‘taxonomy’ ) ); $category_name = $current_term->name; $args = array( ‘hide_empty’ => false, ‘orderby’ => ‘name’, ‘order’ => ‘ASC’, ‘child_of’ => 0, ‘parent’ => (isset($current_term->term_id)?$current_term->term_id:0) ); $product_categories = get_terms( ‘product_cat’, $args );

Woocommerce products query with specific category and meta key val

Woocommerce products query with specific category and meta key val $args = array( ‘post_type’ => ‘product’, ‘ignore_sticky_posts’ => 1, ‘no_found_rows’ => 1, ‘posts_per_page’ => 3, ‘tax_query’ => array( array( ‘taxonomy’ => ‘product_cat’, ‘field’ => ‘slug’, ‘terms’ => ‘bundles’ ) ), ‘meta_query’ => array( array( ‘key’ => ‘_featured_checkbox’, ‘value’ => array(‘yes’), ‘compare’ => ‘IN’, ) ) […]

April 17, 2014

How to set cusutom favicon to WordPress admin?

How to set cusutom favicon to WordPress admin? function wdwd_admin_area_favicon() { $favicon = ‘path to favicon’; echo ‘ ‘; } add_action(‘admin_head’, ‘wdwd_admin_area_favicon’); add_action(‘login_head’, ‘imed_admin_area_favicon’ );

Fix for: Canada Shipping Post Add-on for Marketpress

Fix for: Canada Shipping Post Add-on for Marketpress !important: Make sure that you are testing with a product having weight. Filename: mp-canada-post.php Line Number: 613 (or near) Find the following code snippet: $shipping_meta[‘weight’] = (is_numeric($shipping_meta[‘weight’]) ) ? $shipping_meta[‘weight’] : 0; Now observe it that shouldn’t it be inside the foreach? See here foreach ($cart as […]

How to mute WordPress Plugins updates?

How to mute WordPress Plugins updates? add_filter(‘site_transient_update_plugins’, ‘wdwd_remove_update_nag’); function wdwd_remove_update_nag($value) { unset($value->response[ plugin_basename(__FILE__) ]); return $value; }

How to hide WordPress plugins from list?

How to hide WordPress plugins from list? Objective: We have to hide this plugin from activated plugins list. e.g. Plugin Name: marketpress function wdwd_plugins_filter() { global $wp_list_table; $hidearr = array(‘marketpress/marketpress.php’); $myplugins = $wp_list_table->items; foreach ($myplugins as $key => $val) { if (in_array($key,$hidearr)) { unset($wp_list_table->items[$key]); } } } add_action( ‘pre_current_active_plugins’, ‘wdwd_plugins_filter’ );

How activate a WordPress plugin from your php script?

How activate a WordPress plugin from your php script? e.g. Plugin Name: marketpress if(is_admin()){ include_once( ABSPATH . ‘wp-admin/includes/plugin.php’ ); if ( !is_plugin_active( ‘marketpress/marketpress.php’ ) ) { do_action( ‘activate_’ . trim( ‘marketpress’ ) ); } }

No valid shipping options found. Please check your address carefully.

No valid shipping options found. Please check your address carefully. Hi Developers, Make sure two things: Products have weights Base zip code is entered If still not working? Debugging: Now if you are familiar with your favorite browser’s console then try this command there jQuery(‘input[name=”no_shipping_options”]’) You will see that there are two input elements with […]