Updating a store to include dependent JavaScript and CSS from the Aurora starter store
After you update the JSP files for your store catalog pages, update your store directory structure to include any dependent JavaScript, CSS, and images. By default, Commerce Composer widgets are depended on the assets that are included within the Aurora starter store archive. To ensure that your store pages can display and use Commerce Composer widgets, you must copy the dependent assets into you store directory structure.
The Commerce Composer widgets depend on the following types
of assets that are included with the Aurora starter store archive:
- JavaScript files, which provide some general functions for store pages, such as showing error messages, adding items to the shopping cart, indicating the progress of store functions, and more.
- CSS files, which define the default styling for Commerce Composer widgets.
- Images, which your store pages can display to shoppers in widgets.
Note: The following steps add files common for a catalog entry
Product Details page as an example, however your store catalog page might
require you to add different JavaScript and CSS files.
Procedure
Update the JavaScript files for your starter store
pages
-
Update the CommonControllerDeclaration.js JavaScript file for your
store.
- In a file manager, go to the tempAuroraDir\StoreAssetsDir\javascript directory, where tempAuroraDir is the temporary directory where you extracted the Aurora.sar archive.
- Copy the CommonControllerDeclaration.js file.
- In the Enterprise Explorer view, go to the Stores\WebContent\store\javascript directory, where store is the name of your store directory, for instance AuroraESite.
- Back up the CommonControllerDeclaration.js file.
- Add the copied file into the javascript directory for your store to overwrite the original file for your store.
- Open the backup version of your CommonControllerDeclaration.js file for editing.
- Copy the code that defines the MiniShoppingCartController.
- Open the CommonControllerDeclaration.js file that you copied from the StoreAssetsDir\javascript directory for editing.
- Add the copied MiniShoppingCartController code into your new CommonControllerDeclaration.js file.
- Save and close the file.
Note: When you are updating other store pages, view the page in a web browser that includes a debugging tool to identify any missing JavaScript functions. Compare your backed up CommonControllerDeclaration.js file with the version of the file you copied from the Aurora store archive to locate the code that you must add to the copied file. -
Add the JavaScript files that the Commerce Composer widgets require into your
starter store directory structure.
-
Update your store page to use the common JavaScript files that you moved into your starter
store directory structure.
For example, to update the Product Details page, update the main JSP for the page to use the shopping action JavaScript files.
-
Update the StoreCommonUtilities.js JavaScript file for your store.
Update the CSS for your store page to use CSS for Commerce Composer assets.
-
Add the CSS files from Aurora starter store directory structure into your starter store
directory structure.
-
Update the common1_1.css file for your store to use the CSS files you
added.
-
Verify that your updated catalog store page displays correctly in your store and is not missing
any dependent assets from the Aurora starter store archive.