Title: gigiwordpress's Replies | WordPress.org

---

# gigiwordpress

  [  ](https://wordpress.org/support/users/gigiwordpress/)

 *   [Profile](https://wordpress.org/support/users/gigiwordpress/)
 *   [Topics Started](https://wordpress.org/support/users/gigiwordpress/topics/)
 *   [Replies Created](https://wordpress.org/support/users/gigiwordpress/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/gigiwordpress/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/gigiwordpress/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/gigiwordpress/engagements/)
 *   [Favorites](https://wordpress.org/support/users/gigiwordpress/favorites/)

 Search replies:

## Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WooCommerce] How to modify Cart Sessions on the checkout (and is this the correct approach)](https://wordpress.org/support/topic/modify-cart-session-on-the-checkout/)
 *  [gigiwordpress](https://wordpress.org/support/users/gigiwordpress/)
 * (@gigiwordpress)
 * [10 years ago](https://wordpress.org/support/topic/modify-cart-session-on-the-checkout/#post-6263740)
 *     ```
       $cart = WC()->session->get('cart');
       // changes here to $cart
       WC()->session->set('cart',$cart);
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Batch-Move Posts wp plugin] How to get it working with custom post types?](https://wordpress.org/support/topic/how-to-get-it-working-with-custom-post-types/)
 *  [gigiwordpress](https://wordpress.org/support/users/gigiwordpress/)
 * (@gigiwordpress)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/how-to-get-it-working-with-custom-post-types/#post-4481551)
 * Disregard my previous post – someone should delete it.
 * If you want to get it to work with woocommerce:
 * 1. In **batchmove/batch_admin.php**, comment out line:
 *     ```
       if ($bm->cat == "") {return;}
       ```
   
 * 2. in **batchmove/include/functions.php**
    a) replace the whole ‘switch’ at line
   21 with:
 *     ```
       switch ($apost['act-cats']) {
       	case "add":
       		foreach ((array) $apost['ids'] as $id) {
       			$id = intval($id);
       			wp_set_post_terms($id, array(intval($cat)), 'product_cat',true);
       		}
       		break;
       	case 'upd':
       		foreach ((array) $apost['ids'] as $id) {
       			$new = array();
       			$new[] = intval($cat);
       			wp_set_post_terms($id, (array) $new, 'product_cat');
       		}
       			break;
       	case 'del':
       		foreach ((array) $apost['ids'] as $id) {
       			$id = intval($id);
       			wp_remove_object_terms( $id, intval($cat), 'product_cat' );
       		}
       		break;
       	default:
       	;
       } // switch
       ```
   
 * b) in **function show_bm_selector**:
    replace the line
 *     ```
       $html .= wp_dropdown_categories('hide_empty=0&hierarchical=1&echo=0&selected=' .
       			( isset($_REQUEST['cat']) ? intval($_REQUEST['cat']) : -1 ));
       ```
   
 * with
 *     ```
       $html .= wp_dropdown_categories('hide_empty=0&hierarchical=1&echo=0&taxonomy=product_cat&selected=' .
       			( isset($_REQUEST['cat']) ? intval($_REQUEST['cat']) : -1 ));
       ```
   
 * c) in **function show_bm_actions**:
    replace the line
 *     ```
       $html .= wp_dropdown_categories('name=qcat&hide_empty=0&hierarchical=1&echo=0' );
       ```
   
 * with
 *     ```
       $html .= wp_dropdown_categories('name=qcat&hide_empty=0&hierarchical=1&echo=0&taxonomy=product_cat' );
       ```
   
 * d) in **function get_results**
    replace the line
 *     ```
       $categories = wp_get_post_categories($post->ID);
       ```
   
 * with
 *     ```
       $categories = wp_get_post_terms($post->ID,'product_cat');
       ```
   
 * e) in **function get_a_query**
 * Replace
 *     ```
       $qa = array( 'paged' => $bm->paged,
       	 			 'posts_per_page' => $bm->per_page,
       				 'orderby' => $bm->orderby,
       				 'order' => $bm->order);
       ```
   
 * with
 *     ```
       $gets = $bm->get;
       	$cat = (empty($gets['cat']))?$gets['qcat']:$gets['cat'];
       	if ($cat) {
       		$qa['cat'] = intval($cat);
       	}
       	$qa = array( 'paged' => $bm->paged,
       	 			 'posts_per_page' => $bm->per_page,
       				 'orderby' => $bm->orderby,
       				 'order' => $bm->order,
       				 'tax_query' => array(
       					array(
       						'taxonomy' => 'product_cat',
       						'field' => 'term_id',
       						'terms' => intval($cat)
       					)
       				 )
       		);
       ```
   
 * You should make a backup of the 2 files first. Good Luck!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Batch-Move Posts wp plugin] How to get it working with custom post types?](https://wordpress.org/support/topic/how-to-get-it-working-with-custom-post-types/)
 *  [gigiwordpress](https://wordpress.org/support/users/gigiwordpress/)
 * (@gigiwordpress)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/how-to-get-it-working-with-custom-post-types/#post-4481550)
 * If you want to get it to work with woocommerce:
 * 1. In **batchmove/batch_admin.php**, before $posts = $query->query($q); add:
 *     ```
       /*selecting also 'product' post_types */
       function filter_where_woo($where = '') {
       global $bm;
       $where .= ' OR post_type = "product" ';
       return $where;
       }
       $filter = add_filter('posts_where', 'filter_where_woo');
       ```
   
 * 2. in **batchmove/include/functions.php**
    a) replace the whole ‘switch’ at line
   21 with:
 *     ```
       switch ($apost['act-cats']) {
       	case "add":
       		foreach ((array) $apost['ids'] as $id) {
       			$id = intval($id);
       			wp_set_post_terms($id, array(intval($cat)), 'product_cat',true);
       		}
       		break;
       	case 'upd':
       		foreach ((array) $apost['ids'] as $id) {
       			$new = array();
       			$new[] = intval($cat);
       			wp_set_post_terms($id, (array) $new, 'product_cat');
       		}
       			break;
       	case 'del':
       		foreach ((array) $apost['ids'] as $id) {
       			$id = intval($id);
       			wp_remove_object_terms( $id, intval($cat), 'product_cat' );
       		}
       		break;
       	default:
       	;
       } // switch
       ```
   
 * b) in **function show_bm_selector**:
    replace the line
 *     ```
       $html .= wp_dropdown_categories('hide_empty=0&hierarchical=1&echo=0&selected=' .
       			( isset($_REQUEST['cat']) ? intval($_REQUEST['cat']) : -1 ));
       ```
   
 * with
 *     ```
       $html .= wp_dropdown_categories('hide_empty=0&hierarchical=1&echo=0&taxonomy=product_cat&selected=' .
       			( isset($_REQUEST['cat']) ? intval($_REQUEST['cat']) : -1 ));
       ```
   
 * c) in **function show_bm_actions**:
    replace the line
 *     ```
       $html .= wp_dropdown_categories('name=qcat&hide_empty=0&hierarchical=1&echo=0' );
       ```
   
 * with
 *     ```
       $html .= wp_dropdown_categories('name=qcat&hide_empty=0&hierarchical=1&echo=0&taxonomy=product_cat' );
       ```
   
 * d) in **function get_results**
    replace the line
 *     ```
       $categories = wp_get_post_categories($post->ID);
       ```
   
 * with
 *     ```
       $categories = wp_get_post_terms($post->ID,'product_cat');
       ```
   
 * You should make a backup of the 2 files first. Good Luck!

Viewing 3 replies - 1 through 3 (of 3 total)