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
Cloud 2 min read 17.06.2024
We are thrilled to announce that we just signed a strategic partnership with Platform.sh, and as a result, we are extending our offer with Sylius Cloud powered by Platform.sh. Platform.sh is a modern Platform-as-a-Service (PaaS) solution that allows businesses to leverage the cloud environment without losing access to the code… Read More
Technical 2 min read 11.06.2024
Abstract 1.12 released in Q4 2022 1.13 on Apr 23rd, 2024 (a year later than we anticipated while releasing 1.12) 3859 commits 23 contributors A stabilized Sylius API powered by API Platform It’s been a long and bumpy road. Having it behind our backs was a highway that led Sylius… Read More
Business Ecosystem News 2 min read 06.06.2024
Welcome to the May summary! As an open-source eCommerce framework, Sylius continues to evolve with significant contributions from our vibrant community and valuable product updates. Apart from describing the technical changes, we will also quickly summarize the Sylius Technical Fundamentals & Sylius Polish Community Meetup and eCommerce Day Kaunas, as… Read More
Comments