I’m trying to update the function that handles the upload of the image to variation product ![image variation] https://i.imgur.com/reNn6x7.png I thought that the code that handles it is : inside the class-wc-rest-product-variations-controller.php but any modification at this function is not changing the…
Tag: wordpress
Why is my autoloader loading every class in my wp install?
Ive been working on a wordpress plugin and Ive had to extend a class in another file, something I’ve not done before. So this has got me into using an autoloader. To give you some idea of my folder …
Product custom checkbox option that changes Woocommerce cart item price
The following code displays a custom checkbox before add to cart button on single product pages: Now I would like to trap/capture this checkbox option in Woocommerce session and then make a custom price calculations in the following code: What is missing is the part that will capture the checkbox option to se…
How to remove first few letter and print the last title in php
I have got the permalink and the page title. I need to remove the only permalink and print the title in using PHP. Here is code: $string = “http://example.com/blog/PageTitle” From here remove the …
I want to remove text between fifth and sixth occurrence of “/” [closed]
This is url stored in variable https://photoland2.etrafficgroup.com.au/frames-and-albums/frames/wooden-frames/106-a3-297-x-42cm-2/product/555-black-wooden-frame-with-gold-stripe-a3-42×29-7cm-size-1-…
How would I correctly parse this PHP?
I know the PHP part of this code is wrong but I can’t figure out how to write it correctly. Can someone give me a hand? function add_last_nav_item($items) { return $items .= ‘
<a class="…
While Loop displays arguments inside the first argument
I have a while loop created to display all my wordpress posts. The issue is that all the posts (except the first) appear inside the first post. I’ve check my div structures and I couldn’t find any …
Is it possible to extend the woocommerce products rest endpoint?
Is there a way to extend the products-object in the woocommerce rest api /wp-json/wc/v3/products, in a non-destructive way, so plugins that uses that endpoint, doesn’t break. I’ve currently tried create my own rest endpoint to replicate the object, but that is now missing alot of data ofc. I’…
WordPress pagination does not go to last page
I am trying to use a custom WP_Query for my loop in order to limit the number of posts that I show per page. However, the pagination functions doesn’t seem to respect this limit that I set. Here is my …
Get WooCommerce product purchase date from a product Id for a user Id
I have faced a problem. I need to get a specific product purchase date using the user id and product id. Using “Checking if customer has already bought something in WooCommerce” answer code, it checks …