What is it?

The delivery message is shown on the buy button on the product detail view, within the configuration popover on the product detail view and on a line item in the case. It can be used to provide the user with an extra message unique to the selected product variant. For example an estimated delivery date, or an only x left in stock message.

The images below show how the delivery message will appear on the buy button of the product detail view, the configuration popover of the product detail view and the line item in the cart.

How to do it?

In order for the delivery message to be displayed it needs to be present as an attribute on the product stock object.

To fetch the product availability Highstreet will make a request to the following endpoint GET hsapi/index/stock

For example:

GET hsapi/index/stock?id=177839

  "stock": [
      "product_entity_id": 177839,
      "quantity": 212,
      "is_in_stock": true,
      "min_sale_quantity": null,
      "max_sale_quantity": 10000,
      "manage_stock": true,
      "backorders": false,
      "quantity_increments": false,
      "quantity_increments_value": 0,
      ** "delivery_message": "(Only 1 left)" **

Things to Note

The app expects the delivery message to be localised.

If a delivery message should not be displayed for a particular variant then the delivery message attribute should not be returned in the response or it's value should be null.