Organizing Source Files for Multi-site in SuiteCommerce

Organize source files effectively for multi-site implementations in SuiteCommerce using themes, extensions, and custom modules.

·3 min read·View Oracle Docs

TL;DR

To implement multi-site with SuiteCommerce, especially with the Aconcagua release or later, it's essential to leverage themes and extensions for efficient source file organization. This allows for streamlined deployment while maintaining a single code base for common functionality across multiple websites.

How to Organize Your Source Files for Multi-site

When working with multiple websites within SuiteCommerce, proper source file organization becomes crucial. The guidelines below help ensure your implementation is both effective and manageable.

Implementing Themes and Extensions

Starting with the Aconcagua release of SuiteCommerce Advanced (SCA) or later, utilizing themes and extensions is recommended. Themes adjust the visual styling of your website, while extensions enhance functionality. Both options can be either packaged SuiteApps or custom solutions created in-house. After installation, themes and extensions need to be activated on each specific domain associated with your website records.

Key Steps:

  • Installation and Activation: After installing your desired theme or extension, use the Extension Manager in NetSuite to activate these for each domain.
  • No Source Code Organization Needed: If using themes and extensions, you do not need to organize source code manually, simplifying the process.

When Not Using Themes and Extensions

If your implementation of SuiteCommerce Advanced does not incorporate themes and extensions, certain setup tasks are necessary to facilitate multi-site development. In these cases:

  • Custom Modules: Define different features for each website using custom modules. Each website can also maintain its unique code base, which may be necessary for specific customizations.
  • Shared Code Base: SCA allows the management of multiple websites using a shared core module code. Customizations for individual websites can be integrated seamlessly.

Directory Structure Example

When creating custom modules without using themes or extensions, organizing your code can look like this:

none
1Modules
2 suite_commerce
3 <shared modules>
4 custom_modules
5 Header_Site1
6 Header_Site2

In this structure:

  • Customized code resides within the custom_modules directory.
  • Shared code lives in Modules/suite_commerce.

Utilizing Distro Files

Each website within your multi-site arrangement makes use of a dedicated distro.json file to define which modules are included. To maintain proper organization, the distro.json file for each website is stored in a specific subdirectory under the top-level SuiteCommerce Advanced source code directory structure:

none
1Modules
2 suite_commerce
3 <shared modules>
4 custom_modules
5 Header_Site1
6 Header_Site2
7Sites
8 site1
9 distro.json
10 site2
11 distro.json

To compile and deploy code for a specific website, navigate to the appropriate site directory and execute the necessary gulp tasks. Refer to guides such as Deploy SCA Customizations to NetSuite for detailed instructions.

Key Considerations

  • If you are managing multiple websites, consider how the shared code base can reduce redundancy.
  • Always activate your themes and extensions for each specific domain once installed.
  • Maintain clarity in your directory structure to make development and deployment straightforward.

Who This Affects

  • Developers: Those tasked with building and managing different websites under SuiteCommerce.
  • Site Administrators: Individuals overseeing the deployment and activation of themes and extensions.
  • In-house Developers: Teams creating custom themes and extensions that serve specific consumer needs.

Key Takeaways

  • Use themes and extensions for streamlined multi-site management in SuiteCommerce.
  • Custom modules allow for tailored features across different websites.
  • Maintain a clear and organized directory structure for easy management and deployment.

Source: This article is based on Oracle's official NetSuite documentation.

Frequently Asked Questions (4)

Is it necessary to manually organize source code when using themes and extensions in SuiteCommerce?
No, if you are using themes and extensions starting from the Aconcagua release of SuiteCommerce Advanced, manual source code organization is not required. This approach simplifies deployment by allowing activation via the Extension Manager.
What should be done if we are implementing SuiteCommerce without themes and extensions?
For SuiteCommerce implementations without themes and extensions, tasks such as defining custom modules and managing a shared code base are necessary. This includes organizing custom code in dedicated directories and ensuring distinct features per website.
How are themes and extensions activated for each domain in a multi-site setup?
After installing the desired theme or extension, they need to be activated for each specific domain through the NetSuite Extension Manager. This ensures the correct visual styling and functionality are applied to each website.
What is the role of the distro.json file in a multi-site SuiteCommerce setup?
In a multi-site setup, each website uses a specific distro.json file to define its included modules. These files are stored in subdirectories, and the proper file is referenced during compilation and deployment to manage site-specific customizations.
Source: Organize Source Files for Multi-site Oracle NetSuite Help Center. This article was generated from official Oracle documentation and enriched with additional context and best practices.

Was this article helpful?

More in Commerce

View all Commerce articles →