CoolCMS API

CatalogOnlyGuardTrait

Respects the setting `4/catalog.only`.

An operation running the e-shop only as a catalog must have no working cart or checkout; otherwise orders nobody expects would be created. The pages therefore return 404 (not a redirect), so they are not indexed and behave as if they did not exist.

Table of Contents

Constants

SETTINGS_MODULE_ESHOP  : mixed = 4
Settings module (`cms_system_settings`): e-shop = 4.

Methods

allowsOutOfStockOrder()  : bool
Returns `4/order.outOfStock.allowed`: whether the customer may order goods that are not in stock.
guardCatalogOnly()  : void
isCatalogOnly()  : bool

Constants

SETTINGS_MODULE_ESHOP

Settings module (`cms_system_settings`): e-shop = 4.

private mixed SETTINGS_MODULE_ESHOP = 4

Methods

allowsOutOfStockOrder()

Returns `4/order.outOfStock.allowed`: whether the customer may order goods that are not in stock.

protected allowsOutOfStockOrder() : bool

Off (default): "Add to cart" is not offered for sold-out goods and checkout rejects it (strict reservation). On: pre-selling; the reservation may then end with the state none (nothing covered), see ReservationService.

A missing key in the DB means off: silently allowing oversell just because a settings migration was not run would be the worst possible failure.

Return values
bool
On this page

Search results