Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [woocommerce-offtopic]

OFF TOPIC. PLEASE CLOSE THIS QUESTION. Questions *specific* for this e-commerce plugin have their own forum at https://wordpress.org/support/plugin/woocommerce. Click the "Learn More" link below for useful links such as Support and Developer Docs.

Filter by
Sorted by
Tagged with
41 votes
4 answers
67k views

List of JS events in the WooCommerce frontend

Where could I find an exhaustive list of javascript events defined by WooCommerce. ( Events like "woocommerce_variation_has_changed" )
ZecKa's user avatar
  • 758
40 votes
1 answer
106k views

How to add product in woocommerce with php code [closed]

I want to add products with PHP code like below: $post_information = array( 'post_title' => 'new item shop', 'post_content' => 'this is new item shop', 'post_type' => 'post', '...
Hossein Hashemi's user avatar
38 votes
2 answers
123k views

Woocommerce - Add a product to cart programmatically via JS or PHP [closed]

I am using the Woocommerce plugin to facilitate a small e-commerce part of a site and need to add products to its cart via some call or function rather than using its own 'add-to-cart' buttons. By ...
Larry B's user avatar
  • 985
29 votes
1 answer
78k views

( Woocommerce) How to get the user belonging to an order? [closed]

I am making a function which needs to be called after an order is completed within WooCommerce. For this I'm using the *'woocommerce_order_status_completed'* hook. I want to check if the order has a ...
Nazeem's user avatar
  • 431
28 votes
5 answers
102k views

get woocommerce My account page link

I am trying to send an email to customer after purchased products and when customer click on the the link provided the email for rating the product it should redirect to customer's account/My account ...
Ans's user avatar
  • 419
28 votes
6 answers
169k views

Get the product list of a given Category ID

I couldn't find the right way to get the list of all products for a given category ID (not category name). The code I am using to get the categories list is the following, it works fine: $args = ...
Malloc's user avatar
  • 463
24 votes
10 answers
93k views

Display featured products through custom loop in woocommerce on template page

I would like to display 6 featured products from my woocommerce store on my home-page.php template. After some researched I found that the right way to do this was through a custom loop,( I do not ...
steamfunk's user avatar
  • 645
24 votes
5 answers
76k views

How do I delete all UNUSED images from my uploads directory?

I am trying to clean out my uploads folders as they are now starting to take up too much room on my server. I have tried to use plugins to achieve this end such as DNUI and Cleanup Images but these ...
G-Olly's user avatar
  • 351
19 votes
1 answer
183k views

Get woocommerce product price by id [closed]

i make one shortcode for get product title, image and price. i am getting all title, link and image properly but not getting price. but problem is add_shortcode('product_data','...
Accore LTD's user avatar
19 votes
3 answers
116k views

WooCommerce: How to edit the get_price_html

I am trying to edit the price value for a single product. In single-product/price.php there is a template call to $product->get_price_html. How can I edit that function/method to change the way ...
Lucky Luke's user avatar
18 votes
1 answer
79k views

WooCommerce: change display order of product short description and price [closed]

I'd like to move the price "$4.99–$24.99" below the product short description "Seriously. Drink a cup of this..." NSFW Image Below ( Adult Language ) Any ideas how to do this? I already have a ...
Kane's user avatar
  • 301
18 votes
3 answers
52k views

Hide prices and checkout functionality in woocommerce

I know this question might be too broad, but I'm looking for a bit of direction. My client has a woocommerce store with 30-40 products. For whatever reason they do not want to sell online anymore, ...
Ten Sleep's user avatar
  • 339
17 votes
2 answers
35k views

Woocommerce Add Variation Product to Cart from custom link [closed]

I am trying to add a variation product to my cart directly through a link. I am setting the variation_id with the query string. As far as I can tell I am sending the data the exact same way as the ...
ezekielDFM's user avatar
16 votes
2 answers
91k views

How to display custom field in woocommerce orders in admin panel?

currently i add a custom billing field in woocommerce by function custom_override_checkout_fields( $fields ) { $fields['billing']['billing_phone_new'] = array( 'label' => __('...
Ron's user avatar
  • 335
16 votes
3 answers
193k views

How to Display Product specific to a category with WooCommerce Plugin? [closed]

I'm using plugin Woocommerce to do shop online. I have many categories for example shoes, clothes and so on. How can I display the products of specific category? I see such product loops of on the ...
Van Tong's user avatar
  • 163
16 votes
4 answers
143k views

How to correctly add Javascript in functions.php

I would like to remove some ugly looking arrows that are standard on cart buttons in WooCommerce. To achieve this, I found a tip of adding the following code, which should remove the arrows when the ...
user2806026's user avatar
15 votes
1 answer
46k views

Product categories don't appear as option to build menu

I am trying to add my product categories as top level categories in the navigation bar on my site. Under the "categories" option in appearance > menus, the only thing that appears under categories ...
SagaciousCetacean's user avatar
14 votes
1 answer
96k views

Display All Products by Category with WooCommerce

With WooCommerce, I want to display all the categories in a store as headings, with all of their products listed below in an unordered list. Is this possible to do? I've seen a few things that'll let ...
JacobTheDev's user avatar
  • 1,231
13 votes
7 answers
30k views

How to check if a plugin (WooCommerce) is active?

I am trying to modify the head and foot of my WooCommerce pages. I have an if statement that is supposed to target the shop and cart of WooCommerce, but it isn't. If I modify the PHP after the if ...
Heather's user avatar
  • 489
13 votes
3 answers
37k views

Make WooCommerce pages accessible for logged in users only

I have a website using WordPress, and an e-commerce using WooCommerce. I would like my shop (and all its pages) to be seen by logged in users only. Via the User Access Manager plugin, I have denied ...
Alessandro's user avatar
13 votes
2 answers
74k views

How to modify navigation menu of the "My Account" page in WooCommerce

I want to modify the WooCommerce "My Account" left side navigation menu. For that, I have made changes in the woocommerce/templates/myaccount/navigation.php. The problems with this approach are: I ...
Dhruvang Gajjar's user avatar
13 votes
1 answer
36k views

WooCommerce Variable Product Price not showing on single product page

I made custom attribute for variation other than size or colour, but when i apply as variation to this attribute its not showing on single page.
Zarah Dewayne's user avatar
13 votes
2 answers
24k views

How to create a custom order status in woocommerce!

I've tried the below code to create custom status. add_action( 'init', function() { $term = get_term_by( 'name', 'shipped', 'shop_order_status' ); if ( ! $term ) { wp_insert_term( '...
Aparna Mathew's user avatar
13 votes
2 answers
28k views

Changing WooCommerce Display Price Based on User Role & Category [closed]

In wordpress with WooCommerce, I'm looking to display a different price based on a user role (wholesaler, dealer, etc) AND based on the category. There's a dynamic pricing plugin that displays these ...
Tricky Buddha's user avatar
13 votes
4 answers
34k views

WooCommerce prices location in DB

I'm looking for the location of a product's prices according to the option which the user selects in the product price. For example, this WooCommerce shop has a select which prices change according to ...
sali's user avatar
  • 131
12 votes
3 answers
28k views

How to trigger WooCommerce order complete email?

I want to be able to trigger the WooCommerce order complete email at a different stage in the WooCommerce checkout process. So I've disabled WooCommerce order complete email from the backend and am ...
user3210369's user avatar
12 votes
2 answers
62k views

Woocommerce hook after creating order? [closed]

I am looking for a hook which will be triggered after someone submit checkout form and order placed ( no matter he made the payment or not ) . I tried woocommerce_new_order But it's not working.
Iftieaq's user avatar
  • 320
11 votes
6 answers
40k views

How to check if woocommerce is activated in theme

I'm creating a theme with woocommerce which has the following: <ul> <li> <?php if( is_user_logged_in() ){ ?> <a href="<?php echo get_permalink( ...
Oudin's user avatar
  • 409
11 votes
3 answers
43k views

How do I get WooCommerce to automatically recreate pages? [closed]

I had to uninstall WooCommerce plugin (I deleted the tables it created as well) and now I reinstalled the plugin and I doesn't automatically recreate the WooCommerce Pages. Am I stuck having to ...
Matt's user avatar
  • 309
10 votes
3 answers
44k views

Getting the gallery images from products in woocommerce?

Looking for a code which could potentially help me get the list of gallery images present in product in woocommerce. Need them so i can use them in a custom single page design for woocommerce product ...
Shahzaib Khan's user avatar
10 votes
3 answers
61k views

How to override WooCommerce template files?

I was trying to customize the shop page (adding widget area to the page). Is there any way or plugin to help me do so? I created a page-shop.php however no changes were seen.
Roshan Chapagain's user avatar
10 votes
2 answers
83k views

How to get current product category ID in product archive page

If I am on a product archive page then how can I get current product category ID in product archive page. I am using this but no result: global $wp_query; $category_name = $wp_query->query_vars['...
Exclutips's user avatar
  • 685
10 votes
3 answers
39k views

Get url of product's images (woocommerce)

What happen when a post (product) didnt have a guid,because it has the same image with another product ? For example: Query1: select guid from wp_posts where post_type='attachment' and ...
user8761967's user avatar
10 votes
1 answer
107k views

Check IF is a "single product page" and Check the "role" for a Redirect

After much research on the net, I have not found a solution that works. Do you know how can I do that on woocommerce : I try that for the moment : function cm_redirect_users_by_role() { $...
moikben's user avatar
  • 101
9 votes
3 answers
31k views

Woocommerce override mini-cart.php not working [closed]

I am trying to override mini-cart.php which is template file located at woocommerce/cart/mini-cart.php. It should override behaviour of woocommerce widget cart but it isnt working. I can make any ...
horin's user avatar
  • 217
9 votes
1 answer
27k views

Woocommerce add extra field to variation product

I'm following this tutorial on how to add an extra field to my variation products. I just need to add an extra text field. The admin part works fine - the field is showing and saving/updating, ...
Vucko's user avatar
  • 163
9 votes
1 answer
66k views

How do you access the Product Short Description in a WooCommerce email template? [closed]

I would like to output the Product Short Description beneath the product name inside the order items table inside WooCommerce emails. I think I know where to place code inside the email template file, ...
eljefejb's user avatar
  • 621
9 votes
1 answer
56k views

how to override woocommerce specific loop or archive-product.php [closed]

so far while my woocommerce theme loop through all products in shop page i'm trying to customise and add few bootstrap classes to style it in a prober way since default styles generated causes layout ...
OT AMD's user avatar
  • 95
8 votes
3 answers
7k views

WooCommerce: Webhook disabled on its own

I'm developing an order management system that hooks into WooCommerce but the Webhook behaves irregularly. The Webhook gets disabled on its own. I've investigated with the users - none of them have ...
Alex Seif's user avatar
  • 261
8 votes
1 answer
53k views

Retrieve Product category 'NAME' by product category ID - WooCommerce?

Can I retrieve woocommerce product category name by ID? Not thumbnail, not the URL, not the Sub-categories, just raw Category name.
user3137901's user avatar
8 votes
5 answers
11k views

Order by rating not works in wp_query

I need to sort my products by rating in a wp_query loop: this is my code: switch($ordering){ case 'default': $meta_key = ''; $order = 'asc'; $orderby = 'menu_order title';...
Francesco's user avatar
  • 191
8 votes
3 answers
7k views

Are there any hook or filter when refund is done through admin -woocommerce

I am using Woocommerce plugin for my custom product .and I am stuck with a situation . Does Woo commerce provide any hook or filter when refund is done through admin panel and refund will be manually....
user1263829's user avatar
8 votes
2 answers
5k views

What is the different between an attachment in wp_posts and an attachment in wp_postmeta?

After the Woocommerce dummy products are imported, I notice that in the database, there are different records in different tables but point to THE SAME photo attachment. The question is why? What are ...
Nam G VU's user avatar
  • 359
8 votes
1 answer
12k views

Correct function to get the user's latest Woocommerce Subscription?

I've a members' only subscription site, where the member can only have one active subscription, and I need to be able to get the status of the subscription. I've been through all the documentation ...
Peter HvD's user avatar
  • 1,121
8 votes
2 answers
121k views

WooCommerce: Change template for single product page

I know there is a possibility to change the structure/design of the product page by editing the file single-product-php - in a child-theme. The changes made of that file will affect all the product ...
user3751508's user avatar
8 votes
1 answer
55k views

How to access custom order item meta data from a meta key in WooCommerce?

I'm trying to display some custom meta data that's associated with the shipping on an order in WooCommerce. Here's the entire story of what I'm doing (so it might help someone else, and so you know ...
Danny's user avatar
  • 83
8 votes
1 answer
2k views

Wordpress Multisite: Adding actions to only one site

I have Wordpress Multisite installed with WooCommerce network activated. I want to add an action to a hook in ONE of the sites that has WooCommerce installed, instead of all of them. For example, I ...
Alex's user avatar
  • 115
8 votes
2 answers
4k views

How to pass/get data to/from the WooCommerce data-product_variations object?

What is the best way to pass/get data to/from the data-product_variations attr form in Product Single pages. I am working on some interactions with the product gallery images and the product ...
ameraz's user avatar
  • 145
7 votes
2 answers
19k views

WP_Query: Exclude hidden products from WooCommerce product list

I hope this is not too specific to WooCommerce. I have a nifty shortcode that displays a list of all my products with SKUs. However, it also includes products that I have published but have set the ...
Peter Ingersoll's user avatar
7 votes
4 answers
99k views

How to get WooCommerce Product Category Link by ID?

WooCommerce's product categories are a custom taxonomy called product_cat. In a function I'm writing, I'm using get_categories with the taxonomy parameter set to product_cat. Everything works fine and ...
RachieVee's user avatar
  • 830

1
2 3 4 5
79