prestaKar Posted October 20 Share Posted October 20 To simply put I created this code in the screen. The new error notification in cart appears, but only in english, which i thought would not be a problem. However after browsing through every translation (backoffice, page, module, etc) I could not find this changed string to translate. Of course i cleared cache, then even deleted cache folder. But nothing. I tried chcecking out the translation/pl-pl/ShopNotificationsError.pl-PL.xlf file, but there is nothing there, instead there is one that was before i changed the code. I would appricate help, or a little step by step tutorial how should it be done Link to comment Share on other sites More sharing options...
endriu107 Posted October 20 Share Posted October 20 Where you add this code? In module files? Link to comment Share on other sites More sharing options...
prestaKar Posted October 20 Author Share Posted October 20 (edited) 4 minutes ago, endriu107 said: Where you add this code? In module files? Inside the %domain-name%/controllers/front/CartController.php I know i should create override, but when i followed other tutorials it didnt work. meanwhile here it worked instantly. However now i have issue with translation. I basically just changed that string, and added [... , %product% => $productName, ...] Edited October 20 by prestaKar (see edit history) Link to comment Share on other sites More sharing options...
endriu107 Posted October 20 Share Posted October 20 Ok, I just check it and have same issue. You can add manually this string to translation/default/ShopNotificationsError.xlf after: <file original="controllers/front/CartController.php" source-language="en-US" target-language="en" datatype="plaintext"> <body> If you still have issue with override file you need to create file in override/controllers/front/CartControllers.php <?php class CartController extends CartControllerCore { protected function processChangeProductInCart(): void { //Here all code from this method } } Link to comment Share on other sites More sharing options...
prestaKar Posted October 21 Author Share Posted October 21 17 hours ago, endriu107 said: Ok, I just check it and have same issue. You can add manually this string to translation/default/ShopNotificationsError.xlf after: <file original="controllers/front/CartController.php" source-language="en-US" target-language="en" datatype="plaintext"> <body> If you still have issue with override file you need to create file in override/controllers/front/CartControllers.php <?php class CartController extends CartControllerCore { protected function processChangeProductInCart(): void { //Here all code from this method } } The first part worked, i added under the "<file original="controllers/front/CartController.php" source-language="en-US" target-language="en" datatype="plaintext"> <body>" <trans-unit id="*md5 hash of string*"> <source>Sorry, "%product%" is not available in this quantity.</source> <target>Sorry, "%product%" is not available in this quantity.</target> <note>Line: 546</note> </trans-unit> in the translation/default/ShopNotificationsError.xlf and the text finally showed up available for translation. Thank you very much. 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