|
/ Documentation /CartFlows/Code Snippets/ How to Change the “Choose A variation” text?

How to Change the “Choose A variation” text?

When using the Product Options feature in CartFlows, customers may see a “Choose a variation” link (if there is a variable product) that opens a variation selection popup. This label can be customized to better match your store’s language, branding, or product tone.

CartFlows does not provide a setting in the dashboard to change this text, but it can be easily modified using a filter we provided.

Step 1: Choose How to Add Custom Code

You can use either of the following methods to add the filter:

  • Use a child theme and place the code in the functions.php file.
  • Use a code snippet plugin like Code Snippets for safer and easier management.

Step 2: Add the Filter Code

Copy and paste the following snippet into your chosen method:

add_filter( 'cartflows_variation_popup_toggle_text', 'change_variation_toggle_text', 10, 1 );

/**
* Change Choose a variation text.
*
* @return text.
*/
function change_variation_toggle_text( $text ) {

return "Add your choice of text here";
}

Step 3: Save Changes and Test

After saving the changes, visit your checkout page where the Product Options popup appears and confirm that the new text displays as expected.

Note: For detailed guidance on adding custom code to your site, please refer to our documentation here.

Was this doc helpful?
What went wrong?

We don't respond to the article feedback, we use it to improve our support content.

Need help? Contact Support
On this page