I need to display a product in a specific template. Here is the template code:
WooCommerce get_cart() on null
Before I updated to WC at 4.3.1 ,I had this code and it worked well add_action( ‘rest_api_init’, function () { register_rest_route( ‘px-module-woocommerce’, ‘/px/cart’, array( …
How to get Order Details from a WC_Subscription instance Object
This one for completed initial subscription payments and subscription renewals. And this one for when a status is changed, so I can handle manual and system changes either manual overrides or failed/pending/active/whatever status based of payments or switches. Answer To get the Order details from the WC_Subscription Object, you will need first to get the parent ID (which is the
Display barcode of each product on the invoice or delivery note, woocommerce
I need to display the barcode of the product on the invoice or delivery note, I try to do it with this code but it does not show the barcode image: <?php echo get_post_meta( $product_id, '…
WooCommerce buy one get one 50% off, excluding a product variation
I am using WooCommerce discount: buy one get one 50% off with a notice answer code, if customer purchases a specific product, customer get 50% discount off on the 2nd item. Now If the targeted product id is a variable product with for example 3 variations “A”, “B” and “C”, how can I exclude for example the variation “A” from
Prepend SVG icon before WooCommerce message
I want to prepend an SVG icon to the Add to Cart message in WooCommerce, but for some reason the SVG is not shown in the message. I have the following code in my functions.php file: function …
How can I exclude Taxes From a custom COD Surcharge in WooCommerce?
I’m wondering how can I exclude the Cash on Delivery Surcharge from Taxes? I have used Add fee for Cash on delivery payment method (cod) in Woocommerce code to add the COD Surcharge I want to have this charge excluded from VAT & no VAT/TAX shall be applied to it. Any help will be appreciated. Answer To have that COD
Get a product from specific product attribute term name in WooCommerce
I’m trying to create a WooCommerce shortcode to display one product with some information. Every day there is a new product with attribute DAGAANBIEDING and value JA or NEE. I only want to show that …
How can we display current user display name with shortcode?
I got this shortcode function to work to show current user display name, but now for some reason it is displaying the user’s first name. Is there another way to get current user’s display name and output it with shortcode? Answer If you go to a user’s profile (User’s > All users > search for the user you want) then
Display “In Stock” notice for WooCommerce variations with no Managed Stock
I need help for a particular situation. In WooCommerce, if “Manage Stock” is enabled for a simple product or variation, then a notification is being displayed in the product page => such as [this example][1] However, if “Manage Stock” is not enabled, then there is no notification which I find it a pity because I still want to inform my