I want to change automaticly user role to Premium after 3 completed orders Spending minimum 500 cash in one order I found on internet this two code snipets : And this one to access order history: Source: Checking if customer has already bought something in WooCommerce How I can tweak them to make it work ? Th…
Tag: wordpress
Dynamic custom order numbers based on payment method
I have the following code in my functions.php file: The code works but I want it to permanently save the new order number. It should permanently make CHEXXXX (ex. CHE5783) the order number in the database if the user checked out using check payments. Right now this code only makes it temporary. It does not ne…
One page to handle different URL with parameters
The solution is probably very simple, but still, I am struggling to understand how to make it work. We are preparing for the new school year, and of course, we’re required to make things work remotely. We will have a bunch of educational videos posted on Youtube, and an external Windows app will make su…
Remove read more button for out of stock item
Ive been strugling with removing a “read more” or “beri dalje” button from my website. The website in question is www.fotroviciliji.si . I can locate it and hide it in chrome investigator but not via global css or using php in functions.php. The button has a class name btn border-grey …
Create a wordpress update query with an associative array done by a for or foreach loop
I want to create an associative array by a loop to add it in a update. The problem i have is that i dont know how to go through each element of the 2 arrays for creating an associative array to put in the update query. You can see down here i put the array inside another array in the
date_i18n function shows today’s date instead of provided date
I’m triying to display the a span of dates from starting date to ending date in WordPress in a custom snippet to list events on our website. There are two custom fields relevant for this problem: event_date: shows the starting date of the event (using date picker) event_date_end: shows the ending date o…
Is it possible to change a WordPress/woocommerce title that is written with uppercase to appear capitalized?
I am currently working on a project that is based on WordPress and as an e-commerce platform, it uses WooCommerce. I made a product migration from an old site that has the product titles written in uppercase. Currently I have this html code for the titles inside a product: So I want the product title to appea…
PHP condition with HTML/PHP putput
I running WordPress site and I want to show something only if post format is quote. I have following code but it give fatal error: Answer It looks like you have a syntax error in your code. Try simplifying your code as follows: If you still get the Fatal error, share the error with us. It will help point us
How do I display 3 recent posts in footer with Timber?
So, I am beating my head over this for 2 days now. How do I display 3 recent posts in footer using Timber and Twig? I am using a starter theme from Timber. What I did inside my footer.php file: And inside my footer.twig I tried displaying them: Now the problem is it displays nothing. If I replace featured wit…
WooCommerce – Remove product title from breadcrumbs but keep all category hyperlinks
I’m using the following function to remove the product title from the breadcrumbs displayed on the product page: add_filter( ‘woocommerce_get_breadcrumb’, ‘ed_change_breadcrumb’ ); function …