Features and fixes included in the release of v.1.2 of Medusa and Medusa Admin. The larger issues/tickets built in this release will be highlighted with a small detailed description.
For the full changelog see, go here.
Release highlights
Tax API
The Tax API allows you to configure your store to charge taxes from your customers to be in compliance with tax regulations in the markets you operate in. Tax regulations differ a lot across countries so Medusa’s tax system gives you a number of possibilities for configuring your taxes to ensure that you charge your customers the correct amount of tax.
You configure taxes on a region-basis meaning you can use different tax settings based on where customers are shopping from. Each region may use one of two tax modes:
Automatic Taxes
Tax totals are computed automatically on every cart update and retrieval. This is the default tax mode.Manual Taxes
Tax totals have to be manually computed by callingPOST /store/carts/:id/taxes
. This mode is more appropriate for tax configurations that use a plugin that calls 3rd party APIs. By using manual tax calculations you avoid 3rd party calls as part of the usual retrieval of carts.
The process for computing the tax total is the same regardless of the mode used. The steps taken are outlined in the figure below
A more elaborate walkthrough of the Tax API will soon be published to our documentation.
Strategies
The new strategy pattern allows you to override core logic in Medusa in cases where such overrides are necessary. For example, if a merchant wants to apply custom logic when generating line items in a cart; a strategy can be overridden to accommodate this. Check out the first two implementations of the strategy pattern:
CustomerGroup
This release introduces a notion of a CustomerGroup, which is the first element of our Promotions API. The feature allows you to group customers together and will play a key part in adding more advanced promotions, since you will be able to define discounts for entire customer groups ultimately allowing you to support VIP segments, wholesale customers, and much more.
CustomerGroup
- id: string
- name: string
- customers: Customer[]
Read our discussion on the Promotions API and feel free to pitch in with feedback and / or input.
Global search
Global search has been added to Medusa Admin meaning that you will be able to search for Discounts, Orders, Customers, and GiftCards from anywhere in your admin system. The feature is the ultimate productivity booster for store managers and customer service by allowing you to navigate to an order with as little as three clicks; 1) open search (with keyboard shortcuts), 2) paste order number, 3) press enter.
Check out a small gif below.
Add error handler in atomicPhase_
to allow clean up when transactions fail
Introduce a new way of gracefully handling errors in our atomic phases by adding an error handler param to the atomicPhase_
. The case to solve for is when work is performed within a transaction, but the transactions fail and cleanup is needed.
Read more about the feature and what is solved for in the pull request.
What’s next?
Introducing customer groups was the first step towards building the Promotions API, and the focus next will be to refactor our discount rules to be much more advanced, such that you can create discounts per product type, tag and collection as well as customer groups.
Additionally, the MoneyAmount entity will be extended to allow for advanced pricelists meaning you will be able to define variant prices per customer, add a MoneyAmount type, and more.
Top comments (0)