Skip to main content
Version: 3.x

Restrict quantities by packaging

Enforce packaging selection. Ensure customers select appropriate packaging quantities (boxes, cases) before adding items to cart.

Overview

Some Gezy catalogs define product packaging types (for example: box of 6, case of 24). When this feature is enabled, any product that has packaging configured must be added to the cart with a selected packaging. The "No packaging" option is hidden on the PDP, and cart validations will flag items missing a packaging.

This behavior is disabled by default and can be activated per store.

Enable the feature

Enable the behavior using environment variables (globally or per shop):

.env
FRONT_COMMERCE_GEZY_RESTRICT_QUANTITIES_BY_PACKAGING=true

What changes when enabled?

  • PDP packaging selector: the "No packaging" option is removed. Only available packaging types with quantities are listed.
  • Add to cart validation: attempting to add a product that defines packaging without selecting one will fail.
  • Cart item validation: cart items missing a packaging for products that define it will surface an error.

Products without any packaging configured are not affected.