Days Available
Days Available is a product attribute representing the time since an item was created in Salesforce B2C Commerce
The attribute is calculated based on the current date and availableDate of the product. If an availableDate isn't imported, the creationDate of the product in B2C Commerce is automatically determined and used instead. It isn't based on when the product went online or became available. Days Available is a global attribute, so its value is the same across all B2C Commerce sites that share products.
Days Available:
- Is computed in real time by B2C Commerce (see the following calculation instructions)
- Cannot be imported or exported
- Is not staged, so its value is specific to an instance
- Does not require any special handling for base products or product sets. Days Available for a product base product is calculated based on the availableDate or creationDate of the base product record. Product sets are similarly handled.
If a product (p) has an available date, then the days available of the product is equal to the current date minus the available date.
DaysAvailable(p) = Current Date - Available Date(p)
If product (p) doesn't have an available date, then the days available of the product is equal to the current date minus the creation date.
DaysAvailable(p) = Current Date - Creation Date(p)
Available Date Example
- Available Date: 08/05/2008
- Creation Date: 08/04/2008
- Current Date: 08/25/2008
Days Available in days: 20
Days Available in hours: 480
No Available Date Example
- Available Date: n/a
- Creation Date: 08/04/2008
- Current Date: 08/25/2008
Days Available in days: 21
Days Available in hours: 504