Moving Coupon Block on the top of the page - magento2

I would like to move coupon block on the upper side of the page (before cart summary).
Coupon block are located on: App/design/frontend/mytheme/themename/default/Magento_Checkout/layout/checkout_cart_index.xml
<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceContainer name="checkout.cart.container">
<container name="cart.discount" label="Cart Discount Container" htmlTag="div" htmlClass="cart-discount" after="-" />
</referenceContainer>
<move element="checkout.cart.crosssell" destination="checkout.cart.container" after="-" />
<move element="checkout.cart.coupon" destination="cart.discount" />
<move element="checkout.cart.shortcut.buttons" destination="checkout.cart.methods" after="checkout.cart.methods.onepage.bottom"/>
</body>

Related

Magento 2 Block not adding

Magento 2 related Problem:
The header.phtml gets included but the purchase.phtml doesn't and we can't find the issue why. This bug only appears on our success page
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="head.additional">
<block class="Anowave\Ec\Block\Track" name="ec_header" as="ec_header" template="header.phtml" />
<block class="Anowave\Ec\Block\Track" name="ec_purchase" as="ec_purchase" template="purchase.phtml" >
<block class="Anowave\Ec\Block\Track" name="ec_datalayer" as="ec_datalayer" template="datalayer.phtml" />
<block class="Anowave\Ec\Block\Track" name="ec_impressions" as="ec_impressions" template="impression.phtml" />
<block class="Anowave\Ec\Block\Track" name="ec_search" as="ec_search" template="search.phtml" />
<block class="Anowave\Ec\Block\Track" name="ec_detail" as="ec_detail" template="detail.phtml" />
</block>
</referenceBlock>
<referenceContainer name="after.body.start">
<block class="Anowave\Ec\Block\Track" name="ec_noscript" as="ec_noscript" template="noscript.phtml" />
</referenceContainer>
<referenceContainer name="before.body.end">
<block class="Anowave\Ec\Block\Track" name="ec_events" as="ec_events" template="events.phtml" />
<block class="Anowave\Ec\Block\Track" name="ec_promotions" as="ec_promotions" template="promotions.phtml" />
<block class="Anowave\Ec\Block\Track" name="ec_footer" as="ec_footer" template="footer.phtml" />
</referenceContainer>
</body>
</page>
Looks like you want call templates in a template. Try insert the code below in your purchase.phtml:
include ($block->getTemplateFile('Anowave_ec::search.phtml'));

Oracle ADF Essentials 10.2.1 Task Flow Not Working

I have create a simple JSPX file and a Task Flow using Eclipse Neon OEPE 12.2.1.5
Task Flow XML mainTab.xml
<?xml version="1.0" encoding="UTF-8"?>
<adfc-config xmlns="http://xmlns.oracle.com/adf/controller" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.oracle.com/adf/controller http://xmlns.oracle.com/adf/controller/adfc-config_1_0.xsd">
<task-flow-definition id="mainTab">
<default-activity>view1</default-activity>
<view id="view1">
<page>/view1.jsff</page>
</view>
<view id="view2">
<page>/view2.jsff</page>
</view>
<control-flow-rule>
<from-activity-id>view1</from-activity-id>
<control-flow-case>
<from-outcome>openView2</from-outcome>
<to-activity-id>view2</to-activity-id>
</control-flow-case>
</control-flow-rule>
<control-flow-rule>
<from-activity-id>view2</from-activity-id>
<control-flow-case>
<from-outcome>openView1</from-outcome>
<to-activity-id>view1</to-activity-id>
</control-flow-case>
</control-flow-rule>
<use-page-fragments/>
</task-flow-definition>
</adfc-config>
Main JSPX file
<?xml version='1.0' encoding='UTF-8'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
<jsp:directive.page contentType="text/html;charset=UTF-8" />
<f:view>
<af:document id="d1">
<af:form id="f1">
<af:panelStretchLayout id="psl1">
<f:facet name="center">
<af:region value="#{bindings.mainTab.regionModel}"
id="r1" />
</f:facet>
</af:panelStretchLayout>
</af:form>
</af:document>
</f:view>
</jsp:root>
First View view1.jsff
<?xml version='1.0' encoding='UTF-8'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
<af:panelStretchLayout id="psl1">
<f:facet name="center">
<af:panelGroupLayout layout="vertical" id="p1">
<af:outputText id="o1" value="Hello View 1"></af:outputText>
<af:button id="b1" text="Load View 2" action="openview2"></af:button>
</af:panelGroupLayout>
</f:facet>
</af:panelStretchLayout>
</jsp:root>
Second View view2.jsff
<?xml version='1.0' encoding='UTF-8'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
<af:panelStretchLayout id="psl1">
<f:facet name="center">
<af:panelGroupLayout layout="vertical" id="p1">
<af:outputText id="o1" value="Hello View 2"></af:outputText>
<af:button id="b1" text="Load View 1" action="openview1"></af:button>
</af:panelGroupLayout>
</f:facet>
</af:panelStretchLayout>
</jsp:root>
When run the JSPX file Hello View 1 and the button Load View 2 appears, but clicking on the button nothing happens
I am also getting this warning at action="openview1"
The action value does not match a navigation case outcome
I tried the auto completion goto in eclipse with action="view1"
still the button does nothing

DGML - Add weight to link

How do I add weight or value to the Edges or Link in a DGML file?
<?xml version='1.0' encoding='utf-8'?>
<DirectedGraph xmlns="http://schemas.microsoft.com/vs/2009/dgml">
<Nodes>
<Node Id="a" Label="a" Size="10" />
<Node Id="b" Background="#FF008080" Label="b" />
<Node Id="c" Label="c" Start="2010-06-10" />
</Nodes>
<Links>
<Link Source="a" Target="b" />
<Link Source="a" Target="c" />
</Links>
<Properties>
<Property Id="Background" Label="Background" DataType="Brush" />
<Property Id="Label" Label="Label" DataType="String" />
<Property Id="Size" DataType="String" />
<Property Id="Start" DataType="DateTime" />
</Properties>
</DirectedGraph>
I would like to be able to assign a weight or value to the lines between each node to designate the strength between the nodes.
You can add weights to each link by adding a label field with a value to each of the Link Sources. The numbers will appear beside the arrows on your graph.
<Link Source="a" Target="b" Label="5" />
<Link Source="a" Target="c" Label="6" />
Additionally, the background color of each node can be changed by creating Category groups and assigning that group to each node.
<Category Id="Orange" Background="Orange" />
<Category Id="Yellow" Background="Yellow" />
<Node Id="a" Category="Orange" />
<Node Id="b" Category="Yellow" />
Here's an example that uses a link Weight Style to do it:
<DirectedGraph xmlns="http://schemas.microsoft.com/vs/2009/dgml">
<Nodes>
<Node Id="Banana" UseManualLocation="True" />
<Node Id="Test" UseManualLocation="True" />
</Nodes>
<Links>
<Link Source="Test" Target="Banana" Priority="10"/>
<Link Source="Test" Target="Green" />
</Links>
<Properties>
<Property Id="Bounds" DataType="System.Windows.Rect" />
<Property Id="UseManualLocation" DataType="System.Boolean" />
</Properties>
<Styles>
<Style TargetType="Link">
<Setter Property="Weight" Expression="Priority" />
</Style>
</Styles>
</DirectedGraph>

Color swatch on compare page in magento2

Magento2
How can be get the color swatch on product compare page..
To have color swtach on product compare page you need to create custom module:-
Create a layout file with the name as catalog_product_compare_index.xml and add below code in the file created.
<?xml version="1.0"?>
<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<css src="Magento_Swatches::css/swatches.css"/>
</head>
<body>
<referenceContainer name="content">
<referenceBlock name="catalog.compare.list">
<action method="setTemplate">
<argument name="template" xsi:type="string">W3solver_Compareswatch::product/compare/list.phtml</argument>
</action>
<block class="Magento\Framework\View\Element\RendererList" name="category.product.type.details.renderers" as="details.renderers">
<block class="Magento\Swatches\Block\Product\Renderer\Listing\Configurable" as="configurable" template="Magento_Swatches::product/listing/renderer.phtml" />
</block>
</referenceBlock>
</referenceContainer>
</body>
</page>
You need to add one function in your overriden list.phtml on line 63
<?php
if($_item->getTypeId() == "configurable"):
echo $block->getProductDetailsHtml($_item);
endif;
?>
This will show the color patches on compare page.

Page navigation in ICEFaces

I recently started working on JSF in ICEFaces FrameWork(Server # Glassfish).
I have one question.
In my first JSF page i have radio buttons, If i to select and click on next page, I have to publish those selected values in my second page. If i click on back button , i have to show the selected values in my first page.
How can i achieve this? Please suggest
My First Page(suites.xhtml).
<?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:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ace="http://www.icefaces.org/icefaces/components">
<ui:composition template="/WEB-INF/templates/template.xhtml">
<ui:param name="title" value="Eclipse Template Test Page" />
<ui:param name="companyName" value="Autoexetc" />
<ui:define name="menuItems">
<ace:menuItem value="Dashboard" url="/dashboard.jsf" icon="ui-icon ui-icon-home"
styleClass="menuBarItem" />
<ace:menuItem value="Suites" url="/suites.jsf" styleClass="menuBarItem" />
<ace:menuItem value="Status" url="/status.jsf" styleClass="menuBarItem" />
<ace:menuItem value="Report" url="#" styleClass="menuBarItem" />
<ace:menuItem value="Terminal" url="#" styleClass="menuBarItem" />
</ui:define>
<ui:define name="tabItems">
Your in Suites Page <h:commandButton value="Back To DashBoard" action="dashboard" />
<br></br>
1. Hard-coded with "f:selectItem" :
<h:selectOneRadio value="#{user.favColor1}">
<f:selectItem itemValue="Red" itemLabel="Color1 - Red" />
<f:selectItem itemValue="Green" itemLabel="Color1 - Green" />
<f:selectItem itemValue="Blue" itemLabel="Color1 - Blue" />
</h:selectOneRadio>
<br />
2. Generated by Map :
<h:selectOneRadio value="#{user.favColor2}">
<f:selectItems value="#{user.favColor2Value}" />
</h:selectOneRadio>
<br />
3. Generated by Object array and iterate with var :
<h:selectOneRadio value="#{user.favColor3}">
<f:selectItems value="#{user.favColor3Value}" var="c"
itemLabel="#{c.colorLabel}" itemValue="#{c.colorValue}" />
</h:selectOneRadio>
<br />
<h:commandButton value="Submit" action="status" />
<h:commandButton value="Reset" type="reset" />
</ui:define>
</ui:composition>
</html>
And My Result Page (status.Xhtml), which gives my selected values.
<?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:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ace="http://www.icefaces.org/icefaces/components">
<ui:composition template="/WEB-INF/templates/template.xhtml">
<ui:param name="title" value="Eclipse Template Test Page" />
<ui:param name="companyName" value="Autoexetc" />
<ui:define name="menuItems">
<ace:menuItem value="Dashboard" url="/dashboard.jsf" icon="ui-icon ui-icon-home"
styleClass="menuBarItem" />
<ace:menuItem value="Suites" url="/suites.jsf" styleClass="menuBarItem" />
<ace:menuItem value="Status" url="/status.jsf" styleClass="menuBarItem" />
<ace:menuItem value="Report" url="#" styleClass="menuBarItem" />
<ace:menuItem value="Terminal" url="#" styleClass="menuBarItem" />
</ui:define>
<ui:define name="tabItems">
Your in status Page <h:commandButton value="Back To suites" action="suites" />
<br/>
<ol>
<li>user.favColor1 : #{user.favColor1}</li>
<li>user.favColor2 : #{user.favColor2}</li>
<li>user.favColor3 : #{user.favColor3}</li>
</ol>
</ui:define>
When i click on back button from my result page, first page will display with selected values, if i re-select any values and submit it, cant able to navigate to my result page.