Unchained is hackable

With hackable we mean to provide you with only very basic customization out of the box but on the other hand allow the developer to completely customize the business logic through code. This is achieved through a staged approach ranging from plugins to a full hard fork.

See how easy it is to implement an extremely custom pricing module with Unchained Engine below.

Weather-dependent barbeque sausage pricing

Usually when summer kicks in in Switzerland and people start to invite friends to the first barbeque party of the year, demand for sausages surges instantly. Our dear friend, butcher Bruno wants to sell his homemade sausages directly to the customer with his online shop and had this crazy idea of a special product pricing he calls weather-dependent barbeque sausage pricing.

Add a pricing module

To demonstrate, we will implement an ingenious pricing that increases the catalog price by 1 USD if the temperature reaches 20 degrees celsius in Zürich:

import {
} from 'meteor/unchained:core-pricing';
import fetch from 'isomorphic-unfetch';

const PRODUCT_TAG_SAUSAGE = 'sausage';

class WeatherDependentBarbequeSausagePricing extends ProductPricingAdapter {
  static key = 'shop.unchained.wd-bbq-sausage-pricing'
  static version = '1.0'
  static label = 'Calculate the price of a sausage 🌭🌦'
  static orderIndex = 3

  static isActivatedFor(product) {
    if (
      product.tags &&
      product.tags.length > 0 &&
      product.tags.indexOf(PRODUCT_TAG_SAUSAGE) !== -1) {
      return true;
    return false;

  async calculate() {
    const { currency, quantity } = this.context;
    try {
      const response = await fetch('');
      if (response.status === 200) {
        const { query } = await response.json();
        const { results, count } = query;
        if (count > 0) {
          const { temp: tempFahrenheit } =;
          const tempCelsius = (parseFloat(tempFahrenheit) - 32) / 1.8;
          if (tempCelsius > SAUSAGE_THRESHOLD_CELSIUS) {
            console.log('🌭 -> High season, sausage pricy!!'); // eslint-disable-line
              amount: +100 * quantity,
              isTaxable: true,
              isNetPrice: true,
              meta: { adapter: this.constructor.key },
    } catch (e) {
      console.error('🌭 -> Failed while trying to price weather dependent'); // eslint-disable-line

    return super.calculate();


Craft the query

Unchained Commerce is headless by design. So in order to get the product data from our Unchained Engine, we need to craft a small GraphQL query that actually resolves some texts and the current price of our sausage.

query getProduct {
  product(slug: "🌭") {
    texts {
    ... on SimpleProduct {
      catalogPrice {
        price {
Try it out live @ GraphQL Bin

Build the UI

Because Unchained Commerce is headless, you can build any UI on any operating system that can somehow connect to the HTTP endpoint. How awesome is that? Let's just use a small widget to display some product details on our page right here:

Checkout our very own ProductDetails component used throughout

We are working on the Documentation. Stay tuned.

Want to get reminded when we have news to share? Follow our twitter account @unchained_shop.

Want to help? Get over to our Issues List and let's see what we can do together.

Open Source

available on GitHub