Developer manual

Ecommerce layout.xml requirements

Spring Ecommerce uses additional javascript files and springtags to display the cart panel at the bottom of the page, enable dynamic updates of the cart panel and the cart page and to enable notifications.

Cart Panel

Include the following items in layout.xml to enable these features:

Below the existing <javascript/> spring tag add:

<script type="text/javascript" src="/js/system.addtocart.js"/>

Above the <javascript/> spring tag, and inside the last </div> tag include:

... existing code ...

<if source="session" id="cart" value="true">
<div id="notifications" style="display: none;">Updating...</div>

... javascript tags ...

The above code will create an invisible panel if an item exists in the cart when a page loads - this panel will then be redrawn and displayed as the cart panel (with the appropriate cart items shown dynamically).


The credit card system will return 'notices' of the result of the transaction (such as Error, Declined or Success). These notices are positioned in layout.xml using the following springtag:

Immediately above the <forms/> tag, include the following to enable errors when processing credit cards:

<if id="pageid" value="id-of-page">
<notice id="summary"/>

Change the 'id-of-page' to match the ID of the page in which the eway credit card form is located (in some setups, the ID in the 'if' tag may in fact also be 'summary'.