WooCommerce products showing “Out of stock” message when not actually out of stock

Having an issue with a client website where products are randomly displaying "This product is currently out of stock and unavailable." The thing is that we don't have inventory tracking turned...

WooCommerce Add to cart button error: "choose product options"

In WooCommerce variable.php I have this code: <?php /** * Variable product add to cart * * @author WooThemes * @package WooCommerce/Templates * @version 2.1.0 */ if ( ! defined(...

Woocommerce Grouped Product Table to Dropdown

How do you put grouped product form/table into a dropdown menu in Woocommerce? Some of my products have more than 10 "child products". So the list can be very extensive. Maybe have one quantity...

WooCommerce add to cart validation: prevent add to cart

I have a probleme with woocommerce that im trying to fix for few days. I am creating a website for a guy and he wanted me to add a custom input on the product page, I couldn't do it myself so I...

Woocommerce add custom meta data to checkout page

I'm trying to get this text input field value on the checkout page. For some reason I can't get the data print out on the checkout page. /* Create Text Field */ add_action(...

WooCommerce Empty Cart if User Go to Page or Site Other than Current Checkout Page

I'm not sure if this is right question to ask but still, I did not find any solutions for it. I am trying to create a method where when user go to page/site other than the current Checkout page,...

stop scroll to top after add to cart

I have found posts about stopping scroll to the top after a click, but I could not understand how to implement this in my particular code. When the user clicks on the 'add to cart' button, the...

jquery.serialize() not working from 2nd page using dataTables Plugin

I am trying to submit woocommerce products fields to cart without page refresh. So I am using jquery serialize() to post the form to the cart. The problem is It only works for the 1st page. If I...

Add and manage Product custom upload field in Woocommerce 3

I am trying to add a file upload along with radio inputs in a custom woocommerce page; where all the products are showing in a list view. The Custom Page CODE: <?php /* Template Name: Custom...

Get and Show Variation Image on WooCommerce

I would like to do some changes in my WooCommerce theme and and change the way that Variable product dropdown looks. I would like to show the image of each variation beside of variation's value in...

Woocommerce Cart not clearing

I know there will be this type of questions but i have tried almost all options without luck so i'm asking here. I have issue that cart is not empty in woocommerce after order completed and also...

How to use variation and add-to-cart button outside woocommerce loop

I'm using woocommerce for my website, but as I only have one main product and two accessories (related products), I don't need a classic shop page, neither single-product pages for each of my...

YITH WooCommerce Wishlist: Help me show the first item / product thumbnail within the sidebar widget and wishlist manage areas?

I am using YITH Wishlist within WooCommerce, WordPress. Within an individual wishlist - it displays the image, with 'remove from list', the product title and a link through to the individual...

How to change woocommerce mini cart total (based on product name instead of quantity)?

as per title mention, right now the minicart is showing total based on the total quantity of the products, but not product name (ID). I assume it should be changed under "mini-cart.php" (correct...

Cart empty after add to cart method

I am working on one functionality for WC variable product. It will be ticket with various "levels", for each level another price. User should pick number of tickets he wants, after that form...

WooCommerce Add Product Title to Free Sample Order, Cart, Checkout

I think step 3 is not working. In the Orders section in the backend admin I do not see the product name concatenated to the Free Sample text. It works in the Cart Page, it shows Free Sample (...

Add multiple affiliate links to Woocommerce Variations with custom button text

I have found this piece of code for functions.php it's getting me partway to where I want to be. Code I am using found here Adding affiliate links to Woocommerce variations Website with attached...

Invalid value posted for <variation> WooCommerce after altering variable.php

I have a variable product in a WooCommerce webshop. I am altering /single-product/add-to-card/variable.php for styling reasons. Currently it's inside a table structure that comes out of the box...

WooCommerce custom bacs payment gateway not saving bank account details

I build a plugin-based upon gateway BACS, I followed this guide https://docs.woocommerce.com/document/payment-gateway-api/ I also found some other examples which are used some code from, maybe...

Woocommerce remove button remove the wrong product

I'm coding a woocommerce website. In my shop page I've managed to insert the "remove from cart button" code from the cart page, but when I click on the button, it's the first product (in...

Woocommerce/WordPress BarclayCard Payment Gateway

I'm trying to integrate BarclayCard with a wordpress website. The issue is that everything happens fine/ It's just that on the return URL (notify_url), the redirection from BarclayCard to the...

Check if item is already in cart, if yes, then redirect user to checkout without adding product

I have a wordpress shop, where I sell digital products. What the function should do: User clicks add to cart button. Function checks if the item is already in the cart. If yes: Redirect user to...

Removing or hiding WooCommerce "Return to Shop" button from 'empty cart' page?

I've been trying to remove the "Return to Shop" button from the WooCommerce 'empty cart' page, but without much luck. Closest I've found is the snippet below from 2015, which did work for someone...

Change Woocommerce variable.php from table to div

I am currently customizing (or trying) the yourtheme/woocommerce/single-product/add-to-cart/variable.php in my theme however even though I've tried I can't seem to get rid of the table in the...

How to Customize Cart and Checkout page for Woocommerce?

I noticed when I add to Cart products that have variations, Woocommerce uses 2 templates in Cart or Checkout pages. if the product has only one or two variations, it uses this template as an...

WooCommerce order again and custom item data for price calculation

I have some problems trying to add/get custom item data when a re-order is made. First let me explain a little bit: I am using WooCommerce as a invoice maker mostly, so one of the custom changes I...

Set image thumbnail for order a "Free Sample" on cart page in WooCommerce

I have found "WooCommerce: Order a “Free Sample” @ Single Product Page" on Business Bloomer to create a sample option in the shop for people to order. Question is: how can I make sure also to...

WooCommerce: Change the label of the “Return to shop” button in the empty cart page

I would like to change the text in the "return to shop" button in the empty cart page in WooCommerce I found in this snippet: add_action( 'wp_footer',...

WooCommerce - Custom function for cart validation

I hope you all having a great day. So I'm selling a digital product with WooCommerce but I don't have a shop page or anything, I made an HTML button and inserted it on my landing page and upon...

Add custom uploaded image file to WooCommerce product table and invoice PDF

Hello community, I want to show an image uploaded via custom-field on the product table and finally on the PDF invoice … I use this solution:...