---
schema_version: "1"
id: 1a5bb06cca9239fe73c6b62ef81d5d1ae0659ef46d3187428a413c4462913da0
title: SiteGenesis Server-Side Scripts
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/cc/264-0-0/b2c_server_side_scripts.md
canonical_url: https://help.salesforce.com/s/articleView?id=cc.b2c_server_side_scripts.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 6375de3460560daaaf9fcf3b0d26a1c43f5ffe1b9c7c6a575ed818644cbe08a2
description: Server-side scripts in B2C Commerce SiteGenesis handle client-side requests. All scripts are CommonJA modules with defined exports.
products:
  - Commerce
  - B2C Commerce
release: "264"
---
# SiteGenesis Server-Side Scripts

Server-side scripts in B2C Commerce SiteGenesis handle client-side requests. All scripts are CommonJA modules with defined exports.

Server-side scripts handle client-side requests. All scripts are CommonJA modules with defined exports.

**Server-side Scripts Modifications**

**`cart/calculate.js`**

- Copy code from Salesforce Reference Architecture (SFRA) base to make sure all shipments in the Basket have a shipping method before applying shipping cost, as part of the larger cart calculation script
- Without this change the Pay Now use case doesn’t work in mini cart, and possibly the cart. Without customization, SiteGenesis doesn’t apply the default shipping method, which results in N/A shipping cost.
    
    ![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-cc-b2c_merchandiser_administrator-264-0-0-production-enus/ea76f372-6cfa-42a6-8e7c-05c6df7abed8/images/icon_note.png)
    
    Note Pay Now isn’t available for an unorderable basket

`**payment/common.js**`

- Copy code from plug-in\_commercepayments
- Use the copied code to validate the payment instrument in the basket, allowing for potential gift certificate line items to also be present