CRUD Operation in Spryker Backoffice with a Custom Module

Blog
Spread the love

Spryker is a highly flexible and modular e-commerce platform. Its Backoffice is an administrative interface where users can manage different types of data such as products, customers, orders, and much more. In this guide, we’ll walk through how to add, update, and delete data in the Spryker Backoffice by developing a custom module.

Prerequisites

  • Basic knowledge of PHP and Symfony.
  • Familiarity with Spryker’s architecture and Backoffice.
  • A working Spryker project setup.
  • A development environment for testing your custom module.
  1. Setting Up Your Custom Module
  2. Before you can perform operations like adding, updating, and deleting data, you’ll need to set up your custom module in Spryker.

    Create the Module

    Go termanal and go your spryker folder root then

    Run following commad

    img

    Go this path your module is now created

    your-spryker-project/src/Pyz/Zed/CustomGrid/

    Define the basic structure: Inside your module, create the essential directories and files:

    your-spryker-project/src/Pyz/Zed/CustomGrid/

    -Business/

    -Communication/

    -Persistence/

    -Presentation/

    -CustomGridConfig.php

    -CustomGridDependencyProvider.php

    Step 1:Menu show in backoffice navigation

    Here is already define code you need copy code in this file

    your-spryker-project/src/Pyz/Zed/CustomGrid/Communication/navigation.xml

    In this path need paste code below code

    your-spryker-project/config/Zed/navigation.xml

    img

    Go termenal run follwing command

    img

    Now menu is show on backoffice spryker

    img

    Step 2:Modify this file

    your-spryker-project/src/Pyz/Zed/CustomGrid/CustomGridDependencyProvider.php

    Step 3:Create controller files

    your-spryker-project/src/Pyz/Zed/CustomGrid/Communication/Controller/AddController.php

    your-spryker-project/src/Pyz/Zed/CustomGrid/Communication/Controller/DeleteController.php

    your-spryker-project/src/Pyz/Zed/CustomGrid/Communication/Controller/EditController.php

    your-spryker-project/src/Pyz/Zed/CustomGrid/Communication/Controller/IndexController.php

    Step 4:Create Form files

    your-spryker-project/src/Pyz/Zed/CustomGrid/Communication/Form/CustomGridCreateForm.php

    your-spryker-project/src/Pyz/Zed/CustomGrid/Communication/Form/CustomGridEditForm.php

    your-spryker-project/src/Pyz/Zed/CustomGrid/Communication/Form/CustomGridEditForm.php

    Step 5:Create Table files

    your-spryker-project/src/Pyz/Zed/CustomGrid/Communication/Table/CustomGridData.php

    Step 6:Modify this file

    your-spryker-project/src/Pyz/Zed/CustomGrid/Communication/CustomGridCommunicationFactory.php

    Step 7:Create Business files and modify

    your-spryker-project/src/Pyz/Zed/CustomGrid/Business/CustomGridBusinessFactory.php

    your-spryker-project/src/Pyz/Zed/CustomGrid/Business/CustomGridFacade.php

    your-spryker-project/src/Pyz/Zed/CustomGrid/Business/CustomGridFacadeInterface.php

    your-spryker-project/src/Pyz/Zed/CustomGrid/Business/Writer/CustomGridWriter.php

    Step 8: Create Persistence files and modify

    your-spryker-project/src/Pyz/Zed/CustomGrid/Persistence/CustomGridEntityManager.php

    your-spryker-project/src/Pyz/Zed/CustomGrid/Persistence/CustomGridEntityManagerInterface.php

    your-spryker-project/src/Pyz/Zed/CustomGrid/Persistence/Propel/Schema/pyz_custom_grid.schema.xml

    Step 9:Create Presentation files and modify

    your-spryker-project/src/Pyz/Zed/CustomGrid/Presentation/Add/index.twig

    your-spryker-project/src/Pyz/Zed/CustomGrid/Presentation/Edit/index.twig

    your-spryker-project/src/Pyz/Zed/CustomGrid/Presentation/Index/index.twig

    Step 10: Create Shared file

    your-spryker-project/src/Pyz/Shared/CustomGrid/Transfer/custom_grid.transfer.xml

    Step 11: Run following command

    img

    if not showing backoffice need to following this command then check backoffice

    img

    Now Open backoffice

    img

    img

    img

    img

    img

    img

    img

bluethinkinc_blog

bluethinkinc_blog

2025-01-09

0

Leave a Reply

Your email address will not be published. Required fields are marked *

Find More Blogs

Customize lead qualification for a seamless experience

Spread the love When the 2024 Release Wave 2 was launched,

Create a Custom Console Command in Spryker

Spread the love In Spryker, developers can create custom

SALESFORCE

Spread the love Salesforce is a cloud-based software

CRUD Operation in Spryker Backoffice with a Custom Module

Spread the love Spryker is a highly flexible and modular

How to create custom module on Spryker for Backoffice?

Spread the love Creating a custom module in Spryker

How to Install Spryker Project with Docker on Local Machine

Spread the love Spryker is a flexible and scalable commerce

How to Add a Custom Tab to the Customer Order Detail Page in Magento 2

Spread the love Adding a custom tab to the Order Detail

Exception Handling in Java

Spread the love Introduction – Exception:An unwanted

How to add custom less file in Magento2

Spread the love Source files *.css included into layout

Spring Boot Microservices

Spread the love Microservices architecture has become

bluethinkinc Blogs