Change "Select Options" Button in Woocommerce

When you drag your mouse over a variable product it says “Select Options” how can we change that to “Click to Order”?

Thank you in advance for your help.

My site is http://8hw.dac.myftpupload.com

Hello @bcoplin,

Thanks for writing in!

To resolve your issue, since the child theme is set up, please add the following code in your child theme’s functions.php file

// Change Select Options
// =============================================================================
function change_select_option($text) {
  global $product;
  $product_type = $product->product_type;
  switch ( $product_type ) {
    case 'external':
      return __( 'Buy product', 'woocommerce' );
    break;
    case 'grouped':
      return __( 'View products', 'woocommerce' );
    break;
    case 'simple':
      return __( 'Add to cart', 'woocommerce' );
    break;
    case 'variable':
      return __( 'Click to Order', 'woocommerce' );
    break;
    default:
      return __( 'Read more', 'woocommerce' );
  } 
}
add_filter( 'woocommerce_product_add_to_cart_text' , 'change_select_option' );
// =============================================================================

We would loved to know if this has work for you. Thank you.

Is there anyway to do this via css or java? I do not have experience with php. If not, could you walk me though making changes in the php?

Hi There,

Please add the given code in your child theme’s functions.php file. To do this login to your server via FTP or cPanel’s File Manager.

Then navigate to this directory: /wp-content/themes/pro-child
In there you’ll see the file functions.php,
download/edit that file with a text editor (e.g. notepad++, sublime, etc. )

Paste the code provided above, save the updated file and upload it back (also via FTP or File Manager).

Child Themes

Thanks,

I can’t seem to figure this out. I am pulling my hair out :slight_smile: anyway you can do this for me?

I just need it to say “Click for Options”

Hi @bcoplin,

In that case, please provide your FTP login credentials as well. I won’t do any editing in the admin as it can break you site down, with FTP, I can easily restore it back.

Thanks!

Thank you so much.

Hi,

Thank you for providing your ftp credentials.

I went ahead and added the code to your child theme’s functions.php

For future reference, I am sending a video as a guide in adding a code snippet to your child theme’s functions.php file.

Thanks

Thank you so much Paul. You are a great help!

You’re welcome!
We’re glad we were able to help you out.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.