Magneto 2.2.0 add header and footer to checkout page - magento2

How to add header and footer to checkout page. I used the override method. I created checkou_index_index.xml file in following path layout\override\theme\Magento\blank in my custom theme.
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="minicart" remove="false" />
<referenceContainer name="header.panel" remove="false" />
<referenceBlock name="top.search" remove="false" />
<referenceBlock name="catalog.compare.link" remove="false" />
<referenceBlock name="catalog.topnav" remove="false"/>
<referenceContainer name="footer-container" remove="false"/>
</body>
</page>
But I received following error.
Overriding view file 'C:\/xampp\/htdocs\/my_website\/app\/design\/frontend\/Vendor\/basic\/Magento_Checkout\/layout\/override\/theme\/Magento\/blank\/checkout_index_index.xml' does not match to any of the files
What is the cause of this error and how to fix this error?

First you have to create custom theme and once its done then create checkout_index_index.xml file in app/design/frontend/Magenticians/Mytheme/Magento_Checkout/layout and paste this code:
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
    <referenceBlock name="minicart" remove="false" />
    <referenceContainer name="header.panel" remove="false" />
    <referenceBlock name="top.search" remove="false" />
    <referenceBlock name="catalog.compare.link" remove="false" />
    <referenceBlock name="catalog.topnav" remove="false"/>
    <referenceContainer name="footer-container"  remove="false"/>
</body>
</page>
Then create customcss.css in app/design/frontend/Magenticians/Mytheme/web/css and paste this code:
.action-auth-toggle
{
display: block;
}
Now open a default.xml file of your custom theme and paste this code:
<head>
        <css src="css/customcss.css" />
</head>
After the implementation, don't forget to run necessary CLI commands.

Try putting your custom xml file in:
C:\xampp\htdocs\my_website\app\design\frontend\Vendor\basic\Magento_Checkout\view\frontend\layout\checkout_index_index.xml
Because, if i'm not mistaken, the file to override is in:
C:\xampp\htdocs\my_website\vendor\magento\module-checkout\view\frontend\layout\checkout_index_index.xml
Hope this helps you.

Related

Sulu: How to add an additional menu for a webspace?

Is there a way to create additional menus to a wabspace in Sulu CMS (1.6)? I only see the main manu in the options:
Thx a lot!
Andreas
You can add more navigations using the XML definition of a webspace. The default webspace from the sulu-minimal repository is located at app/Resources/webspaces/example.com.xml and already contains a navigation tag.
You can add more contexts like this:
<webspace>
<!-- other tags -->
<navigation>
<contexts>
<context key="main">
<meta>
<title lang="en">Main Navigation</title>
</meta>
</context>
<context key="footer">
<meta>
<title lang="en">Footer Navigation</title>
</meta>
</context>
</contexts>
</navigation>
<!-- other tags -->
</webspace>

Eclipse not rendering jsf?

only tomcat server will display the .jsf pages correctly. When I try to add project through eclipse and view and test it doesn't render the .jsf code but instead displays it as source code. I have eclipse configured for tomcat and that works fine but can't get the .jsf pages to render it just displays the source code when added to the server through eclipse but if I export the .war file and run it on tomcat/webapps then it works fine.
source code example from eclipse:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html">
<h:head>
<title>PCC Accounts Login</title>
</h:head>
<h:body>
<h:outputStylesheet name="style.css"></h:outputStylesheet>
<h:outputText>testing output text tag WITHOUT using value attributeHELLo ????</h:outputText>
<h:outputText value="testing outputText WITH using the value attribute" />
<h:form>
<h:inputText id="user_id" title="User Name" value="User Name" action="#{loginBean.setUsername}">User Name</h:inputText>
<h:inputText id="password" title="Password" value="Password" action="#{loginBean.setPassword}">Password</h:inputText>
<!-- <h:commandButton id="login" value="Login" action="accounts.jsf">Login Now</h:commandButton> -->
<h:commandButton id="login" value="Login" action="accounts.jsf" />
</h:form>
</h:body>
</html>
source code example exported from eclipse and ran on tomcat:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="j_idt2">
<title>PCC Accounts Login</title>
<link type="text/css" rel="stylesheet" href="/assign05_test/javax.faces.resource/style.css.jsf" />
</head>
<body>
<input type="hidden" name="j_idt9" value="j_idt9" />
<input id="j_idt9:user_id" type="text" name="j_idt9:user_id" value="User Name" title="User Name" />
<input id="j_idt9:password" type="text" name="j_idt9:password" value="Password" title="Password" />
<input id="j_idt9:login" type="submit" name="j_idt9:login" value="Login" />
</form>
</body>
</html>
SO, Eclipse is obviously not rendering the JSF pages but I added the correct file to the Preferences/Java/BuildPath/UserLibraries. So I'm not sure why it's not working but for now I'm testing by exporting the .war then running it on tomcat server which is very tedious process. Anybody else run into this problem? Any help would be greatly appreciated, thanks in advance.
Respectfully,
Martin Hand
Had this for servlet-mapping in web.xml:
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
Changed it to this and it's fixed:
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
Funny though that it only affected it when trying to run through Eclipse but if exported .war then added to /webapps in tomcat it was fine but that's a very tedious and annoying process when trying to develope an application. Also read this helpful article if your having trouble - JSF tags not being rendered as HTML

On the eclipse welcome page, is it possible to link to resources located in a different plugin?

I am working on an eclipse RCP application. In the main (app) plugin I have defined a welcome or intro page. This is an XHTML file containing links to interesting resources.
There is a separate help plugin which contains the help in html and also as a PDF.
Is it possible to link from the welcome page in the app plugin to the PDF in the help plugin? I was thinking of something like this (but it didn't work)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Welcome</title>
<link rel="stylesheet" href="shared.css" type="text/css" />
<link rel="stylesheet" href="root.css" type="text/css" />
</head>
<body>
<h1>Welcome to the Test Framework</h1>
<div class="page-style">
<div id="content">
<!-- app plugin -->
<a href="presentation.pdf">
<img border="0" src="file_powerpoint.png" alt="Presentation" />Präsentation</a>
<!-- help plugin -->
<a href="platform:/com.acme.atf.help/pdf/handbook_de.pdf">
<img border="0" src="file_pdf.png" alt="Handbuch" />Handbuch</a>
</div>
</div>
</body>
You need to register your XHTML page as a config extension at your plugin.
Add the extension at the plugin.xml:
<extension point="org.eclipse.ui.intro.configExtension">
<configExtension
configId="org.eclipse.ui.intro.universalConfig"
content="path/yourFile.xhtml" />
</extension>
Then, add it to the welcome page (via editing configuration, or using the Help/Welcome/Customize menu).
Link: A short tutorial on this topic
You can also use command to open some resource (you will implement opening of the resource in handler):
<extension
point="org.eclipse.ui.commands">
<command
defaultHandler="yourHandler"
id="openResource">
</command>
</extension>
and then execute the command in xml file where you have welcome page content:
<introContent>
<extensionContent id="openPdf" style="css/welcome.css"
name="SomeName" path="overview/#">
<group style-id="content-group" id="overview-default-group">
<link label="Open PDF"
url='http://org.eclipse.ui.intro/execute?command=openResource'
id="introLink" style-id="content-link">
<text>Open PDF resource</text>
</link>
</group>
</extensionContent>

error jsp 154 java.lang.classnotfound

i am developing a portlet struts 2 ejb3
i configured project ejb and in the portlet project i confugured the action class and struts.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<package namespace="/view" extends="struts-portlet-default" name="view">
<!-- If no class attribute is specified the framework will assume success and
render the result index.jsp -->
<!-- If no name value for the result node is specified the success value is the default -->
<action name="index">
<result>/html/view/index.jsp</result>
</action>
<action name="create" method="ajouterOUmodifier" class="com.esprit.action.AdressAction">
<result name="success" type="redirect">index</result>
<result name="input">/html/view/ajoutAdress.jsp</result>
</action>
</package>
</struts>
and the jsp file
<%# page contentType="text/html; charset=UTF-8"%>
<%# taglib prefix="s" uri="/struts-tags"%>
<%# taglib prefix="sx" uri="/struts-dojo-tags" %>
<html>
<head>
<link href="<s:url value="/resources/main.css"/>" rel="stylesheet" type="text/css"/>
</head>
<body>
<s:form action="create" method="post">
<s:textfield name="adress.nom" label="Firstname"/>
<s:textfield name="adress.prenom" label="Lastname"/>
<s:submit value="ok" />
</s:form>
</body>
</html>
but when i execute the project an error is display:
ERROR [jsp:154] java.lang.ClassNotFoundException: com.esprit.metier.AdressDao from BaseClassLoader#33b2c7a8{VFSClassLoaderPolicy#1e52011c{name=vfsfile:/D:/android/jboss-5.1.0.GA/server/default/deploy/DepartmentWEB-portlet.war/ domain=ClassLoaderDomain#69ac5f83{name=vfsfile:/D:/android/jboss-5.1.0.GA/server/default/deploy/DepartmentWEB-portlet.war/ parentPolicy=AFTER_BUT_JAVA_BEFORE parent=ClassLoaderDomain#5183a17c{DefaultDomain}} roots=[MemoryContextHandler#432465105[path= context=vfsmemory://5c4o13m-e9nqdk-h49ogxti-1-h49ohbp5-2a
can you help me ?
The ClassNotFound condition can result from two issues:
The class that the classloader complains about is not on the classpath
The class that the classloader complains about references another class that cannot be loaded for some reason (e.g. it's not on the classpath or references something else that is not...)
So: Check your classpath: Is com.esprit.metier.AdressDao on there? Its superclasses (the whole hierarchy) and all interfaces it implements? All members and referenced classes (see method signatures as well).
Further, if this really is a portlet's jsp, it shouldn't contain <html>, <head> and <body> as this is the business of the portal to add these to the page. You'll also probably need to include your css either in the theme or in liferay-portlet.xml in the <header-css> section (but this shouldn't influence your class-not-found experiences, it's just general portal advice)

GChart on GAE wont show

I am using Eclipse with GAE on a MacBook Pro with GChart. My problem is that I cant get any chart to show when I am developing, but when I use regular tools such as Buttons or Labels with GAE they work just fine. The code doesn't give me any errors, so I am assuming that I have the right code:
public class TestingTesting implements EntryPoint {
public void onModuleLoad() {
GChart graf = new GChart();
graf.setTitle("testing");
graf.setChartSize(200, 200);
graf.addCurve();
graf.getCurve().getSymbol().setFillThickness(2);
for (int i = 0; i < 10; i++)
graf.getCurve().addPoint(i,i*i);
Button btnOk = new Button("Ok");
RootPanel.get("chartdiv").add(graf);
RootPanel.get("button").add(btnOk);
}
}
and my TestingTesting.gwt.xml file looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<module rename-to='testingtesting'>
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User' />
<!-- Inherit the default GWT style sheet. You can change -->
<!-- the theme of your GWT application by uncommenting -->
<!-- any one of the following lines. -->
<inherits name='com.google.gwt.user.theme.standard.Standard' />
<!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
<!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/> -->
<!-- Other module inherits -->
<inherits name='com.googlecode.gchart.GChart' />
<!-- Specify the app entry point class. -->
<entry-point class='test.gchart.sollution.client.TestingTesting' />
<!-- Specify the paths for translatable code -->
<source path='client' />
<source path='shared' />
</module>
My TestingTesting.html looks like this:
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Chart Example</title>
<script type="text/javascript" language="javascript"
src="testingtesting/testingtesting.nocache.js"></script>
</head>
<body>
<div id="chartdiv"></div>
<div id="button"></div>
</body>
</html>
other than that, my structure of the project in Eclipse is
/
- gchart.jar
- App Engine SDK [App Engine 1.3.5]
- GWT SDK [GWT - 2.0.4]
- JRE System Library
- src
-- test.gchart.sollution
--- TestingTesting.gwt.xml
-- test.gchart.sollution.client
--- TestingTesting.java
-- test.gchart.sollution.server
-- test.gchart.sollution.shared
--- FieldVerifier.java
- META-INF
-- jdoconfig.xml
- log4j.properties
- war
-- TestTest.html
- WEB-INF
-- appengine-web.xml
-- logging.properties
-- web.xml
Can anyone help me to figure out what the problem might be? The button shows without any problem, but the chart doesn't?
I figuered out what I've made wrong.
I forgot on the TestingTesting.java to include
RootPanel.get("chartdiv").add(graf);
graf.update(); // you have to update your graph before it renders