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
48
votes
3 answers

WooCommerce hook for "after payment complete" actions

I'm using WooCommerce and Wordpress. I have a custom license key generator, and I'd like it to generate a license key when someone successfully purchases my plugin through WooCommerce. It seems pretty straight-forward: User completes checkout on my…
Pete
  • 7,289
  • 10
  • 39
  • 63
48
votes
8 answers

woocommerce get_woocommerce_currency_symbol()

I am developing an extension for woocommerce WordPress plugin. I would like to display the currency symbol outside of the loop in a custom function I have the following: function my_function( ) { global $woocommerce; echo…
danyo
  • 5,686
  • 20
  • 59
  • 119
44
votes
10 answers

WooCommerce: Add product to cart with price override?

$replace_order = new WC_Cart(); $replace_order->empty_cart( true ); $replace_order->add_to_cart( "256", "1"); The above code add product 256 to the Cart 1 time. But the issue I'm having is that I want to be able to completely override the product…
dcolumbus
  • 9,596
  • 26
  • 100
  • 165
41
votes
5 answers

WooCommerce: Auto complete paid orders

Normally wooCommerce should autocomplete orders for virtual products. But it doesn't and this is a real problem, even a BUG like. So at this point you can find somme helpful things(but not really convenient): 1) A snippet code (that you can find in…
LoicTheAztec
  • 229,944
  • 23
  • 356
  • 399
38
votes
15 answers

WooCommerce - woocommerce_rest_cannot_view - Status 401

I have generated a consumer key and consumer secret. The website has SSL installed. I have also installed plugins required for JSON and REST services. This is how the url looks like: https:///wp-json/wc/v1/products When I am trying to get(GET)…
38
votes
4 answers

Programmatically creating new order in Woocommerce

I am having the hardest time programmatically creating an order in WooCommerce. I am using the code below and is DOES create an order BUT I cannot get customer information OR product line items added to the order. The new order that is create is…
Joe Conlin
  • 5,976
  • 5
  • 25
  • 35
38
votes
3 answers

Apply a coupon programmatically in Woocommerce

In Woocommerce I'm trying to find a way to apply a 10% discount to an entire customer's order if the weight in the cart is over 100 lbs. I'm partway to achieving this. For the next step, I'm looking for a way to programmatically apply a coupon code…
msargenttrue
  • 425
  • 1
  • 5
  • 11
38
votes
13 answers

How to disable the quantity field in the product detail page in woocommerce?

I need to hide the "quantity" field (where one enters the quantity before adding to cart) in Woocommerce on the product detail page, and only show the "add-to-cart"-button, which would then put the quantity of 1 in the cart. The reason is because I…
user2051753
  • 381
  • 1
  • 3
  • 3
38
votes
11 answers

How to display Woocommerce Category image?

I use this code in PHP: $idcat = 147; $thumbnail_id = get_woocommerce_term_meta( $idcat, 'thumbnail_id', true ); $image = wp_get_attachment_url( $thumbnail_id ); echo ''; Where 147 is the…
MrRoman
  • 793
  • 2
  • 7
  • 17
36
votes
1 answer

WooCommerce action hooks and overriding templates

I have started to learn how to create templates with WooCommerce and I had faced with a little problem. For instance, in the php file content-single-product.php of Woocommerce plugin I have strings like that:
Dmitry Shulga
  • 588
  • 1
  • 6
  • 19
36
votes
1 answer

How to get Woocommerce Product Gallery image URLs?

I am developing a wordpress woo commerce shopping site and added some products. i want to get the product gallery image urls of each products. how can I get the URLs of images?
Jishad
  • 2,876
  • 8
  • 33
  • 62
35
votes
5 answers

Woocommerce - how to tell if product post has variations or not

I am trying to edit the short-description template to be different on variable (single) product pages than on simple products. the code in that page is here: global $post; if ( ! $post->post_excerpt ) return; ?>
Stephen
  • 8,038
  • 6
  • 41
  • 59
34
votes
4 answers

Add extra meta for orders in Woocommerce

I'm creating a custom plugin for my website. In some part of this plugin I need to store extra meta in wp_postmeta for each orders. I added this in my plugin's class: add_action ('woocommerce_before_checkout_process', array( &$this, 'add_item_meta',…
Mo Saeedi
  • 575
  • 1
  • 5
  • 15
34
votes
2 answers

WooCommerce - where can I edit HTML generated by hooks?

I'm new to WooCommerce. Anyhow, I want to create my own theme, so I followed the guidelines and copied accross the core template files to /mywordpresstheme/woocommerce/. That all works great and I'm editing the templates just fine. However, the way…
Michael Giovanni Pumo
  • 14,338
  • 18
  • 91
  • 140
33
votes
3 answers

Getting order data after successful checkout hook

In WooCommerce, I would like to send a request to an API once the customer has successfully checked out. Its basically a website where the client is selling online courses (Like udemy). When the customer checks out, I would like to send an API…