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.

1,631 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4 votes
0 answers
157 views

Is it safe to delete from db orphaned posts i.e. whose post_parent no longer exists?

I inherited a couple of WP + WooCommerce shops with roughly 30,000 products for sale each, and a wp_postmeta which is over a million lines. The former webmasters ran away. In an effort to clean up old ...
Riccardo Zorn's user avatar
3 votes
0 answers
353 views

woocommerce_package_rates not fired everytime

I am using woocommerce_package_rates hook on woocommerce so I could change the flat rate on checkout page, but the problem is when someone access the checkout page its not triggering everytime. This ...
Aayush Bansal's user avatar
3 votes
1 answer
386 views

How to remove "out of stock" variation options from size dropdown in woocommerce?

I'm using woocommerce to display products and their variations. I have a variation called 'Size' for all of the products. Some of the variations are out of stock, but these are still showing in the ...
SohaIb AhmEd's user avatar
3 votes
0 answers
225 views

WooCommerce Subscriptions: Show monthly Price for annual Product

Using WooCommerce Subscriptions, is there a way to show a monthly price as well as a "total duration" price? On my site I have subscriptions for a month and others for a year. Those for a year look ...
user avatar
3 votes
0 answers
3k views

How to get orders with used coupon in WooCommerce

Im trying to get orders in WooCommerce (ideally through wc_get_orders) where the coupon code "some_code" was used. My try: function get_orders_with_coupon($coupon){ $customer_orders = ...
Lukáš Kosař's user avatar
3 votes
0 answers
1k views

Is it possible to intercept all ajax requests and get the parameters and the returns?

Is there any hook that always goes through it, where I can see all the requests, and also the returns after the "action" that is executed? I need to intercept all requests, including requests from ...
rafaelfndev's user avatar
3 votes
0 answers
1k views

Add Product categories to Wordpress menu without losing hierarchy

I need to add product categories to Wordpress menu, but when I'm doing this with WP interface it lose the hierarchy I tried with WP-CLI, but there is no method to specify wich item is the child. ...
user3249443's user avatar
2 votes
0 answers
670 views

WooCommerce event works in jQuery but not in JavaScript

I'm using WooCommerce hook added_to_cart which works perfectly in jQuery, but doesn't work in vanilla Javascript. Both functions are running on document loaded. Here is my code reference: JavaScript ...
Alexander's user avatar
  • 133
2 votes
2 answers
430 views

Sort products without thumbnail in WooCommerce shop page

I would like to create a function that instead of hiding the products without thumbnails, would be ordered in such a way that the products with the highlighted image appear first on the shop page ...
Naycom's user avatar
  • 23
2 votes
0 answers
477 views

Create or Update thousands of woocommerce products via PHP

I have client with a cash register in the store. That register has an API from which I'm retrieving over 5000 products and syncing them with online store. I wrote plugin that triggers cron job every ...
kajdzo's user avatar
  • 23
2 votes
0 answers
979 views

WooCommerce with ACF: custom fields per product variation

I'm a little stuck here. So I have variable products and I need to show the output of a custom field in a custom tab. So I created a new field in ACF, called 'test'. I've got this to work for the ...
Michaël's user avatar
2 votes
1 answer
4k views

Is there a Woocommerce hook that fires when applying a coupon but before checking if it's valid?

I want to add an item to the cart (that same item gets discounted with the coupon) upon using a coupon code (with a hook). E.g. when using the coupon code SAMPLECODE, a product is added to the cart ...
lastnoob's user avatar
  • 143
2 votes
0 answers
147 views

WP WPQuery, not running properly in WP CLI

I'm running a simple query just to find simple WooCommerce products, here is the query which works fine in the header of the site: $args = array( 'post_type' => 'product', 'posts_per_page' =...
WebDevB's user avatar
  • 121
2 votes
0 answers
108 views

Disable Local Attributes woo commerce

Is it possible to disable addition of local attributes in woo commerce? I have global attributes for the products which i like to use a filter. But i like to disable the possibility of addition of ...
MMK's user avatar
  • 538
2 votes
0 answers
735 views

Add Icons to the Product Category Sidebar Widget WooCommerce

I have been searching for this since yesterday. It's weird the little info is there about this simple function, I suppose that's because the answer is too obvious. But I didn't find the way to display ...
Sin Medias's user avatar
2 votes
0 answers
233 views

How to add SVG icon above product tab title

I used the following code to create custom product tabs (woocommerce), and now I was wondering if I can add an SVG icon above the tab title. My code for a custom product tab: add_filter( '...
Patrick's user avatar
  • 21
2 votes
0 answers
974 views

How to get all products from an order including variations via SQL query?

I have searched a lot and hope someone has an answer. I want to run a query in the Wordpress/Woocommerce database and fetch from an individual order, all details, including the variations of a ...
Klaudio's user avatar
  • 21
2 votes
0 answers
45 views

Automatically adding category filter based on search string

Like ebay and amazon, i want to implement something on my site wherby if someone searches e.g red dresses then the category "Women's dresses" is only searched within. As seen as below, a generic ...
Johnay_Coding's user avatar
2 votes
0 answers
262 views

How to filter Post using Meta Data REST API

I want to list post that filtered by Meta Data I have tried many solutions i found here but i can't make it work. The last solution i tried is to add this to my functions.php add_filter( '...
URaff Joseph's user avatar
2 votes
1 answer
777 views

Print value of an array or variable in a payment plugin

I am programming a payment plugin for WooCommerce. For the purposes of testing it, I need to print the values of $response. I have tried this withecho, print_r andvar_dump, but when I make the ...
Mario Burga's user avatar
2 votes
0 answers
126 views

Rewriting Woocommerce Product Filters To URL Segments

I'm working with a site where product category pages are filtered using query parameters: ?color=red&brand=nike&size=10 I'd like to use URL segments instead and rewrite the request to the ...
Daniel Dewhurst's user avatar
2 votes
0 answers
69 views

Woocommerce - Move product without price a the end

I search to split my woocommerce product loop in two part first product with price and after product without price. How can i achieve that with a pre_get_post without order product by price (I want to ...
Julien Pidou's user avatar
2 votes
0 answers
835 views

How to Add Product Variation with Multiple Images via WooCommerce REST API

So I've seen in the api that u can send via CURL or PHP library 1 image in variations. But you cannot add more than 1. Like we have Black, Blue and they both have 4 images. But when u select the ...
user170869's user avatar
2 votes
2 answers
1k views

Show post page only if the user has bought a specific product

I'm having troubles with Woocommerce. I need to sell videos. I've created virtual products with a link to a different post for each (no download as I prefer to embed the video on my website and to use ...
Lia Muscogiuri's user avatar
2 votes
0 answers
5k views

Woocommerce change tax rate programmaticly

We sell a combination of multiple products as one product, these products can't be added separte to WordPress so we use a normal product type for the combination. These products have seperate tax ...
FamousWolluf's user avatar
2 votes
1 answer
1k views

How to delete all customer user account that haven't placed a single order?

Recently I've had an influx of spam users registering on my Wordpress website and I am trying to delete them all if: they have a "Customer" role haven't placed at least one order before As I could ...
ignite-me's user avatar
  • 121
2 votes
0 answers
73 views

How to search Woo Commerce products with punctuation in title?

How do I modify the default WooCommerce Product search so that products with punctuation in the title can be found without including the punctuation in the query? For example, if I have a product ...
Collin's user avatar
  • 21
2 votes
0 answers
294 views

Can't create term for product attribute

Please help. I need to create product attribute term after I create a product attribute taxonomy. wc_create_attribute([ 'name' => 'Size', 'slug' => 'size' ]); // This will only work If I ...
Rojan's user avatar
  • 31
2 votes
0 answers
843 views

How to Change WooCommerce Variable product pricing by SKU or visible children id

I'm trying to Change WooCommerce Variable product pricing by SKU or visible children id. When I see the Variable product information by using this Code : $product = new WC_Product_Variable(49); $...
javmah's user avatar
  • 51
2 votes
0 answers
2k views

Woocommerce query specific product from specific category

I'm trying to create a shortcode that will show a woocommerce product via just a shortcode. I want the shortcode to take 1 parameter that is either the ID or slug of the actual product. Preferably ...
Lz430's user avatar
  • 137
2 votes
1 answer
656 views

Woocommerce and different checkout field for different countries

I am considering to migrate from Magento to Woocommerce. My main site is for Japan, and the other is in English. I read you can go for either WPML or multisite. I understood WPML can handle multi ...
rtk0407's user avatar
  • 121
2 votes
2 answers
1k views

How To Change The Html of Products filtration sidebar in Woocommerce?

I have Used the function dynamic_sidebar('sidebarId') in the sidebar.php file. and all the functionality of the sidebar is Working succsessfully My Question is How To Change the Html of the sidebar ...
Ali Beshir's user avatar
2 votes
0 answers
435 views

Is it possible to cache ?wc-ajax=get_variation

I have been trying to figure out a way to make this work for awhile. I have a site, pizza shop. It has a promo, two pizzas. The product is any 2 or 15 types of pizza. I have the 15 types of pizzas ...
RoadPaperWeight's user avatar
2 votes
0 answers
2k views

Create WooCommerce custom stock option that is non-purchasable

I've been able to add a new stock option (Call for Availability) in the admin of WP for Woo and it successfully shows on the front-end of the site as well with the following code (using this as my ...
kdc's user avatar
  • 21
2 votes
0 answers
151 views

How to automatically add and show all the product attributes when creating a new product

I'm probably gonna be yelled at for this one. I have gone through some posts here, which seem to be the same issue (or almost on the same lines), But I didn't get anything out of them. Since, some are ...
Manas Laungani's user avatar
2 votes
2 answers
846 views

How To add custom radio boxes to WooCommerce Billing page and change total price by this field?

Lets say i need to add custom radio fields ( company or person ) at the top of the form to the billing for. And if the visitor checks person they should pay 21% Tax and they select company that is ...
Юксел Османов's user avatar
2 votes
0 answers
3k views

Woocommerce update product price via AJAX

I'm trying to update price of a product added to CART. I can easily change quantity in the CART, but price doesn't work at all. function total_count($cart_object){ $total_cart = intval($_POST['...
Mateusz Winnicki's user avatar
2 votes
0 answers
3k views

WooCommerce: update custom fields after checkout validation failure

In my project I'm customizing some of the WooCommerce features. My "shipping methods" are: 1. delivery 2. take away I also added a custom field in the checkout page that is a <select> populated ...
j.c's user avatar
  • 121
2 votes
0 answers
109 views

Woocommerce Pre Orders - Can i override templates?

I need to override the woocommerce pre-order plugin templates. I tried the same method that woocommerce uses to override plugins (copied the templates folder into my theme folder) but nothing ...
Nick's user avatar
  • 167
2 votes
0 answers
4k views

Add attribute / custom attribute to product in woocommerce

I have products from some API and want to insert these products. I was able to insert products and use already existing attributes ( or added by UI ). Adding new term (My Color) to the existing ...
Bilal Halayqa's user avatar
2 votes
0 answers
1k views

Add multiple attributes to product from php

I'm trying to update a WooCommerce product entry with data from an API, where the values from the API match taxonomy terms I've created in my WordPress site. For most fields this works, but I have ...
Jan Henckens's user avatar
2 votes
2 answers
788 views

Outputting an array of term meta values in a custom WooCommerce tab?

Forgive me – my Wordpress/PHP skills are hilariously rudimentary, so I may not use the correct terminology. I have added a custom tab to the WooCommerce single product page and need it to display a ...
ninox boobook's user avatar
2 votes
0 answers
467 views

XML sitemap over product variations

So i have a smaller webshop, that contains a lot of products - and some of those products have variants - like blue, yellow, red and so on. But the thing is that Yoast SEO's sitemap generator only ...
Mac's user avatar
  • 313
2 votes
1 answer
78 views

Adding extra one email address who receives email as admin - woocommerce

Is there any way for Adding extra one email address who receives email as admin.There are many ways I found but that sends cuatomar mail...but I need to send like a mail admin receives.This extral ...
Muaz Hesam Musa's user avatar
2 votes
1 answer
100 views

How to build wordpress site which will have location based services & products?

Even though I could use woocommerce for services & products, how to add location to them? I want users to select their location first, then only products & services will be shown.
dhiraj's user avatar
  • 33
2 votes
1 answer
2k views

woocommerce featured products and categories

I am working with woocommerce at the minute, and the design requires to show a number of featured products and categories in a number of different styles. For example one featured product needs to ...
sico87's user avatar
  • 209
2 votes
0 answers
906 views

woocommerce target button with class after ajax update

I'm working on a eshop using woocommerce. I have an add to cart button with class "single_add_to_cart_button", and a variations select list with 3 sizes. When I select a size which is unavailable, ...
user2882154's user avatar
2 votes
0 answers
2k views

Trigger Woocommerce New User Email

I wrote a custom plugin that handles login and registration for my WordPress Woocommerce site. When a user registers via my custom form handler I would like to trigger Woocommerce to send the new ...
Joshua Wieczorek's user avatar
2 votes
0 answers
2k views

Add a custom field to top attribute in WooCommerce

i kinda went crazy trying to solve this. I need to add a custom select field (and save it) to WooCommerce Attributes edit / insert new page - in each top level attribute - not the sub "terms"... ...
Sagive's user avatar
  • 2,772
2 votes
1 answer
2k views

Can two products with the same name but different category produce unique URLs?

In the permalinks settings I have /courses/%product_cat%. Using WooCommerce I created two different Courses that are named "English", but they have different categories that end up making my urls look ...
Darren Bachan's user avatar

1
2 3 4 5
33