Skip to content

Stock & Capacity Manager

Stock & Capacity Manager is a Paymenter extension for hosting providers who can only deliver a limited number of a product, for example a fixed number of VPS slots on a node. You set how many services of a product may exist. The extension counts the services that exist for the product, blocks further orders once the limit is reached and can show the remaining quantity on the product page.

Product page with the notice "Only 9 remaining" below the Add to cart button

What it does

  • Capacity per product. Each product can get one stock configuration with a Maximum stock. Products without a configuration are not affected.
  • Usage counted from services. Used capacity is the sum of the quantities of all services of the product that are not cancelled. Pending, active and suspended services occupy capacity. There is no counter to maintain.
  • Blocking at two points. A product without enough remaining capacity cannot be added to the cart, and the whole cart is checked again when the order is created. The customer sees Paymenter's out-of-stock message.
  • Quantity aware. At order creation, the quantities of all cart lines of the same product are added up before they are compared with the remaining capacity.
  • Optional remaining stock on the product page. Shows "Only N remaining" below the product page. Off by default.
  • Optional hiding when sold out. A sold-out product can be removed from the category listing. Off by default.
  • Low stock threshold. The Remaining badge in the admin list turns to the warning colour when the remaining stock reaches a value you choose.
  • Admin list. Stock & Capacity in the admin area lists max, used and remaining stock per configured product.
  • Independent of Paymenter's stock field. The extension keeps its own table and never reads or writes the stock field of a product.

Requirements

  • Paymenter 1.5.x. The extension was developed and tested against Paymenter 1.5.8.
  • PHP 8.3 or 8.4.
  • For the storefront features, the active theme must render the product page with the view products.show and the category listing with the view products.index, as Paymenter's default theme does. Blocking and the admin area do not depend on the theme.

Pages

  • Installation: upload, enable, update and uninstall.
  • Configuration: the fields of a stock configuration and how capacity is counted.
  • Usage: the admin list, what the customer sees and when orders are blocked.
  • FAQ: common questions and troubleshooting.
  • Changelog