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

Mukesh Singh

Mukesh Singh

2025-01-09

0

Leave a Reply

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

Find More Blogs

Custom API to Fetch Customer Data by Customer ID in Spryker

Spread the love Introduction In this blog post, we will

Creating a Custom Module for a Custom Frontend Page in Spryker

Spread the love To create a custom module for a custom

How to create custom module api get category list without access token in Spryker

Spread the love To create a custom API for fetching a

Creating a Custom Glue API in Spryker

Spread the love Spryker’s Glue API is a powerful tool

Get AI Generated 360-Degree View of Account Summary in Dynamics 365 Sales

Spread the love Navigating the demanding landscape of sales

Enhancing Productivity with Dynamics 365: The Power of Session Restore

Spread the love Enhancing Productivity with Dynamics 365:

Salesforce Admin

Spread the love In our last blog, we discussed common

Unlocking AI with Spring Boot: Real-World Use Cases and Solutions

Spread the love Artificial Intelligence (AI) has moved from

Enhancing Performance with Reactive Java: A Beginner-Friendly Guide

Spread the love In today’s fast-paced software

Integrating Azure Function with Dynamics 365

Spread the love Signup on azure portal and make sure to

bluethinkinc Blogs