petem Posted July 29, 2019 Share Posted July 29, 2019 Hi, I am looking for a way to update the language text of "cartexistingdomainchoice" via a hook. I need the text to be different for one particular product but cannot find a way to change that text via a hook. Any ideas? Thanks Pete 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted July 29, 2019 Share Posted July 29, 2019 Hi Pete, 24 minutes ago, petem said: I am looking for a way to update the language text of "cartexistingdomainchoice" via a hook. i'm tempted to say it would be as easy to do in the template as it's only a Smarty IF statement around the language output... 26 minutes ago, petem said: I need the text to be different for one particular product but cannot find a way to change that text via a hook. Any ideas? basically you declare the language array globally; check if it's product x being configured and if so, modify the specific language string in the array and then return that modified array to the template. <?php # Translate Specific Language String Hook # Written by brian! function translate_specific_string_hook($vars) { global $_LANG; if ($vars['templatefile'] == "configureproductdomain" && $vars['pid'] == 45) { $_LANG['cartexistingdomainchoice'] = "To Be Or Not To Be"; return array("LANG" => $_LANG); } } add_hook("ClientAreaPageCart", 1, "translate_specific_string_hook"); so in the above example, 45 is the PID value when this string is going to be changed to the specified string in the hook - that string can be hard-coded in one language (everyone will see that string as is), or if your site is multilingual, you could use Language Overrides - which would be Lang::trans('**language_override_string**)... but if memory serves, your site is English only, so if that's the case, hardcoding the string should be sufficient for your needs. 0 Quote Link to comment Share on other sites More sharing options...
petem Posted July 29, 2019 Author Share Posted July 29, 2019 Perfect. Thanks brian! 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.