WooCommerce – Add product with image via REST API

Ok my mistake, you can see my images array was not quite right: This is correct: ‘images’ => [ [ ‘src’ => ‘http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg’ ], [ ‘src’ => ‘http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_back.jpg’ ] ], This was mine: ‘images’ => [ ‘src’ => ‘http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_back.jpg’, ], Thought it would be best to leave this question/answer as over the years there are … Read more

Adding Product Name on Admin Panel Order list and User’s My-Account Order List

Add this code to your functions.php this will add an extra column to the listing table with Product name. Like 1 x Netflix Premium. If multiple that will be visible too. add_filter(‘manage_edit-shop_order_columns’, ‘_order_items_column’ ); function _order_items_column( $order_columns ) { $order_columns[‘order_products’] = “Product Name”; return $order_columns; } add_action( ‘manage_shop_order_posts_custom_column’ , ‘_order_items_column_cnt’ ); function _order_items_column_cnt( $colname ) … Read more

WooCommerce minimum order amount for specific country excluding local pickup [closed]

Hey just wanted to let you know! I was able to achieve my desired result with this code! // Set a minimum amount of order based on shipping zone & shipping method before checking out add_action( ‘woocommerce_check_cart_items’, ‘cw_min_num_products’ ); // Only run in the Cart or Checkout pages function cw_min_num_products() { if( is_cart() || is_checkout() … Read more

New field on checkout is shown but it’s not saved on the order details [closed]

As far as I remember you need to manually save your custom fields values via woocommerce_checkout_update_order_meta hook. Try add_action( ‘woocommerce_checkout_update_order_meta’, ‘custom_checkout_fields_update_order_meta’ ); function custom_checkout_fields_update_order_meta( $order_id ) { update_post_meta( $order_id, ‘billing_colonia’, sanitize_text_field( $_POST[‘billing_colonia’] ) ); update_post_meta( $order_id, ‘shipping_colonia’, sanitize_text_field( $_POST[‘shipping_colonia’] ) ); }

Is it possible to update the total price on the checkout page in woocommerce from a custom field

Well, you can use a WooCommerce hook( woocommerce_before_calculate_totals ) I will give an example so that it may be easier to understand what you believe. As far as you know , I think you problem will be fixed function calculate_embossing_fee( $cart_object ) { if( !WC()->session->__isset( “reload_checkout” )) { /* Gift wrap price */ $additionalPrice = … Read more

How can I get all the woocommerce api orders [closed]

By default, that API endpoint is paged and the amount per_page is set to 10. You can see all the defaults for that endpoint here https://woocommerce.github.io/woocommerce-rest-api-docs/#list-all-orders If this endpoint works like WP_Query then you’ll need to set the per_page parameter to -1. Otherwise you’ll need to make multiple requests, incrementing the page number each time … Read more