overbags Posted April 9 Share Posted April 9 (edited) hello everyone in PS8 I'm trying to change the text displayed in the address change window in the BO order (I attach an image) now it appears 10654 - VIA TARCO.... for ease of selection I would like it to appear Alias Address - VIA TARCO.... what file should I work on? Edited April 10 by overbags discussion resolved (see edit history) Link to comment Share on other sites More sharing options...
Andrei H Posted April 10 Share Posted April 10 Hello, You need to edit the following file: src/Core/Form/ChoiceProvider/CustomerAddressesChoiceProvider.php Replace line 72 $address['id_address'], with: $address['alias'] ?? $address['id_address'], Once you refresh the page, the alias should be displayed instead of the id 1 Link to comment Share on other sites More sharing options...
overbags Posted April 10 Author Share Posted April 10 thank you very much for your reply Andrei H I made the change you indicated but now it appears 0 (zero) Link to comment Share on other sites More sharing options...
overbags Posted April 10 Author Share Posted April 10 as alias this address has "ebay" Link to comment Share on other sites More sharing options...
Andrei H Posted April 10 Share Posted April 10 Hello, Sorry, my bad. Two changes are needed and I only posted one of them Please also replace line 71 from '%d- %s %s %s %s', To '%s - %s %s %s %s', It now displays 0 because of that %d, which is a placeholder for a number 1 Link to comment Share on other sites More sharing options...
overbags Posted April 10 Author Share Posted April 10 perfect thank you so much 1 Link to comment Share on other sites More sharing options...
overbags Posted April 10 Author Share Posted April 10 if I can ask another question if I change an address now the system deactivates the old one and creates a new one i have the ps_address table i would like the system to change the old one and that's it which file should i work on? Link to comment Share on other sites More sharing options...
Andrei H Posted April 10 Share Posted April 10 (edited) Hello, From my understanding, PrestaShop does so in order to not change the address for all the orders that use it (eg. the address for the current order will be changed, but all orders that were using the same address will still use the old address). If you really want to change this logic, you need to edit the following file: src/Adapter/Address/CommandHandler/EditCustomerAddressHandler.php You will need to replace line 62 if ($editedAddress->isUsed()) { with: if (false) { Thus making sure that the address is always updated. Edited April 10 by Andrei H (see edit history) 1 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