How to change WordPress default email’s From name and address

You are probably reading this post because have already noticed, that every time someone submitted a comment on your blog, signed up as a user or did anything that required WordPress to generate and send an email, by default the “From Name” in that message appeared as “WordPress” and “From” address was “wordpress@your-domain.com”. If this[…]

WooCommerce – Change “Proceed to PayPal” Text on Checkout button

add_filter( ‘gettext’, ‘custom_paypal_button_text’, 20, 3 ); function custom_paypal_button_text( $translated_text, $text, $domain ) { switch ( $translated_text ) { case ‘Proceed to PayPal’ : $translated_text = __( ‘NEW BUTTON TEXT’, $domain ); break; } return $translated_text; } That’s all !! Views (453) [Total: 1    Average: 2/5]

WooCommerce – Allow only one product in Cart

This snippet can be used for many ways. For instance, your store only allows to buy one product at a time such as “Buy Now”. Open functions.php under your activated theme and put the code below: // Only one product in cart add_filter( ‘woocommerce_add_cart_item_data’, ‘only_one_product_in_cart’ ); function only_one_product_in_cart( $cart_item_data ) { global $woocommerce; $woocommerce->cart->empty_cart(); return[…]

Customised WordPress Admin Filters in the backoffice

Creating the Select Drop Down Using the ‘restrict_manage_posts’ Filter The first thing that needs to be done is the creation of the select drop down for the two additional filters we will be making. You will need to navigate over to your child themes functions.php file (or another applicable file) and add code which will[…]

WooCommerce – Redirect to a custom page after logging out

By default, WooCommerce will redirect customers to the My Account page after logging out. However, you may want them to go somewhere else – here’s how. Firstly, you’ll need to make sure that you are overriding the default WooCommerce template files in your theme. If you’ve already got a woocommerce folder in your theme’s directory,[…]

WooCommerce – Redirect to a custom page after logging in based on the user role

By default WooCommerce redirects the user to the My Account page after a successful login. You may change this and use a custom URL based on the user role, like the Dashboard for admins and My Account page for customers. To do this, add this code at the end of the file functions.php located in[…]

WooCommerce – Redirect to a custom page after logging in for All Users

Sometimes you may want to send users to a unique or custom URL after logging in through WooCommerce. No need for additional plugins or complicated code. Just add the following code to the custom functions area of your functions.php file. // Custom redirect for users after logging in add_filter(‘woocommerce_login_redirect’, ‘wcs_login_redirect’); function wcs_login_redirect( $redirect ) {[…]

WordPress – Script(PHP) to convert MySQL collation from utf8mb4 to utf8

If your MYSQL database import fails with Unknown collation: ‘utf8mb4_unicode_ci’ after the latest WordPress update 4.2.2, chances are that you are running a MYSQL server version 5.5.2 or below. With the most recent update, WordPress changed their encoding standard from utf8 to utf8mb4, which is only supported starting with MYSQL server version 5.5.3. This can[…]

WooCommerce – How to change “Add to cart” button text, Tips & Tricks

I’d like to share how to change “Add to cart” text of the WooCommerce. Change the add to cart text on product archives Add the following to your functions.php file under your activated theme. WooCommerce <2.1 WooCommerce 2.1+ Change the add to cart text on single product pages Add the following to your functions.php file[…]