Skip to content

getBasketSettings()

The getBasketSettings method is used to get a BasketSettings object that represents settings for basket in the storefront.

Returned value

The BasketSettings object.

Example

source
{% set basketSettings = ObjectApi.getBasketSettings() %}
{% if basketSettings.isBuyingEnabled() %}
    <li>*Purchase - Enabled*</li>
{% else %}
    <li>*Purchase - Disabled*</li>
{% endif %}

{% if basketSettings.isBuyingEnabledToUnregistered() %}
    <li>*Everyone can purchase*</li>
{% else %}
    <li>*Registered only can purchase*</li>
{% endif %}

{% if basketSettings.isAvailabilityNotificationEnabled() %}
    <li>*Availability notifications - Enabled*</li>
{% else %}
    <li>*Availability notifications - Disabled*</li>
{% endif %}

{% if basketSettings.redirectToBasketAfterAdding() %}
    <li>*Redirect to basket - Enabled*</li>
{% else %}
    <li>*Redirect to basket - Disabled*</li>
{% endif %}

{% if basketSettings.showConfirmationMessage() %}
    <li>*Show confirmation message - Enabled*</li>
{% else %}
    <li>*Show confirmation message - Disabled*</li>
{% endif %}
output
*Purchase - Enabled*
*Everyone can purchase*
*Availability notifications - Enabled*
*Redirect to basket - Enabled*
*Show confirmation message - Disabled*