Giter VIP home page Giter VIP logo

customerreorderplugin's Introduction

CustomerReorderPlugin

SyliusCustomerReorderPlugin allows customer to reorder previously placed order.

Installation

Require plugin with composer:

composer require sylius/customer-reorder-plugin

Import configuration:

imports:
    - { resource: "@SyliusCustomerReorderPlugin/Resources/config/config.yml" }

Import routing:

sylius_customer_reorder:
    resource: "@SyliusCustomerReorderPlugin/Resources/config/app/reorder_routing.yml"

Add plugin class to your AppKernel:

$bundles = [
    new \Sylius\CustomerReorderPlugin\SyliusCustomerReorderPlugin(),
];

Clear cache:

bin/console cache:clear

Extension points

Customer Reorder plugin is based on two processes:

  • reorder processing
  • reorder eligibility checking

They are both based on Symfony's compiler passes and configured in services.xml file.

ReorderProcessing and EligibilityChecking are independent processes - once a Reorder is created using Processors (services tagged as sylius_customer_reorder_plugin.reorder_processor), the created entity is passed to Eligibility Checkers (services tagged as sylius_customer_reorder_plugin.eligibility_checker).

Hence, both processes can be extended separately by adding services that implement ReorderEligibilityChecker and are tagged as sylius_customer_reorder_plugin.eligibility_checker or implement ReorderProcessor and are tagged as sylius_customer_reorder_plugin.reorder_processor.

Both Reorder button layout and action performed on clicking it are defined in reorder.html.twig template which is declared in config.yml file.

What's more, since Order is a Resource, major part of its configuration is placed in *.yml files. Without using the plugin, Order had Show and Pay actions. Adding Reorder action required extending order-related behaviours in config.yml file.

You can read much more about Resources here: http://docs.sylius.com/en/1.2/components_and_bundles/bundles/SyliusResourceBundle/index.html

customerreorderplugin's People

Contributors

bartoszpietrzak1994 avatar gsadee avatar pamil avatar zales0123 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.