Mindblown: a blog about philosophy.
-
How to add or remove coupons dynamically based on cart total, on WooCommerce
Imagine the scenario where we have 2 coupons, one (5off) that gives $5 discount to the total client order, as well as a coupon (10off) that gives $10 discount to the total client order. When the user inserts any of the coupons in, we want the $10 off coupon to apply only if the total…
-
CF7 to Salesforce integration programatically
In this tutorial, you will learn about how to create leads in Salesforce programmatically, without the use of plugins. This tutorial focuses on integrating Contact Form 7 to SF using the Web-to-Lead method. The full code can be found at the end of the tutorial. If you are interested in a different integration please let…
-
How to remove update notifications for all users except admin
In WordPress we can remove update notifications from all users except specific roles, by username or by user ID. Below you can find a few examples that you can insert into your functions.php file.
-
How to make fields required programatically in Contact Form 7
In this guide, you will learn how to create custom validation in CF7. This guide is also the solution for programmatically making fields required. Contact Form 7 uses the validation server-side, which means we need to hook into the PHP functions/filters in order to create custom validations.
-
Debug Pending Updates
If your WordPress site shows you have an update available, but none can be found in themes or plugins, you can use this snippet to debug the issue.
-
How to hide WooCommerce products from search by category
I found myself in the situation where I had to give the client the possibility to hide some of their products from search, so they can manually send the product urls to their clients. The way I got around it at the time was to create a product category called Hidden and use the snippet…
-
How to generate a simple random password in PHP
As I often work with APIs for our clients, I often need a simple password generator that creates a random password using numbers and letters, both lowercase and uppercase. The function below is a simple example.
-
How to generate a future date in PHP
Often I find myself wanting to generate a date in the future, for instance, this time next year. Using the single function below I am able to achieve that.
-
How to change the “add to cart” text on the WooCommerce buttons
Sometimes you might want to change the “add to cart” text of the buttons on your WooCommerce setup. This is very easy to do, and all you need is to copy-paste this snippet inside the functions.php file of your theme (or child theme)
-
Move Yoast SEO to the bottom
If you, like us, build WordPress templates using ACF, you may have found yourself wanting to move the Yoast SEO section all the way to the bottom. The plugin itself doesn’t provide an option for this, but this little snippet is all you need.
Got any book recommendations?