Configure Minimum Setup Requirements

This topic applies to

Applies to

SuiteCommerce Web Stores

After installing your application, you have access to the Web Site Setup Record in NetSuite. In this record, you must do the following before you can view your site on a development domain.

Set Minimum Site Record Fields

Although there are many things you will want to set up on the Web Site Setup record there are a few required settings before you can view your site.

To set minimum site record fields :

  1. In NetSuite, go to Setup > SuiteCommerce Advanced > Set Up Web Site.

  2. Click Edit next to the site you want to set up.

  3. On the Setup tab, in the Home Page field, select Hosting Files : Live Hosting Files.

  4. On the Shopping tab, on the Currency and Languages areas, enable at least one currency and one language to be online as the default.

  5. Save the Web Site record.

Import Field Sets

Data from NetSuite, such as item information, is made available to your web store by defining a set of fields to expose. This section explains how to use a pre-defined script to quickly populate your site with required Field Sets. You can add fields specific for your business to this script or just accept the defaults to begin.

Warning

Do not delete field sets, as this may cause unintended results.


To use the script:

  1. Copy the contents of the Field Set Script below to a text editor.

  2. Edit the siteID variable with the site id you want to use.

    The site id is displayed in the URL when you navigate to the Web Site Setup page for the desired site.

    Note

    The default value of 9999 fails, since no site is ever assigned an ID of 9999.


  3. Set the configurable options as required.

    Each Field Set Setup Script includes a few options you can set. The default options add fields for using Product Reviews but not for Pickup In Store. Set the has_store_pickup flag to true if you intend to use Pickup In Store in your web store.

  4. Optionally, add any field set definitions as needed for your site.

    The script includes all required fields and provides a good starting point for your website.

    Important

    The Field Set to return item details is named details. If you decide to use a different name, you must configure that change as described in Items Fields Advanced Name on the Backend Subtab.


  5. Save your modified script.

    Your modified script can be used to quickly replicate a site setup during development.

  6. Execute the script in the SuiteScript debugger.

    1. Go to Customization > Scripting > Script Debugger.

    2. Enter the SuiteScript Debugger domain (by clicking the link as indicated) and then re-enter your login credentials if prompted.

    3. From the API Version dropdown, select 1.0.

      Important

      This script can only be run against SuiteScript Version 1.0.


    4. Copy and paste your modified script code into the debugger.

    5. Click Debug Script and then hit the Continue button.

After the script has executed, field sets are properly populated and can be verified in the Field Sets tab of the Web Site Setup record.

Field Set Script

Note

If you have previously set up fields for your site, before running this script delete any field sets that are currently defined for the website where you want to run the script. Use caution when doing this as deleting field sets required for your site can have unintended results.


var siteID = 99999 // change to the site id you want to use
,   has_product_reviews = true
,   has_store_pickup = false
,   siteRecord = nlapiLoadRecord('website', siteID);
siteRecord.selectNewLineItem('fieldset');
siteRecord.setCurrentLineItemValue('fieldset', 'fieldsetname', 'Search');
siteRecord.setCurrentLineItemValue('fieldset', 'fieldsetid', 'search');
siteRecord.setCurrentLineItemValue('fieldset', 'fieldsetrecordtype', 'ITEM');
var search_fields = 'urlcomponent,itemimages_detail,itemoptions_detail,internalid,matrixchilditems_detail,onlinecustomerprice,onlinecustomerprice_detail,onlinecustomerprice_formatted,onlinematrixpricerange,onlinematrixpricerange_formatted,quantityavailable,displayname,itemid,outofstockbehavior,outofstockmessage,stockdescription,storedescription,storedisplaythumbnail,storedisplayname2,isinstock,isbackorderable,ispurchasable,showoutofstockmessage';
if(has_product_reviews)
{
    search_fields += ',custitem_ns_pr_count,custitem_ns_pr_rating';
}
if(has_store_pickup)
{
    search_fields += ',isstorepickupallowed,isfulfillable';
}
siteRecord.setCurrentLineItemValue('fieldset', 'fieldsetfields', search_fields);
siteRecord.commitLineItem('fieldset');
siteRecord.selectNewLineItem('fieldset');
siteRecord.setCurrentLineItemValue('fieldset', 'fieldsetname', 'details');
siteRecord.setCurrentLineItemValue('fieldset', 'fieldsetid', 'details');
siteRecord.setCurrentLineItemValue('fieldset', 'fieldsetrecordtype', 'ITEM');
var details_fields = 'urlcomponent,itemimages_detail,itemoptions_detail,internalid,matrixchilditems_detail,onlinecustomerprice_detail,quantityavailable,displayname,itemtype,itemid,outofstockbehavior,outofstockmessage,pagetitle,rate,rate_formatted,relateditemsdescription,stockdescription,storedetaileddescription,storedisplayimage,storedisplayname2,isinstock,isbackorderable,ispurchasable,showoutofstockmessage,metataghtml,minimumquantity,maximumquantity';
if(has_product_reviews)
{
    details_fields += ',custitem_ns_pr_count,custitem_ns_pr_rating,custitem_ns_pr_item_attributes,custitem_ns_pr_rating_by_rate';
}
if(has_store_pickup)
{
    details_fields += ',isfulfillable,isstorepickupallowed,quantityavailableforstorepickup_detail';
}
siteRecord.setCurrentLineItemValue('fieldset', 'fieldsetfields', details_fields);
siteRecord.commitLineItem('fieldset');
siteRecord.selectNewLineItem('fieldset');
siteRecord.setCurrentLineItemValue('fieldset', 'fieldsetname', 'matrixchilditems');
siteRecord.setCurrentLineItemValue('fieldset', 'fieldsetid', 'matrixchilditems');
siteRecord.setCurrentLineItemValue('fieldset', 'fieldsetrecordtype', 'ITEM');
var matrix_fields = 'onlinecustomerprice_detail,internalid,quantityavailable,outofstockbehavior,outofstockmessage,stockdescription,isinstock,isbackorderable,ispurchasable,showoutofstockmessage,itemid,minimumquantity,maximumquantity,itemtype';
if(has_store_pickup)
{
    matrix_fields += ',isfulfillable,isstorepickupallowed,quantityavailableforstorepickup_detail';
}
siteRecord.setCurrentLineItemValue('fieldset', 'fieldsetfields', matrix_fields);
siteRecord.commitLineItem('fieldset');
siteRecord.selectNewLineItem('fieldset');
siteRecord.setCurrentLineItemValue('fieldset', 'fieldsetname', 'matrixchilditems_search');
siteRecord.setCurrentLineItemValue('fieldset', 'fieldsetid', 'matrixchilditems_search');
siteRecord.setCurrentLineItemValue('fieldset', 'fieldsetrecordtype', 'ITEM');
var matrix_fields = 'onlinecustomerprice_detail,internalid,outofstockbehavior,outofstockmessage,stockdescription,isinstock,isbackorderable,ispurchasable,showoutofstockmessage,itemid,minimumquantity,maximumquantity,itemtype';
if(has_store_pickup)
{
    matrix_fields += ',isfulfillable,isstorepickupallowed,quantityavailableforstorepickup_detail';
}
siteRecord.setCurrentLineItemValue('fieldset', 'fieldsetfields', matrix_fields);
siteRecord.commitLineItem('fieldset');
siteRecord.selectNewLineItem('fieldset');
siteRecord.setCurrentLineItemValue('fieldset', 'fieldsetname', 'Correlated Items');
siteRecord.setCurrentLineItemValue('fieldset', 'fieldsetid', 'correlateditems');
siteRecord.setCurrentLineItemValue('fieldset', 'fieldsetrecordtype', 'ITEM');
var correlated_fields = 'urlcomponent,itemimages_detail,itemoptions_detail,internalid,onlinecustomerprice,onlinecustomerprice_detail,onlinecustomerprice_formatted,onlinematrixpricerange,onlinematrixpricerange_formatted,quantityavailable,displayname,itemid,outofstockbehavior,outofstockmessage,stockdescription,storedescription,storedisplaythumbnail,storedisplayname2,isinstock,isbackorderable,ispurchasable,showoutofstockmessage';
if(has_product_reviews)
{
    correlated_fields += ',custitem_ns_pr_count,custitem_ns_pr_rating';
}
siteRecord.setCurrentLineItemValue('fieldset', 'fieldsetfields', correlated_fields);
siteRecord.commitLineItem('fieldset');
siteRecord.selectNewLineItem('fieldset');
siteRecord.setCurrentLineItemValue('fieldset', 'fieldsetname', 'Related Items');
siteRecord.setCurrentLineItemValue('fieldset', 'fieldsetid', 'relateditems');
siteRecord.setCurrentLineItemValue('fieldset', 'fieldsetrecordtype', 'ITEM');
var related_fields = 'urlcomponent,itemimages_detail,itemoptions_detail,internalid,onlinecustomerprice,onlinecustomerprice_detail,onlinecustomerprice_formatted,onlinematrixpricerange,onlinematrixpricerange_formatted,quantityavailable,displayname,itemid,outofstockbehavior,outofstockmessage,stockdescription,storedescription,storedisplaythumbnail,storedisplayname2,isinstock,isbackorderable,ispurchasable,showoutofstockmessage';
if(has_product_reviews)
{
    related_fields += ',custitem_ns_pr_count,custitem_ns_pr_rating';
}
siteRecord.setCurrentLineItemValue('fieldset', 'fieldsetfields', related_fields);
siteRecord.commitLineItem('fieldset');
siteRecord.selectNewLineItem('fieldset');
siteRecord.setCurrentLineItemValue('fieldset', 'fieldsetname', 'Order');
siteRecord.setCurrentLineItemValue('fieldset', 'fieldsetid', 'order');
siteRecord.setCurrentLineItemValue('fieldset', 'fieldsetrecordtype', 'ITEM');
var order_fields = 'itemimages_detail,itemoptions_detail,onlinecustomerprice_detail,displayname,internalid,itemid,isfulfillable,storedisplayname2,urlcomponent,outofstockmessage,showoutofstockmessage,isinstock,isbackorderable,ispurchasable,pricelevel1,pricelevel1_formatted,stockdescription,matrixchilditems_detail,itemtype,minimumquantity,maximumquantity,isonline,isinactive';
if(has_store_pickup)
{
    order_fields += ',isstorepickupallowed,quantityavailableforstorepickup_detail,isfulfillable';
}
siteRecord.setCurrentLineItemValue('fieldset', 'fieldsetfields', order_fields);
siteRecord.commitLineItem('fieldset');
siteRecord.selectNewLineItem('fieldset');
siteRecord.setCurrentLineItemValue('fieldset', 'fieldsetname', 'Type Ahead');
siteRecord.setCurrentLineItemValue('fieldset', 'fieldsetid', 'typeahead');
siteRecord.setCurrentLineItemValue('fieldset', 'fieldsetrecordtype', 'ITEM');
var typeahead_fields = 'itemid,displayname,storedisplayname2,urlcomponent,itemimages_detail';
if(has_product_reviews)
{
    typeahead_fields += ',custitem_ns_pr_count,custitem_ns_pr_rating';
}
siteRecord.setCurrentLineItemValue('fieldset', 'fieldsetfields', typeahead_fields);
siteRecord.commitLineItem('fieldset');
siteRecord.selectNewLineItem('fieldset');
siteRecord.setCurrentLineItemValue('fieldset', 'fieldsetname', 'Items Searcher');
siteRecord.setCurrentLineItemValue('fieldset', 'fieldsetid', 'itemssearcher');
siteRecord.setCurrentLineItemValue('fieldset', 'fieldsetrecordtype', 'ITEM');
var items_searcher_fields = 'itemimages_detail,displayname,itemid,storedisplayname2,urlcomponent,minimumquantity,maximumquantity,itemoptions_detail,matrixchilditems_detail,isinstock,showoutofstockmessage,outofstockmessage,onlinecustomerprice_detail,pricelevel1,pricelevel1_formatted,itemtype,ispurchasable,isbackorderable';
if(has_product_reviews)
{
    items_searcher_fields += ',custitem_ns_pr_count,custitem_ns_pr_rating';
}
siteRecord.setCurrentLineItemValue('fieldset', 'fieldsetfields', items_searcher_fields);
siteRecord.commitLineItem('fieldset');
siteRecord.selectNewLineItem('fieldset');
siteRecord.setCurrentLineItemValue('fieldset', 'fieldsetname', 'Related Items Details');
siteRecord.setCurrentLineItemValue('fieldset', 'fieldsetid', 'relateditems_details');
siteRecord.setCurrentLineItemValue('fieldset', 'fieldsetrecordtype', 'ITEM');
siteRecord.setCurrentLineItemValue('fieldset', 'fieldsetfields', 'relateditems_detail');
siteRecord.commitLineItem('fieldset');
siteRecord.selectNewLineItem('fieldset');
siteRecord.setCurrentLineItemValue('fieldset', 'fieldsetname', 'Correlated Items Details');
siteRecord.setCurrentLineItemValue('fieldset', 'fieldsetid', 'correlateditems_details');
siteRecord.setCurrentLineItemValue('fieldset', 'fieldsetrecordtype', 'ITEM');
siteRecord.setCurrentLineItemValue('fieldset', 'fieldsetfields', 'correlateditems_detail');
siteRecord.commitLineItem('fieldset');
recId = nlapiSubmitRecord(siteRecord);

Set Up the Search Index

After setting up your field sets, create a minimum search index. The search index is needed for your web store to have access to data associated with defined field sets. You can enhance this at a later time.

To set up the search index:

  1. In NetSuite, go to Setup > SuiteCommerce Advanced > Set Up Web Site.

  2. Click Edit next to the site you want to set up.

  3. On the Search Index tab, Facet Fields subtab, select at least one facet in the Facet Field Name field to enable in the frontend (for example, Online Price).

  4. Save the Web Site record.

Once you have completed the minimum setup requirements, you are ready for the Next Steps to view your site and start building it out for your business.