Testing Themes Locally on SuiteCommerce for Optimization

Test and optimize your SuiteCommerce themes locally before deployment to ensure functionality and performance without risks.

·2 min read·View Oracle Docs

You can test your theme customizations on a local server before deploying to NetSuite. This is crucial for ensuring the frontend changes work correctly and provides a controlled environment for testing.

Why Test Locally?

Testing your SuiteCommerce themes locally allows you to make adjustments and verify functionalities in real time. The local server is especially beneficial for checking changes related to skins or for Sass variables exposed to the SuiteCommerce Theme Manager (SMT).

How to Test Your Theme on a Local Server

Follow these steps to effectively test your theme:

  1. Set Up Your Environment:

    • Open your terminal and navigate to your top-level development directory.
  2. Run the Gulp Command: To compile and deploy your theme locally, execute the following command:

    bash
    gulp theme:local

    Warning: This command updates the manifest.json file for your theme, potentially overwriting any manual changes. To prevent data loss, use this command instead:

    bash
    gulp theme:local --preserve-manifest
  3. Access Your Theme in a Browser: Using the structure below, replace the variables with your configurations:

    • http://<DOMAIN_NAME>/c.<ACCOUNT_ID>/<SSP_APPLICATION>/shopping-local.ssp
    • http://<DOMAIN_NAME>/c.<ACCOUNT_ID>/<SSP_APPLICATION>/my_account-local.ssp
    • http://<DOMAIN_NAME>/c.<ACCOUNT_ID>/<SSP_APPLICATION>/checkout-local.ssp

    Variable Replacement:

    VariableReplacement
    DOMAIN_NAMEYour NetSuite website domain (e.g., http://www.mysite.com)
    ACCOUNT_IDYour NetSuite account ID (e.g., c.123456)
    SSP_APPLICATIONRoot URL for the application (use scs for SuiteCommerce)
  4. Update Changes After Launch: If you add files or make changes after starting the local server, remember to rerun the gulp theme:local command to include those updates, as Gulp.js does not automatically handle new files.

Output of the Gulp Command

When you run gulp theme:local, it compiles all source files and builds the local distribution in the LocalDistribution/tmp directory. This includes all your Sass and template files. The local server initializes watch tasks, which will automatically recompile source files upon detecting changes.

Next Steps

Once you've completed testing your theme locally, the next stage is deploying the theme to NetSuite. After deployment, don’t forget to activate your theme for it to be visible on your website.

Key Points to Remember

  • Testing locally minimizes risks before deployment.
  • Always manage your manifest.json carefully to avoid data loss.
  • Ensure subsequent changes are reflected by rerunning the Gulp commands as needed.

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

Frequently Asked Questions (4)

Do I need to update the `manifest.json` file manually when testing themes locally on SuiteCommerce?
Running the `gulp theme:local` command updates the `manifest.json` file automatically. To avoid overwriting manual changes, use `gulp theme:local --preserve-manifest`.
How can I access my locally tested theme in a browser?
Replace the placeholders in the following URL format with your specific configurations: `http://<DOMAIN_NAME>/c.<ACCOUNT_ID>/<SSP_APPLICATION>/shopping-local.ssp` where _DOMAIN_NAME_, _ACCOUNT_ID_, and _SSP_APPLICATION_ are your website's domain, NetSuite account ID, and application root URL respectively.
What should I do if I make changes to my theme after launching the local server?
If changes are made after launching the local server, rerun the `gulp theme:local` command to update the local distribution with those changes, as Gulp.js does not automatically detect new files.
Does testing themes locally on SuiteCommerce require any special preparations?
Yes, set up your environment by navigating to your top-level development directory in the terminal and prepare to use the Gulp command to compile and run your theme locally.
Source: What Happens When You Test a Theme on a Local Server? 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 →