Changing date format Prestashop backoffice to DD-MM-YYYY - prestashop

I want to change the date format Prestashop using in BackOffice especially in Edit product > quality tab > available date, from YYYY-MM-DD to DD-MM-YYYY. I managed to do it in javascript but in the ps_product table I want it to keep the YYYY-MM-DD format because Prestashop validate dates in Validate.php class and I don't want to touch core files.
The library used is datetimepicker and the format option doesn't support toDisplay and toValue as the datepicker library.
Any idea to do so?

The format of the dates displayed in Prestashop is tied to the Language configuration.
The language chosen depends on the one defined for the backoffice admin user or the one chosen by the customers / visitors.
Assuming you are on Prestashop 1.7.x, this can be changed under:
Backoffice > International > Localization > Language tab.

Related

Currency switcher without language change

I want to create currency switcher based on i18n nuxt, but without changing language.
I know that we can change currency by $i18n.setLocale(*localeCode*) but this also change language. Is it somehow possible to change only currency and display it properly using <i18n-n>?

Custom shipping method admin form issues

I've created a custom shipping integration (based on this guide) that calculates the shipping price based on a percentage of the subtotal. This percentage is set in the shipping method settings.
Everything works fine on the frontend part, the shipping price is calculated correctly.
The problems I have lies in the admin backoffice, in the shipping method settings page. The first problem that I have is that the text box to set the percentage is preceded by the currency, which will confuse the user as it is expecting not a flat rate price, but a percentage of the order's subtotal.
I have the same problem on the list of added shipping methods, the value I set is preceded by the currency, and this is not good.
There is a "add a template" section in the guide which I followed, but the template doesn't seem to affect anything. I tried putting bogus letters in the template and clearing the cache, but they did not appear anywhere on the settings page.
What I would like to do here is either remove the currency indicator completely, or to replace it with a %.
The second problem I have is that the language isn't taken into account. I have created a messages.en.yml file and a messages.fr.yml file. Both follow the same structure of course, and all strings are translated. But if I set OroCommerce in French, I don't get my translated strings, but the english ones.
Here's a screenshot that shows both my problems :
(Strings like "Price percentage" should be translated)
Do you have an idea on how I could fix these issues? Thanks.
Currency is added in shipping-rule-method-view.js. You can override this JS view with the map section in jsmodules.yml configuration file.
Based on Andrey's answer, I managed to have something that works. I'll add a few more details for anyone that had the same issue.
For the issue with the translation, it seems that renaming the file by adding the locale messages.fr_FR.yml fixed the issue.
Concerning the currency part on the admin menu, you have to create a jsmodules.yml file in the Resources/config folder of your bundle, NOT Resources/config/oro, which is why none of my configs were taken into account.
When writing your jsmodules file, when using map, if you're overriding a JS file, you have to omit the file extension. When you're overriding something else, say an HTML file, you have to put the file extension.
This is how my file is written :
map:
"*":
oroshipping/js/app/views/shipping-rule-method-view: gdmshipping/js/shipping-rule-method-view
There is one caveat, though. This will replace the display for all shipping integrations, so the currency symbol will be replaced/removed for all other shipping types, such as Flat Rate, so keep this in mind.

How to add field in registration form?

In my Prestashop I need not add some field in registration form. I tried in authentication.tpl and registration.tpl but not find any hint to add new
field.
You may start digging in classes/form/CustomerFormatter.php under getFormat() method. There is an array of fields for the registration form. I would guess you can override that method from your theme folder instead of editing it directly.
I had a similar problem because I needed to include mobile phone for user registration and for admin use.
I solved it in PS 1.7 by adding in "ps_address_format" table the string " phone_mobile" in the "format" column. I suppose to add other field, this field have to be a field in the table "ps_address".
You can only change the address fields (they appear on registration if you choose the standard registration in Preferences->Customers).
To do this, you need to edit the countries required field:
You can also set some fields in the customers menu, at the bottom (if you have b2b enable it will show other fields)
To add different fields, you need a module or to edit a lot of files to display and save the fields.
NOTE: these screenshots are from 1.6 but 1.7 country address are identical.
EDIT:
Based on your screenshot, you don't have the standard registration option. Not sure it's available in 1.7. Anyway, the phone number field, in Prestashop is related to the addres, and not the customer. It would be easy to remove the other fields, but to add the phone number for the customer and not the address would be a little more tricky and would involve either create an address for that customer, or alter the customer table, class and forms.
One suggestion I can make is to translate the Company field to Phone number, and make it not optional. That would solve one problem.

Adding new fields to Prestashop cart back office

I need to add fields to the prestashop 1.6 cart back office, i.e. I need something similar to http://nemops.com/prestashop-products-new-tabs-fields/#.VuysZfl97IU
I know that I can easily manipulate the Admin Cart code to get the result I need but I'm wondering if there is a 'correct' way to do it - like in the product tab solution.
A 'correct' way as in:
encapsulate in a model
works on any prestashop version that keeps compatible API
works on any theme

Overriding prestashop module translation missing

I try to modify a module template in prestashop so I've copied the module to my theme folder "modules".
I've noticed that the theme is changing the only problem is that the translation is not. I got the original text on the final shop template. Is there some simple way of making this work?
I don't know how to make modules so this way was great except the translation part - the rest of the store is translated except those modules. I use prestashop 1.4.
In your Back Office, you need to edit the Module Translations under Tools > Translations > Modify Translations. They are translated separately from the Front Office and Back Office translations, just select "Modules" from the drop-down menu.
Make sure your module can be translated also :
{l s='Login' mod='blockuserinfo'}
The name of the module has to be here,
also make sure to check the prestashop user guide :
http://doc.prestashop.com/display/PS15/Translations+in+PrestaShop+1.5