#[medusa-products-pricing-groups] - A plugin for volume break pricing on Medusa

6 messages · Page 1 of 1 (latest)

blazing patio
#

Greetings!

Description
Medusa Pricing Groups is a plugin for the Medusa headless commerce system that enables one to group products together for the purposes of price calculation.

In essence this allows one to create arbitrary groupings of products, which are then hooked into at the point of price calculation to enable volume break pricing across multiple products in the cart.

The readme contains a much more detailed breakdown and example of what this plugin sets out to do.

This plugin has only just been released so there may be bugs.

Status
In beta / under active development

Maintainers
Sasha Hilton

Version
1.1.0

Link

https://www.npmjs.com/package/medusa-products-pricing-groups
https://github.com/sashahilton00/medusa-products-pricing-groups

GitHub

Create pricing groups to enable volume price breaks across multiple products. - sashahilton00/medusa-products-pricing-groups

solid pelican
blazing patio
#

@solid pelican it does support multiple products. So if you have two products belonging to the same group, both with volume break pricing setup, both products will use the best price once the minimum quantity has been reached across both products.

It's easier to explain with an example:

2 products, both priced at £10 belonging to the same pricing group. Product 1 has a volume break for buying 3 or more (£8), Product 2 has a volume break for buying 5 or more (£5).

  • Customer has 1 x Product 1, 1 x Product 2 in the cart - cart total is £20 (10 + 10).
  • Customer has 2 x Product 1, 2 x Product 2 in the cart - cart total is £36 ((2 x 8) + (2 x 10)).
  • Customer has 3 x Product 1, 2 x Product 2 in the cart - cart total is £34 ((3 x 8) + (2 x 5))
  • Customer has 3 x Product 1, 6 x Product 2 in the cart - cart total is £54 ((3 x 8) + (6 x 5))
solid pelican
#

no options here

blazing patio
#

So you set the price as you would normally set it on the product variant or in a price list. Currently the only way to set the pricing tiers for the variants is via the API (see the medusa issue here regarding the UI not being implemented yet: https://github.com/medusajs/medusa/issues/3584#issuecomment-1844868521)

So for now the solution is to use something like postman to do the following:

  1. Send an API request to http://localhost:9000/admin/price-lists/[price_list_id]/prices/batch with the request body:
{
    "prices": [
        {
            "variant_id": "variant_1",
            "min_quantity": 1,
            "max_quantity": 5,
            "amount": 3000,
            "currency_code": "gbp"
        },
        {
            "variant_id": "variant_1",
            "min_quantity": 6,
            "amount": 2700,
            "currency_code": "gbp"
        },
        {
            "variant_id": "variant_2",
            "min_quantity": 1,
            "max_quantity": 5,
            "amount": 4000,
            "currency_code": "gbp"
        },
        {
            "variant_id": "variant_2",
            "min_quantity": 6,
            "amount": 3500,
            "currency_code": "gbp"
        }
    ]
}

obviously setting your desired variant IDs, prices and volume breakpoints.

  1. Go to the pricing group (Combo Hemat 1 in your screenshot) and add the product(s) that variant 1 and variant 2 belong to.

  2. The products are now grouped and you're good to go.

N.B. You can also set the prices on the variants directly, I just used the price list endpoint as I use price lists to set different prices for different audiences.

GitHub

Bug report Describe the bug Scenario 1: Min_quantity in active price list not reflected in cart price When the min_quantity value is set for a product in the active price list, the cart does not up...