Days Available is a product attribute representing the time since B2C Commerce created the item.
B2C Commerce calculates the attribute 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:
- B2C Commerce computes this value in real time (see the following calculation instructions)
- Cannot be imported or exported
- Isn’t staged, so its value is specific to an instance
- Doesn’t require any special handling for base products or product sets. B2C Commerce calculates Days Available for a product base product 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