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( …
Tag: wordpress
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_Subsc…
Adding PHP code to display dateline in all posts for WordPress
I run a WordPress site, and I’d like to print a dateline (ex: “July 22, 2020 at 1:05 p.m. EDT”) under the featured image at the top of each post, a time of the post’s initial publication. Though datelines are common in news sites and blogs, my theme doesn’t present them as option…
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”, …
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 …
WordPress theme functions.php not used for non-loggedin users
I’m trying to create a function to redirect users to the login page if they are not logged in for some pages, this is my code: As it didn’t work and I tried every simplifications I tried to add a print “hello” at the beginning of the parent and child theme functions.php nothing is prin…
Number of Posts – Display number (x of x), if number is less than 4 ( 4 is the post_per_page)
I am showing 4 custom post type posts per category on a parent post type archive page with category rows. I want to show the count of the category posts ($list->found_posts), but I am limiting the displayed posts to a random 4 posts. I have successfully displayed the total number of posts for each category…
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…
Sorry, you are not allowed to create posts as this user using curl request php
i am using curl request to make post in wordpress site every thing were working fine from 2 years suddenly wordpress curl stop working. 1 i updated the htaccess to and try every possible solution but no luck 2 i install wp basic authentication but it does not work 3 i install jwt authentication plugin but no …