WooCommerce Tips

Move email form to top of WooCommerce checkout page

Add the following PHP code to your child theme functions.php file. [php] /* Move email form to top of Woocommerce checkout page */ add_filter( 'woocommerce_billing_fields', 'custom_woo_move_checkout_email_field', 10, 1 ); function custom_woo_move_checkout_email_field( $address_fields ) { $address_fields['billing_email']['priority'] = 5; return $address_fields; } [/php]

read more

Hide Coupon Code Area on WooCommerce Cart Page

Add the following PHP code to your child theme functions.php file. [php] // hide coupon field on the cart page function disable_coupon_field_on_cart( $enabled ) { if ( is_cart() ) { $enabled = false; } return $enabled; } add_filter( 'woocommerce_coupons_enabled', 'disable_coupon_field_on_cart' ); [/php]

read more

Show Product Thumbnail on WooCommerce Checkout Page

Add the following PHP code to your child theme functions.php file. [php] /** * Show product thumbnail on checkout page. * * @see {templates|woocommerce}/checkout/review-order.php */ add_filter( 'woocommerce_cart_item_name', 'jfs_checkout_show_product_thumbnail', 10, 2 ); function jfs_checkout_show_product_thumbnail( $name, $cart_item ) { if ( ! is_checkout() ) return $name; $thumbnail =...

read more

How to delay WooCommerce Emails

You may find this helps speed up the checkout process by delaying the WooCommerce order emails from sending immediately at checkout. Add the following PHP code to your child theme functions.php file. [php] // delay woocommerce emails add_filter( 'woocommerce_defer_transactional_emails', '__return_true' ); [/php]

read more

eCommerce with WooCommerce and WordPress – What you need to know

Here are some thoughts, ideas and tips that may help you on the way to building your own eCommerce website with WooCommerce and WordPress. What does it cost? I guess it comes down to the level of game you want to play. If you want to do things on the cheap, then expect to get a similar ROI. When I say cheap, I'm talking about $1,000 or less. If you cannot budget at least $2,000 to build an...

read more

How to customize WooCommerce messages on cart and checkout pages

Add the following CSS in the Divi theme options area and customize however you like. [css] .woocommerce-error, .woocommerce .woocommerce-error, .woocommerce-info, .woocommerce .woocommerce-info, .woocommerce-message, .woocommerce .woocommerce-message { padding: 1em 2em 1em 3.5em !important; margin: 0 0 2em !important; position: relative !important; background-color: #f7f6f7 !important;...

read more

How to change “Create an account” text in WooCommerce / WordPress

If you want to change the text that appears on things like the WooCommerce "create an account". You can use the same code and replace the variable "woocommerce" for other items. Try the simple code below and it may work for you. Add the function below to your child theme functions.php file. [php] // change text from Create an account? function my_text_strings( $translated_text, $text, $domain )...

read more

How to change the word “Sale” on the WooCommerce sale badge

Add the function below to your child theme functions.php file. [php] // change Sale to Save on the sale badge add_filter( 'woocommerce_sale_flash', 'wc_custom_replace_sale_text' ); function wc_custom_replace_sale_text( $html ) { return str_replace( __( 'Sale!', 'woocommerce' ), __( 'Save!', 'woocommerce' ), $html ); } [/php]

read more

How to replace Howdy message in WordPress

I'm guessing someone in Texas had something to do with the word "Howdy" being the welcome prefix in WordPress. It's easy enough to change. Add the function below to your child theme functions.php file. [php] /* replacing Howdy with Hello */ function howdy_message($translated_text, $text, $domain) { $new_message = str_replace('Howdy', 'Hello', $text); return $new_message; } add_filter('gettext',...

read more

How to add search fields to WooCommerce orders page

You may find it useful to have additional search fields in the WooCommerce orders page in the WP admin area. Add the function below to your child theme functions.php file. [php] /* add search fields to woocommerce orders page Allowed search fields: _order_key _billing_first_name _billing_last_name _billing_company _billing_address_1 _billing_city _billing_postcode _billing_country _billing_state...

read more

How to prevent hidden WooCommerce products from showing up in WordPress search results

Add the function below to your child theme functions.php file. [php] /* Preventing Hidden WooCommerce products from showing up in WordPress search results */ if ( ! function_exists( 'gamma_search_query_fix' ) ){ function gamma_search_query_fix( $query = false ) { if(!is_admin() && is_search()){ $query->set( 'meta_query', array( 'relation' => 'OR', array( 'key' => '_visibility',...

read more

How to add Order Again button to WooCommerce My Account / Previous Orders page

Add the function below to your child theme functions.php file. [php] /** * Add order again button in my orders actions. * * @param array $actions * @param WC_Order $order * @return array */ function cs_add_order_again_to_my_orders_actions( $actions, $order ) { if ( $order->has_status( 'completed' ) ) { $actions['order-again'] = array( 'url' => wp_nonce_url( add_query_arg( 'order_again',...

read more

How to add alt tags to WooCommerce product images

Add the function below to your child theme functions.php file. [php] // adding alt tags to product images add_filter('wp_get_attachment_image_attributes', 'change_attachement_image_attributes', 20, 2); function change_attachement_image_attributes( $attr, $attachment ){ // Get post parent $parent = get_post_field( 'post_parent', $attachment); // Get post type to check if it's product $type =...

read more

How to update WooCommerce order status to processing when an order is placed using PayPal

How to update WooCommerce order status to processing when an order is placed using PayPal. Add the following PHP code to your child theme functions.php file. [php] function update_wc_order_status($posted) { $order_id = isset($posted['invoice']) ? $posted['invoice'] : ''; if(!empty($order_id)) { $order = new WC_Order($order_id); $order->update_status('processing'); } }...

read more

How to change the “Proceed to PayPal” button text on the WooCommerce checkout screen

The default PayPal buttons says "Proceed to PayPal". You may want to change this to something else like "Continue to Pay" or whatever you like. Add the following PHP code to your child theme functions.php file. [php] add_filter( 'gettext', 'custom_paypal_button_text', 20, 3 ); function custom_paypal_button_text( $translated_text, $text, $domain ) { switch ( $translated_text ) { case 'Proceed to...

read more

More Tips

Ask a Question

"*" indicates required fields