I want to add an extra class to the cart table row if the product is free (price of 0). I do have a way to add an extra class: The problem is, that I cannot access $cart_item in the function. I made a var_dump for $values and found the product ID in it. Is there any way to get
Tag: wordpress
Data not insert and update through ajax and jQuery in admin page?
I made custom plugin and done crud operation, display all data in admin page, used ajax and jquery. Data successfully deleted but not inserted or updated. Data successfully pass through ajax but not inserted. Also What I saw if input block is empty and I put some data and updated it. It got first row data. Er…
Add_filter to add new column to Woocommerce product attributes table (Attributes add / edit page)
I would like to add a new column to the Attributes table on the Attributes add / edit page within Woocommerce / WordPress admin, using the WordPress / PHP add_filter command. As a reference, to add columns in WordPress admin to the Woocommerce All Products add / adit table, the following filter works: add_fil…
Any hook in WordPress that runs after session is started?
I need to set a session value in my plugin, but session isn’t started when WordPress loads my plugin and I don’t want to run if (!session_id()) session_start(); manually, because other plugins might rely on setting cookies, etc and face a “headers already sent error”. Is there any hook…
WordPress debug – call_user_func_array() expects parameter 1 to be a valid callback
I’ve just updated my WordPress to a new version & I’m getting this error: Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ‘restrict_admin’ not found or invalid function name in /home/burngeopk/public_html/members/wp-includes/class-wp-hook.php on…
Get weight value from WooCommerce variations of a variable product
I am working on a plugin that auto adjusts product prices. All of my products are variable products which has made this tougher than I can solve. I have a check to make sure the product is variable. The only product Attribute is ‘Size’. Here I have 4-8 different Size Variations per product. Each o…
Query database for last modified date
I am trying to query my WordPress server to echo the date of the last modified post. In this case the database name is local and I am checking the posts table. My current code is close to what I need, it will display the date and time as Y-m-d H:i (2021-01-13 12:18) How do remove the time and display
My wordpress website shows wamp server detials when clicking on each page except home page
I downloaded my website from server to configure in local server, after that I did search and replace. Now the website shows the home page but when I click on each page it shows wamp server details. I do not know how to handle this problem. I have read that go to dashboard, setting, permalink and then save bu…
Add and display custom cart item data in WooCommerce orders and emails
I have a custom woocommerce product type called lottery. I needed a custom select field on it (because it’s not a variable product) So I added one. Everything is working nice i’m getting the value in the cart and in the checkout too, but I cannot get the value in the admin order or in the order ma…
WordPress the_permalink() closes tag?
Hellow, im trying to code a custom theme for my wordpress site. im trying to output 5 of my posts and i want to wrap them into a link. however when i foreach() through the posts and want to wrap my …