Magento 2 checkout error message translation - magento2

I can't translate the top checkout error message "The requested qty exceeds the maximum qty allowed in shopping cart", the item error message translates ok. Where is the location of this piece of code?:
<div class="message message-error error"><div data-ui-id="checkout-cart-validationmessages-message-error">The requested qty exceeds the maximum qty allowed in shopping cart</div></div>
checkout attachment
checkout

This message is located in the file:
vendor/magento/module-checkout/view/frontend/web/template/messages.html
You can modify this file to change the message.

This text is available in following path
vendor/magento/module-inventory-sales/Model/IsProductSalableForRequestedQtyCondition/IsCorrectQtyCondition.php#112
You can change here But it would be more correct to change from translation file

To find where the message file is located, you can enable the Magento 2 debug template functionality to highlight the template file:
To enable template hints:
Click Stores > Settings > Configuration > ADVANCED > Developer
In the Scope: dropdown in the upper-left corner, select the view for which you want the template hints.
In the Debug tab, set Template Path Hints for the storefront to Yes.
To enable path hints for Admin, set Template Path Hints for Admin to Yes.
To save the changes, click Save Config in the upper-right corner.
Use the bin/magento dev:template-hints:enable command to enable template hints and the bin/magento dev:template-hints:disable command to disable them.
Other Way
Once you find the file path, although, in Magento 2, the messages are in CSV format for every module, i.e., in vendor/magento/module-catalog-inventory/i18n/en_US.csv. You can change and customize your messages in this file for the module.
That's it

Related

How to automatically load a report on home page after logged in Jasper Server Community

In Jasper Server Community Edition, I want to load a report automatically without clicking on any report when I logging. I tried to add below code to home.jsp page as jasperSoft documentation says.but it is not working.
Please help me with this.
Code that I added to home.jsp :-
<%
<authz:authorize ifAllGranted="ROLE_REPORT_HOME">
<c:redirect
url="http://localhost:8080/jasperserver/flow.html?_flowId=viewReportFlow&_flowId=viewReportFlow&ParentFolderUri=%2Freports&reportUnit=%2Freports%2FSample_Dash_Report&standAlone=true"/>
</authz:authorize>
%>
Please make sure to follow all the steps in the tutorial, as you probably missed to add user role to the user you want. Also, make sure to have sample data as you're referencing report from sample data.
Setting a report as the home page:
The following example shows how to set a report as the home page based on a role. This example uses the 01. Geographic Results by Segment Report.
First, set up the role and create a sample user:
a. Create the role you want to use, for example, ROLE_REPORT_HOME.
b. Create a user HomeUser and add ROLE_REPORT_HOME to HomeUser.
Open the file \WEB-INF\jsp\modules\home\home.jsp in an editor and add the following lines:
<authz:authorize ifAllGranted="ROLE_REPORT_HOME">
<c:redirecturl="http://localhost:8080/jasperserver-pro-601/flow.html?_flowId=viewReportFlow&standAlone=true&_flowId=viewReportFlow&ParentFolderUri=%2Fpublic%2FSamples%2FReports&reportUnit=%2Fpublic%2FSamples%2FReports%2F01._Geographic_Results_by_Segment_Report"/>
</authz:authorize>
To find the URI for the report you want to use, open the report in the repository and copy the URI.
Save the modified file and restart the application server to see changes.
Log into JasperReports Server as HomeUser. The library page is displayed.
Go to Jasper server installation directory and search for jasperserver-servlet.xml (C:\Jaspersoft\jasperreports-server-cp-6.4.2\apache-tomcat\webapps\jasperserver\WEB-INF\jasperserver-servlet.xml)
Under bean id = "homePageByRole" we have to make changes. For that, search homePageByRole word inside the jasperserver-servlet.xml file.
Under tag ,we can give a report link we need according to the user roles. But make sure you should add amp; as after each & mark. Otherwise it will give an error!
Example:-
Original report link from the address bar in browser when report opened using jasper server is;
http://localhost:8080/jasperserver/flow.html?_flowId=viewReportFlow&_flowId=viewReportFlow&ParentFolderUri=%2FMy_Reports&reportUnit=%2FMy_Reports%2FDashboard_Report_Landscape&standAlone=true
But the link we should put under is;
ROLE_USER|redirect:/flow.html?_flowId=viewReportFlow&_flowId=viewReportFlow&ParentFolderUri=%2FMy_Reports&reportUnit=%2FMy_Reports%2FDashboard_Report_Landscape&standAlone=true
check how we add as amp; after every & mark. Also we can set user role. In my case I set user role as ROLE_USER.
Whole code snippet is;
<bean id="homePageByRole" class="java.util.ArrayList">
<constructor-arg index="0" type="java.util.Collection">
<list>
<value>ROLE_ADMINISTRATOR|redirect:/flow.html?_flowId=searchFlow</value>
<value>ROLE_USER|redirect:/flow.html?_flowId=viewReportFlow&_flowId=viewReportFlow&ParentFolderUri=%2FMy_Reports&reportUnit=%2FMy_Reports%2FDashboard_Report_Landscape&standAlone=true</value>
</list>
</constructor-arg>
</bean>

How to start SQL Server from Batch file?

I'm trying to start SQL Server Express from command line using the following command:
net start MSSQL$SQLEXPRESS
But I get this error:
System error 5 has occurred.
Access is denied.
I have administrator privilege and my OS is Windows 7.
Thanks to #SamiKuhmonen my problem was solved.
I created batch file (named start sqlserver.bat) conatins the following command:
net start MSSQL$SQLEXPRESS
I created a shortcut to my batch file.
And run it as administrator like in this
screenshot
Run Registry Editor (RegEdit).
Navigate to HKEY_LOCAL_MACHINE.
Right click on HKEY_LOCAL_MACHINE, and select Permissions .
Click on the Advanced button.
In “Advanced Security Settings” dialog window, go to the Owner tab.
Select and highlight the currently logged on user name or Administrators group (if user is a member of Administrators” in the Change owner to: box.
Select the tick the check box for Replace owner on subcontainers and objects option, and click OK.
Back in “Permissions” dialog window, click on Add… button.
Enter everyone in the Enter the object names to select text box, and click on the Check Names button.
Hope it helps!!!
If there is error with the user ID entered, correct the error. If there is no error found, click the OK button.
Back in “Permissions” dialog window, select and highlight the newly added user name in Group or user names: section, and tick the checkbox for Allow access right next to Full Control in the Permissions for Everyone section.
simply create the batch file as eg.bat
and it's content as :start ssms

How to Customized the new order template: Magento

I want to make some text changes in new order template of my Magento so where i can locate the Template file or where i can do this in the admin panel.
you can make changes in template from admin panel as below :
Go to System >> Transactional emails >> Add new template
Select now order email template and make changes and save it.
After that you need to assign your curstom email template.
For this Go to System >> configuration >> Sales >> Sales emails >> Select your custom template there.

Magento translation email - email titles

How do you go about changing the title of emails in a second language store view. Example "New Order" in the New Order confirmation email. csv files are not responding in this case...
Another solution. You can copy the default email templates into a language folder you are wanting to use, and translate them manually.
Copy everything in app/locale/en_US/template to app/locale/[YOUR
LANGUAGE CODE]/template.
Change [YOUR LANGUAGE CODE] to the Language Code of your
desired language. YOu can find a list here. Make sure it's in
the format en_US.
Modify the email templates in your app/locale/[YOUR
LANGUAGE CODE]/template folder.
In Magento, go to System > Configuration > General. At the top left, change your Current Configuration Scope: to the store you want translated.
Change the Locale to the language you translated to. It must match correct the language code used in your folder namespace.
NOTE: When editing the email template files, you'll notice some comments at the top containing variables and such. You will see something like <!--#subject Welcome, {{var customer.name}}! #-->. Changing this will alter the subject line used by Magento.
You can just create custom Transactional Emails which include the translations needed for the store view.
Create a new Transaction Email template, in your store's required
language. Go to System > Transactional Emails and click Add New
Template. Load in the default template you are trying to
translate and modify the subject and body of the email.
Go to System > Configuration > Sales Emails At the top left of your configuration, change to your desired Store View you want these emails to be assigned to.
Change the New Order Confirmation Template to the Transaction Email template you created. Click Save Config.
Items ordered from that store should now send an email using the translated email you created.

Wrong Date Format (locale) in SQL Server Reporting Services Report

I am unable to solve an issue with a report on SSRS.
The scenario is : a link in a Silverlight application loads a new web page containing a Microsoft.Reporting.WebForms.ReportViewer control. The parameters for the control are passed in the QueryString to the new page.
If the date is passed as 01/08/2011, when the report is loaded, the date control on the report viewer has the value 08/01/2011 (i.e. it has been converted to American format and my locale is United Kingdom, en-GB).
This only happens in the deployed solution, it works correctly in Visual Studio on my local PC. My IE settings are correct.
I made the following checks on the deployed IIS Server (IIS 6.0):-
The security account for the relevant Application Pool = Network Service.
In the Registry the SID for this user is S-1-5-20 so I checked the registry settings under HKEY_USERS > S-1-5-20 > Control Panel > International . These were all correctly set for United Kingdom. Although theoretically they should not have an effect I also checked the same settings for Local System (S-1-5-18) and NT-Authority (S-1-5-19) which were identical.
I next checked the Culture and UI Culture on the web site. These were as follows: -
Right-click website - Properties > ASP.NET.
Click the 'Edit Global Configuration' button to check the server config settings.
Select the Application tab and view the values for Culture and UI Culture.
Both values are set as en-GB. So OK.
Did the same in the 'Edit Configuration' button which is for viewing/editing the specific application's config file.The websites' config file values will supercede the server config file values. These are also OK.
Next I checked the SSRS Server.
Service runs under 'Local System' account.
Registry settings for this account are correct HKEY_USERS > S-1-5-18 > Control Panel > International.
S-1-5-19 and S-1-5-20 also correct
ReportServer.aspx page directive includes Culture="en-GB"
(e.g. <%# Page Language="C#" AutoEventWireup="true" Inherits="Microsoft.ReportingServices.WebServer.ReportViewerPage" Culture="en-GB"%>)
In code the parameter values are set using Microsoft.Reporting.WebForms.ReportViewer.SetParameters(ms.ReportParameter []) and ms.ReportParameter(name, value, visible) and the parameters are definitely the correct value when they are received at this point by the web app (when I step through in code).
I don't know where to turn next. The one difference I have but I can't imagine it is the problem is that the querystring is URLEncoded on the deployed version but not in the design on my local PC i.e
[server version]
...%26END_DATE%3d31%2f07%2f2012+00%3a00%3a00%26START_DATE%3d01%2f08%2f2011+00%3a00%3a00
[local version]
...&END_DATE=31/07/2012+00:00:00&START_DATE=01/08/2011+00:00:00
I would be extremely GRATEFUL for any suggestions that anyone has.
If you pass in the date in dd-mmm-yyyy format then it is unabiguous, eg 18-Jan-2011.