2 min. read
Categories: News Technical
A simple way to cancel your orders in Sylius
A simple way to cancel your orders in Sylius

Hello everyone! Another week means another official Sylius plugin discussed. Although the customer is now able to reorder a previously placed order and to refund it, there’s still plenty of order-related features that need to be covered. Have you ever placed an order, not paid for it yet and decided to resign from buying at all? If so, the next Sylius plugin seems to be a welcome extension to the e-commerce domain. So, without further ado…  here comes the Customer Order Cancellation Plugin!

Introduction

Don’t get me wrong – every unpaid order could and still can be canceled in Sylius. However, it used to require contacting the shop administrator and discussing details via phone or a bunch of e-mails.

The main desire that stood behind Customer Order Cancellation Plugin development was the improvement of shop user’s experience. The action of canceling the order is not always a proper behavior, however. In spite of the plugin being fully customizable, the default configuration forbids canceling once the order has already been either paid or shipped.

What is Customer Order Cancellation Plugin?

Most importantly, Customer Order Cancellation Plugin is an official Sylius extension developed by the Sylius Core Team. Let’s briefly look at its features:

  • Canceling unpaid and unshipped order
  • Being prevented from cancelling paid but unshipped order
  • Being prevented from cancelling shipped but unpaid order
  • Being prevented from cancelling paid and shipped order

How does it work code-wise?

The plugin itself is based on two mechanisms that are well-known among Sylius contributors:

  • Grids
  • State Machine

A grid configured for customer’s representation of the order defines actions that can be taken, such as ‘Pay’ or ‘Show’. The configuration needed to be extended by action ‘Cancel’ represented by the additional button in order’s Actions section. The button is linked to a route delivered by plugin’s code, and the controller’s responsibility is to apply a proper state machine transition to a given order.

How to get it?

Yes, you have guessed it – the plugin is free. You can see the source code on a public GitHub repository or attach it to your Sylius-Standard-based project using Composer. Let me notice that if you are familiar with Symfony Flex, the plugin’s installation requires just one command to make the magic happen. The only thing left for me to do is to wish you…

 

Happy canceling!

 

Share:
More from our blog
Business News Technical 2 min read 28.09.2020
Get ready for global sales & operations with the most advanced payment solution from the famous fintech giant, now available in Sylius out of the box. Read More
Business News 2 min read 14.09.2020
We proudly present to you the latest version of the Sylius eCommerce Platform – 1.8, which comes with a brand new, unified API powered by API Platform, Loyalty points system for Sylius Plus, and as you can probably see, a brand new sylius.com website! Numbers This new release is a… Read More
Business Ecosystem News 2 min read 13.08.2020
Read why the French market leader trusted Sylius in a strategic re-platforming process to get a competitive eCommerce advantage. Read More
Comments