Woocommerce – remove product from category
wp_remove_object_terms( $product_id, ‘Aanbiedingen’, ‘product_cat’ );
wp_remove_object_terms( $product_id, ‘Aanbiedingen’, ‘product_cat’ );
Thanks, will do next time. I figured this one out: function my_custom_wc_api_order_response( $order_data, $order, $fields ) { $customer_info = get_post_meta( $order->id, ‘_customer_info’, true ); $order_data[‘payment_details’][‘customer_info’] = $customer_info; // Apply filters if necessary if ( $fields ) { $order_data = WC()->api->WC_API_Customers->filter_response_fields( $order_data, $order, $fields ); } return $order_data; } add_filter( ‘woocommerce_api_order_response’, ‘my_custom_wc_api_order_response’, 10, 3 );
By the time woocommerce_checkout_fields filter is run, the arrays for billing and shipping have already been created. You can see that here: https://docs.woothemes.com/wc-apidocs/source-class-WC_Checkout.html#101 If you want to effect the default fields, use this hook. function wpse215677_checkout_fields ( $fields ) { $fields[‘postcode’][‘maxlength’] = 4; return $fields; } add_filter(‘woocommerce_default_address_fields’, ‘wpse215677_checkout_fields’); If you want to adjust just the … Read more
You’ll want to add to the hidden item meta array as such: add_filter(‘woocommerce_hidden_order_itemmeta’, array($this, ‘hidden_order_itemmeta’), 50); function hidden_order_itemmeta($args) { $args[] = ‘my_hidden_meta’; return $args; }
Disabled elements don’t fire mouse events, so you have to wrap a div around the button and catch the event.
The get_adjacent_post() function has multiple arguments. The fourth and last one is the taxonomy, which per default is ‘category’: $post_prev = get_adjacent_post( true, ”, true, ‘product_cat’ ); $post_next = get_adjacent_post( true, ”, false, ‘product_cat’ );
I figured out the answer, so I thought I’d post it. My code looks like this now and it works: add_action( ‘processed_subscription_payment’, ‘updatedays’, 10, 2 ); function updatedays($user_id, $subscription_key) { //do what I need to the sub key } There really needs to be more examples on the Woothemes documentation though..
Found the answer here: http://code.tutsplus.com/tutorials/a-guide-to-overriding-parent-theme-functions-in-your-child-theme–cms-22623 <?php function child_remove_parent_function() { remove_action( ‘woocommerce_before_main_content’, ‘mod_output_content_wrapper’, 10 ); } add_action( ‘wp_loaded’, ‘child_remove_parent_function’ ); ?> Explanation is in the link.
I was able to come up with a solution. It displays the variant price below/adjacent to the radio buttons. Display variant price (when given an ID): function get_product_variation_price($variation_id) { global $woocommerce; $product = new WC_Product_Variation($variation_id); return $product->get_price_html(); // Works. Use this if you want the formatted price } Find variant ID, send to function get_product_variation_price, … Read more
Create shipping classes for each of your product variations which require one. On your product page, add the attributes for the product, then add the variations, based on the added attributes. Once loaded, you may select the individual product variations to modify price, size, weight, inventory, and shipping class for each specific product variation. To … Read more