Category: Woocommerce

Professional and affordable website design. Based in King's Lynn, Norfolk.

How add a fee or charge to the cart for Woocommerce Virtual Products

Add the following to your theme’s functions.php file changing $specialfeecat = 86 to the ID of your category and $spfeeperprod = 0.05 to the amount that you want to add. Also change ‘Ticket Concierge Charge’ to the text that you want to describe the additional fee or charge. function df_add_ticket_surcharge( $cart_object ) { global $woocommerce;…
Read more

How to rename the coupon field on the Woocommerce checkout page

// rename the coupon field on the checkout page function woocommerce_rename_coupon_field_on_checkout( $translated_text, $text, $text_domain ) { // bail if not modifying frontend woocommerce text if ( is_admin() || ‘woocommerce’ !== $text_domain ) { return $translated_text; } if ( ‘Coupon code’ === $text ) { $translated_text = ‘Enter custom text for Coupon code box here’; }…
Read more

How to rename the “Have a Coupon?” message on the Woocommerce checkout page

// rename the “Have a Coupon?” message on the checkout page function woocommerce_rename_coupon_message_on_checkout() { return ‘Your custom text here’ . ‘ ‘ . __( ‘Click here to enter your code’, ‘woocommerce’ ) . ‘‘; } add_filter( ‘woocommerce_checkout_coupon_message’, ‘woocommerce_rename_coupon_message_on_checkout’ );

How to remove Company Details and other fields Woocommerce checkout

Simply paste this into the functions.php file for your theme but remember to delete those fields (lines) below those that you still want to appear on the Checkout page: // remove Order Notes from checkout field in Woocommerce add_filter( ‘woocommerce_checkout_fields’ , ‘alter_woocommerce_checkout_fields’ ); function alter_woocommerce_checkout_fields( $fields ) { unset($fields[‘billing’][‘billing_first_name’]); // remove the customer’s First Name…
Read more

How to change Ship to a different address? Woocommerce

Simply paste this into the functions.php file for your theme: // Change words Ship to a different address add_filter(‘gettext’, ‘translate_reply’); add_filter(‘ngettext’, ‘translate_reply’); function translate_reply($translated) { $translated = str_ireplace(‘Ship to a different address?’, ‘The words you want instead go here’, $translated); return $translated; }

How to personalise the discount message Woocommerce cart

Want to personalise the discount code on the checkout page of Woocommerce? Simply download cart.php via FTP from plugins/woocommerce/templates/cart and look for <?php esc_attr_e( ‘Coupon code’, ‘woocommerce’ ); ?> within line 128. The words ‘Coupon code’ can be changed to whatever you want them to be.