Skip to main content
Version: next

Pledg

Since version 3.21

The Pledg extension displays payment plan simulations (such as 3x installments or 4x deferred) computed by Pledg's API on the storefront.

Once enabled, the extension contributes a paymentPlans field on the Product GraphQL type that returns the available plans for the product's unit price. The theme-chocolatine package ships a PaymentPlansBanners component that consumes this field on the product page, so customers see the available installments directly next to the price.

Prerequisites

To use this extension, you need:

  • a Pledg merchant account,
  • at least one Pledg module configured on Pledg's side (for example a 3x installment module, a 4x deferred module, etc.) along with its OAuth2 credentials (api_key, api_secret, account_id).

The extension currently supports a single flavor:

Installation

First, install the @front-commerce/pledg package:

Command to install @front-commerce/pledg
$ pnpm install @front-commerce/pledg

Then enable the extension in your front-commerce.config.ts by adding the Pledg extension definition with the flavor matching your setup.

For a Gezy-based project, the front-commerce.config.ts file would look like:

front-commerce.config.ts for a Gezy based project
import { defineConfig } from "@front-commerce/core/config";
import themeChocolatine from "@front-commerce/theme-chocolatine";
import gezy from "@front-commerce/gezy";
import pledg from "@front-commerce/pledg";
import storesConfig from "./app/config/stores";
import cacheConfig from "./app/config/caching";

export default defineConfig({
extensions: [
gezy({ storesConfig }),
themeChocolatine(),
pledg("gezy"),
],
stores: storesConfig,
cache: cacheConfig,
configuration: {
providers: [],
},
});

Supported currencies

The extension currently only validates simulations against the Euro (EUR) currency. If the shop currency is anything else, the Pledg simulator is not registered and Product.paymentPlans returns an empty list. A warning is logged at startup so you know simulators were skipped.

If you need to use Pledg with another currency, please contact us so we can validate the conversion rules and add it to the supported list.

Next steps