3

On a configurable product I would like to change the text 'Choose an Option...' to 'Select an Option...'

I have attempted to change the i18n translation file within my theme, and cleared cache - however this has not worked.

Can anyone please advise of the file that needs updating to change this text?

1
  • Try System -> Cache Management > Flush Static Files Cache for i18n translations.
    – d.yuk
    Sep 24 '18 at 5:35
3

There are 2 ways to change the text either using language file ( recommended ) or in template file :

Lanuage File CSV : copy below file to your theme folder and update translation as required.

/var/www/html/magento.com/vendor/magento/module-configurable-product/i18n/en_US.csv

or Change in template file ( not recommended as this would create issue while adding multiple-lanuages / translation, so you need to update this in all _csv files:

copy below file and add in your theme folder ( /package/theme/Magento_ConfigurableProduct/templates/product/view/type/options/configurable.phtml )

/vendor/magento/module-configurable-product/view/frontend/templates/product/view/type/options/configurable.phtml

7
  • Thanks Naveed. I used the second step. As translation file update did not work for me. Sep 24 '18 at 15:13
  • Hi Naveed... in fact the second option still did not appear to work... on loading the page it quickly flashes 'select an option...' before going back to 'choose an option...' arrgh. Any advice please? Sep 25 '18 at 12:00
  • @YorkieMagento hey, did you find any solution?
    – Fena shah
    Nov 6 '20 at 11:53
  • Sorry @FenaShah I did not. Worth a try using the solutions provided though, to see if it works in your case? Nov 6 '20 at 12:28
  • @YorkieMagento did it finally :)
    – Fena shah
    Nov 6 '20 at 13:22
0

You have to overwrite the template file add in your theme folder

app/design/frontend/Vendor/Theme/Magento_ConfigurableProduct/templates/product/view/type/options/configurable.phtml

Change the text "Choose an Option"...' to "Select an Option..."

Run the following command

  1. php bin/magento cache:clean
  2. php bin/magento cache:flush
2
  • I did this Rama, it flashes up as 'select an option' for a split second in the front end, and then changes back to 'choose an option'... any suggestions? Sep 25 '18 at 12:52
  • I am trying but not overtie configurable.php if you have idea reply me and in first option value by default show in dropdown
    – Rv Singh
    Jan 12 '19 at 12:04
0

You can overwrite the function "getJsonConfig" which is found in magento/module-configurable-product/Block/Product/View/Type/Configurable.php

$config = [
        'attributes' => $attributesData['attributes'],
        'template' => str_replace('%s', '<%- data.price %>', $store->getCurrentCurrency()->getOutputFormat()),
        'currencyFormat' => $store->getCurrentCurrency()->getOutputFormat(),
        'optionPrices' => $this->getOptionPrices(),
        'priceFormat' => $this->localeFormat->getPriceFormat(),
        'prices' => $this->variationPrices->getFormattedPrices($this->getProduct()->getPriceInfo()),
        'productId' => $currentProduct->getId(),
        'chooseText' => __('Choose an Option...'),
        'images' => $this->getOptionImages(),
        'index' => isset($options['index']) ? $options['index'] : [],
    ];

Create a module and overwrite it

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.