Questions tagged [woocommerce]

WooCommerce: a WordPress plugin. For how-to-use questions, ask their support team. It's mostly open source. On-topic questions: programming which changes or extends WooCommerce behavior. Questions about 3rd party plugins should be asked directly to the plugin support.

is a commercially supported open source available for .

It allow you to freely sell products from your WordPress site. WooCommerce is enterprise-level quality and is built in , , and .

WooCommerce It is now owned by its parent company Automattic.

Before submitting a question

  • Ensure you have the latest versions of WordPress, your theme and all plugins.
  • Check for theme or plugin conflicts. This includes switching to a default WordPress theme such as Twenty Seventeen and disabling all other plugins.
  • Remember, Stack Overflow is not an official support channel for WooCommerce. That support channel is here.

System Status Report
It may help to have a look at the System Status Report to detect some problems and warnings. This can be found in your WordPress dashboard and going to WooCommerce > System Status.

Useful Links


Related Tags

32907 questions
14
votes
5 answers

WooCommerce show custom column

I want to show a additional column in the backend of WooCommerce (in Orders overview). The column should contain a custom field, which i have defined (delivery date). How to do this?
13
votes
1 answer

Display the discount percentage on the sale badge in Woocommerce 3

This works for simple products but gives me two errors for variable products. In the sale flash on the archive I get NAN% with error "A non-numeric value encountered". My code: add_filter( 'woocommerce_sale_flash', 'add_percentage_to_sale_bubble'…
user10403192
13
votes
5 answers

Ajaxify header cart items count in Woocommerce

I'm creating a custom woocommerce integrated theme for wordpress. I have a blob on the top that displays the total number of items in the cart, I want to update this blob using Jquery (w/o reloading the page) I was able to increase the number of…
Rohit Nair
  • 628
  • 3
  • 7
  • 22
13
votes
2 answers

How to get order meta from array in WooCommerce 3+

I need to create a function that returns a value to one of my plugins WooCommerce Dymo Print. It requires $order_id, $label and $object. The $object is the field I need to return the value to. I created the following…
johnny538
  • 565
  • 1
  • 5
  • 11
13
votes
1 answer

Get orders shipping items details in WooCommerce 3

How can I get the order shipping method id.? For example 'flate_rate'. Since WooCommerce 3 it is now complicated as everything has changed. I have tried it with $order->get_data() in a foreach loop but the data is protected.
Konstantinos E.
  • 155
  • 1
  • 2
  • 8
13
votes
2 answers

Get the customer ID from an order ID in WooCommerce

I want to get the "mycred" balance of a customer through the order while using WP ALL Export to export the customer balance based on orders to a spreadsheet. It's actually probably quite simple. I'm able to get the Order ID, but not the Customer…
Fluke Fox
  • 203
  • 1
  • 2
  • 6
13
votes
4 answers

Can't POST/PUT/DELETE any products into WooCommerce by REST API

I'm using Wordpress 4.7.1 with Woocommerce 2.6.13 plugin with enabled REST API. I was created user credentials from console plugin UI with read_write permissions. Now I'm trying GET products using OAuth1: service return 200 OK, credentials are…
Sergey Nikitin
  • 807
  • 8
  • 23
13
votes
10 answers

Checking if customer has already bought something in WooCommerce

I would like to create a WooCommerce plugin to add some offers for customers (that have a purchase History). How can I check a user bought something before? Thanks.
Mosi
  • 333
  • 1
  • 4
  • 15
13
votes
4 answers

Check if a user/guest has purchased specific products in WooCommerce

I need to check if a customer has purchased a specific product earlier in WooCommerce. The case is this: The customer shall not be able to purchase product "c", "d", "e" unless they have purchased product "a" or "b" at an earlier time. If the…
alegjos
  • 133
  • 1
  • 1
  • 5
13
votes
4 answers

WooCommerce new order action - get order information

I am using this to create a new function in my functions.php file add_action( 'woocommerce_new_order', 'create_invoice_for_wc_order', 1, 1 ); function create_invoice_for_wc_order() { } it is to execute some custom code when a new order is…
charlie
  • 415
  • 4
  • 35
  • 83
13
votes
1 answer

How are partial refunds stored in the WooCommerce Database?

I have a simple backend management tool written in PHP that pulls orders from the WooCommerce database and presents them to our kitchen for processing deliveries. I have always been able to highlight a table row that had a status other than…
Ben Mannino
  • 193
  • 1
  • 4
13
votes
2 answers

Wordpress how to override function get_order_report_data from wc_admin_report

I want to change a part of the get_order_report_data() function inside class-wc-admin-report.php without touching the core. I would like to change the order status filter, right now it is: $query['where'] = " WHERE posts.post_type …
FamousWolluf
  • 568
  • 1
  • 3
  • 25
13
votes
1 answer

WC_Order get_items() and their Quantity

I am trying to build an application which texts me my woo commerce order, order items and Quantity, I am 90% there, function custom_woocommerce_complete_order_sms( $order_id ) { global $woocommerce; if ( !$order_id ) return; …
user2389087
  • 1,692
  • 3
  • 17
  • 39
13
votes
1 answer

Woocommerce: how do I add metadata to a cart item?

I have a digital product which is described by a quantity and a price, but which also needs 3 more numbers to completely specify it (Unix dates, etc). Problem: how do I get these numbers into the cart? As far as I can see, there are 2 possible ways…
EML
  • 9,619
  • 6
  • 46
  • 78
13
votes
4 answers

Custom validation of WooCommerce checkout fields

I would like add my own regular expression for validating the phone number. In my class-wc-validation.php I have changed the regular expression to my requirement. public static function is_phone( $phone ) { //if ( strlen( trim( preg_replace(…
Philomath
  • 1,145
  • 4
  • 18
  • 28