Category "woocommerce"

Changing currency on checkout with WooCommerce Multilingual Plugin

I'm trying to implement currency change on checkout with WooCommerce Multilingual Plugin. I need a country with COP and the rest of countries with USD. First I

woocommerce get_order_report_data to show order_item_id

I would like to show order_item_id by get_order_report_data() I can use the array to show product id and order id : array( '_product_id' => array(

Applying programmatically a coupon to an Order in WooCommerce3

I'm developing a plugin that creates an order directly (no cart) and applies a coupon. In version 3.0 of the woo API the function add_coupon() has been deprecat

Woocommerce redirect after add-to-cart error

I have being doing research for a few days but still cannot find an answer. I am using Woocommerce without the Single Product page. So I am using urls like htt

Additional price based on cart item count in WooCommerce

Based on "woocommerce change price in checkout and cart page" answer code that change the total price in checkout page, I have added some extra code to count th

Woocommerce shipping address is empty

the option on the site "Default to customer billing address" is selected but the shipping address is still empty. I tried to fix it with code add_action( 'w

How to skip cart page on woocomerce for certain products only?

I added this to my functions.php file : add_filter ('woocommerce_add_to_cart_redirect', 'woo_redirect_to_checkout'); function woo_redirect_to_checkout() { $che

Filter WooCommerce products with post__in and additional meta queries

I am trying to find products that are on sale (including product variations) in addition to another meta_query of price under X. The wc_get_product_ids_on_sale(

Custom WooCommerce shortcode to display product image gallery

I have been tasked with duplicating a WooCommerce product gallery in an internal page (not a product page). As such, I decided to create a Child theme and write

Woocommerce Show default variation price

I'm using Woocommerce and product variations and all my variations have a default variation defined. I would like to know, how I can find the default variation

Woocommerce set all products to featured products from mysql query

I have a woocommerce store and I try to select from Mysql all products and set them as "Featured" products or set them as Non "Featured" products. I have found

wc_print_notices is not displaying any messages in woocommerce pages?

I have used default woocommerce templates for shop, cart and single page. I have not removed any hooks either but also I am not getting any message. Any Idea?

WooCommerce: Add/display Product or Variation custom field everywhere

Currently using WordPress 5.1.1 and WooCommerce 3.5.7. My WooCommerce store has around 500 products, made up of simple and variable products. Each product natu

WooCommerce Additional Information - if empty, hide

I'm working on an eCommerce project at the moment. I'm using WooCommerce in WordPress. I've got ridden of the product data tabs and displayed product descripti

Custom add to cart button URL for specific product in WooCommerce?

I would like the user to be directed to a certain URL when they click the 'add to cart' button. At the moment I have this: /** * Set a custom add to cart URL

Woocommerce product admin sort by stock

Is there anyway I can sort by stock? Since it reads 'Stock x 30' it would be helpful if I could sort by high or low. Is there any code I can add to the function

Hide specific products from unlogged users based in product category in WooCommerce

I have a certain product category that I only want to offer to logged in users. How would I implement that? So how to hide specific products from unlogged user

Add multiple images to WooCommerce product

How can I assign multiple images to a product in WooCommerce? I've tried: update_post_meta( $post_id, '_product_image_gallery', $image_id); but it assigns o

"properties should not be accessed directly" issue during WooCommerce 3.0 checkout

My log shows a lot of the following messages: order_total was called incorrectly. Order properties should not be accessed directly. This message was added in v

Woocommerce optimize images for mobile

I'm trying to improve pagespeed results for my clients. I'm making an eshop with woocommerce and although I get 90-92% for desktop in the mobile I only have 38-