I have 3 ticket products in WooCommerce and want to add a name field per ticket product purchased – so if a customer buys three tickets 3 name fields are displayed to fill out in the checkout. The code below works: But this includes all products added to cart – how can I target specific Product IDs to be only
Tag: cart
WooCommerce: Get $cart_item in price function
I’m using a custom function to change the style of the product price. This is my actual function: It works fine on product detail pages if I want some meta fields from the product. I can get these meta fields if I use global $product and go from there. The problem is, that global $product throws an error if used
Add Term Meta from Custom Taxonomy to Cart Item
What I’m trying to accomplish is adding term meta from a custom taxonomy that is attached to a product and display it on the cart/checkout/ order details/email notification. I’m not the greatest at this but know enough to get by. What I’m using is the ‘Perfect Brands WooCommerce’ plugin that adds in the “pwb-brand”. I’ve also added in my own
Disable payment gateway based on number of items and product category in WooCommerce cart
I am using the following code, which allows me to set a minimal quantity of products in cart to proceed payment Is there some option to exclude some specific category? For example: I need to set the minimum quantity for one order for 6 pieces of goods (applies to all categories). For one category of products (ID 2), however, I
Multiple bulk dynamic pricing for WooCommerce products with specific product-tag
My intention is to add multiple bulk dynamic pricing for WooCommerce products with specific product-tag. I use the slug “petit-format” on my code. Based on Bulk dynamic pricing for WooCommerce products with specific product-tag answer code, this is my attempt: But I only have the first discount that works, but the other one doesn’t. So the $discount1 works, but the
In woocommerce show the check payment option when an order total is 0 dollars
On my wordpress, woocommerce website I am trying to add something to the function.php of my theme that will enable the pay with check option if the order total is 0 dollars. what I have so far: Obviously set isn’t correct, but I am not sure what to use in place of it. Answer Since the total order is 0
Add to cart validation based on product attribute in WooCommerce
I’m trying to add a filter when a customer adds a product to the cart, to allow it or not. We just need to compare one attribute of the WooCommerce products. If cart is empty : Add to cart ok If cart has 1 or more items : check Attribute XXX value of products If Attribute value is the same
Add a specific word next to quantity input field for specific products on WooCommerce cart page
I have two products – ‘counseling’ and ‘testing’, and I want to display a specific word (‘sessions’ and ‘testings’) next to (or under) the quantity input field for each of them on the shopping cart page, but I can’t find a hook for this. How this can be achieved? Right now I display a generic word (‘items’) for both products,
Automatically add a percentage discount if WooCommerce cart contains at least X products
I am trying to create an automated discount that kicks in when and if the cart contains a minimum of three products or more. If and when that is, a discount of 10% should be given no matter if the customer is logged in or not. This is the code I’m trying to get to work (without success). Answer It
WooCommerce cart items price suffix for specific product category
I need to add a suffix text to the price of a woocommerce product from a specific category while on WooCommerce cart. Here is my code: The problem is it only works on simple products. Doesn’t seem to affect the prices of variable products (I tested on 3 different sites). Any idea what I’m missing? Answer To make it work