I would like to display SKU on cart (Under product column ) and checkout page. I searched SO, but all answers are for old versions of WooCommerce and non of them is for 3.x. How can I show SKU on cart and checkout pages in Woocommerce 3? Answer 2021 Update You can do it with a custom unction hooked in
Tag: cart
Conditionally add a subscription when product added to cart in WooCommerce 3
Hi Im looking for a code that adds my subscription ID (2282) to cart if there is added a normal product but NOT if the user is already subscriber. Feel free to ask questions. I’m in the GMT+1 time zone Wordpress – 4.8.1 WooCommerce – 3.1.1 WooCommerce Subscriptions – 2.2.11 WooCommerce Memberships – 1.8.8 Theme – Shopkeeper – 2.2.3 i’ve
Change WooCommerce variable product title based on variations
I’ve coded in a custom select box to a group of my products that changes the price based on the user’s selection. It works well, but now I need to change the product title too based on their selection. Basically if option 1 is chosen, the product name stays the same. But is option 2 is chosen, I need to
how to get particular product quantity from the cart page in the woocommerce
With this code: foreach ( WC()->cart->get_cart() as $cart_item ) { $quantity = $cart_item[‘quantity’]; echo $quantity; } I can get the quantity of all the products added in cart but I …
woocommerce_cart_calculate_fees load after woocommerce_before_cart_table
I have a problem trying to do some calculations with woocommerce_before_cart_table custom values and passing them to woocommerce_cart_calculate_fees. The problem is that woocommerce_before_cart_table is loading first and I am not able to pass that values from woocommerce_before_cart_table to woocommerce_cart_calculate_fees hook… How can I pass that calculation on woocommerce_cart_calculate_fees hook? Thanks Answer So If I understand you are making some test
How to update cart options in LaraveShoppingcart by Crinsane
I’m using laravel cart by Crinsane https://github.com/Crinsane/LaravelShoppingcart I wanna update options cart, I have many options inside, but I just want only one option to change, and I cannot do it Here’s my code and then I want to change options Here’s my code and then the result options only item_code, and others are disappear I want the others options
WooCommerce Check stock of product ID before adding
I have some custom code in my WooCommerce site that adds a product to the users cart. I already have it check the cart contents to make sure there is another product in the cart first, but I also …
Counting cart-items of specific product category
I am trying to get the number of items in the cart just from a specific product category in WooCommerce. I am doing a site for a winery. It has alcoholic and non-alcoholic products. All the wine falls under the main category of ‘wine’ or category id 34, with many subcategories and products underneath them. For any thing that falls
Adding a promotional product when a certain cart amount is reached
I am looking for the right hook in WooCommerce because I need to add a promotional product to the cart when a certain cart amount of is reached, such as 100 conventional units. I have also used the …
Disable add to cart button for an array of products IDs in WooCommerce
In WooCommerce, I’m trying to disable add to cart button for an array of product IDs but I can’t find the problem. I am trying to use this function: And this is my check() function code (update): But this doesn’t work. What am I doing wrong? Thanks Answer Updated for WooCommerce 3+ Use in_array() instead like: Where not_purchasable_ids() is the