isaac.dvory Posted January 20, 2017 Share Posted January 20, 2017 Hello , I'm trying to find a way to translate product attribute, I don't want to change its value, just translate it on the template. so for example, if the attribute value is "XXXL" I want to translate it to "3XL" while keeping the value "XXXL". I tried editing product.tpl and changed: {$group_attribute|escape:'html':'UTF-8'} To: {l s=$group_attribute|escape:'html':'UTF-8'} But it didn't add it to the translation page in the admin. is it possible? Link to comment Share on other sites More sharing options...
isaac.dvory Posted January 25, 2017 Author Share Posted January 25, 2017 OK... I guess since no one replied yet that it is not possible. Should I just add many IF statements to the template and translate in the tpl file? Link to comment Share on other sites More sharing options...
JeredBolton Posted January 27, 2017 Share Posted January 27, 2017 This is something you do in the back office. When you have more than one language pack installed, the language drop down menu appears at the end of the attributes field when you're editing/defining the product attributes. Link to comment Share on other sites More sharing options...
isaac.dvory Posted January 30, 2017 Author Share Posted January 30, 2017 But I don't have more than one language, I only have English language. Link to comment Share on other sites More sharing options...
JeredBolton Posted January 30, 2017 Share Posted January 30, 2017 Ah - use of the word translate and reference to "translation page in the admin" made me think of language translation, rather than functionality for displaying an attribute string which is different from the value it represents. To get this working your best bet would be to modify the template files and override functionality in the back office so that you when you create an attribute you can provide a value and a seprate display string. Link to comment Share on other sites More sharing options...
isaac.dvory Posted January 30, 2017 Author Share Posted January 30, 2017 sounds good, can you point me to the correct files (for the back office change ) ? Link to comment Share on other sites More sharing options...
JeredBolton Posted January 30, 2017 Share Posted January 30, 2017 A good place to start would be to look at overriding the renderFormAttributes() function in controllers/admin/AdminAttributesGroupsController.php. This is not a trivial change as you're going to have to consider how you're going to store the additional information. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now