ScandiPWA
Create Magento AppCreate ScandiPWA AppUser ManualGitHub
  • Why Scandi
  • 🚀Quick-start Guide
  • 🗺️Roadmap
  • Introduction to the Stack
    • CMA, CSA, and ScandiPWA
    • Challenges
  • Setting up Scandi
    • Storefront Mode Setup
      • Proxying requests to server
    • Magento Mode Setup
    • Existing Magento 2 setup
    • Magento Commerce Cloud setup
    • Updating to new releases
      • Storefront mode upgrade
      • Magento mode upgrade
      • CMA upgrade
      • CSA upgrade
      • Custom ScandiPWA composer dependency update
      • Local ScandiPWA Composer Package Setup
    • Docker Setup [deprecated]
      • Legacy Docker setup
      • Migrating to CMA & CSA
  • Developing with Scandi
    • Override Mechanism
      • Overriding JavaScript
        • Overriding classes
        • Overriding non-classes
      • Overriding Styles
      • Overriding the HTML / PHP
      • Parent Themes
    • Extensions
      • Creating an extension
      • Installing an extension
      • Migrating from 3.x to 4.x
      • Publishing an extension
      • Extension Terminology
    • Working With Magento
      • Magento troubleshooting
      • Working with Magento modules
      • Working with GraphQL
      • GraphQL Security
      • Working with "granular cache"
    • Developer Tools
      • Debugging in VSCode
      • ScandiPWA CLI
      • Configuring ESLint
      • CSA Commands
    • Deploying Your App
      • Build & Deploy Android app
      • Build & Deploy iOS app
  • Structure
    • Directory Structure
    • Building Blocks
      • Components
        • Styling Components
      • Routes
      • Redux Stores
      • GraphQL Queries
      • Global Styles
      • The Util Directory
      • Type Checking
    • Application assets
    • Code Style
      • JavaScript Code Style
      • SCSS Code Style
  • Tutorials
    • Customizing Your Theme
      • Styling
        • Customizing the Global Styles
        • Adding a New Font
        • Overriding a Components Styles
        • Extending a Component's Styles
      • Customizing JavaScript
        • Customizing the Footer Copyright
        • Adding a New Page
        • Adding a Section in My Account
        • Adding a Tab on the Product Page
        • Creating a New Redux Store
    • Payment Method Integration
      • Setting Up for Development
      • Redirecting to the Payment Provider
      • Handling the Customer's Return
    • Creating a Custom Widget
      • Scandi CMS System Overview
      • Creating a Magento Widget
      • Implementing the Rendering
    • Video Tutorials
      • #1 Setting up and talking theory
      • #2 Templating in React
      • #3 Overriding a file
      • #4 Styling the application
      • #5 Patterns of ScandiPWA
    • Dark Mode Extension
    • Deploying Native Apps
    • Product 3D Model Extension
      • Part 1: Magento 3D Model Uploads
      • Part 2: GraphQL API
      • Part 3: Scandi Frontend
    • Social Share, Full Extension Development
      • STEP-1 and 2 Creating Magento 2 Module
      • STEP-3 Backend Configurations Settings
      • STEP-4 Simple GraphQl and Resolver
      • STEP-5 Creating Extension, Base Redux Store
      • STEP-6 Extension plugins
      • STEP-7 GraphQL types, Helpers
      • STEP-8 Query Field and FieldList
      • STEP-9 render Plugins and MSTP Plugin, Component creation
      • STEP-10 SocialShare Component Development
      • STEP-11 SocialShare for CategoryPage
      • TASK-1 Changing LinkedIn to Twitter
      • STEP-12 Comments for Admin Users
      • STEP-13 Final, bugfixes
    • Accessing Magento 2 Controllers
      • STEP-1 Creating Magento 2 Module
      • STEP-2 - Create Magento 2 Frontend Route and Basic Controller
      • STEP-3 Accessing Magento 2 Controller, Bypassing ScandiPWA frontend
      • STEP-4 Creating ScandiPWA Extension with additional dependencies
      • STEP-5 Creating Plugin and Axios request
  • About
    • Support
    • Release notes
    • Technical Information
    • Data Analytics
    • Contributing
      • Installation from Fork
      • Repository structure
      • Code contribution process
      • Submitting an Issue
      • Publishing ScandiPWA
Powered by GitBook
On this page

Was this helpful?

  1. Tutorials
  2. Social Share, Full Extension Development

STEP-3 Backend Configurations Settings

In this step we going to create Module backend configurations

PreviousSTEP-1 and 2 Creating Magento 2 ModuleNextSTEP-4 Simple GraphQl and Resolver

Last updated 3 years ago

Was this helpful?

For our implementation, we need several backend configurations

  • Enabled

  • Button Type (Rounded, Square)

  • Button Size

  • Display on Yes/No

    • Homepage

    • Category Page

    • Product Page

  • Facebook

    • Enable

    • Enable Counter

  • Facebook Messenger

    • Enable

    • Messenger app ID

  • Telegram

    • Enable

  • Whatsapp

    • Enable

  • LinkedIn

    • Enable

  • Email

    • Enable

    • Subject Suffix

Let’s create them.

  1. Create adminhtml folder in <MODULE ROOT>/etc and system folder in it

  2. create system.xml in <MODULE ROOT>/etc/adminhtml

ScandiPWA/SocialShareGraphQl/etc/adminhtml/system.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
   <system>
       <tab id="scandipwa" translate="label" sortOrder="100">
           <label>Scandipwa</label>
       </tab>
       <include path="ScandiPWA_SocialShareGraphQl::system/social_share.xml"/>
   </system>
</config>

3. Create social_share.xml in <MODULE ROOT>/etc/adminhtml/system

ScandiPWA/SocialShareGraphQl/etc/adminhtml/system/social_share.xml
<?xml version="1.0"?>
<include xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_include.xsd">
   <section id="socialshare" translate="label" type="text" sortOrder="1000" showInDefault="1" showInWebsite="0" showInStore="0">
       <label>Social Share</label>
       <tab>scandipwa</tab>
       <resource>ScandiPWA_SocialShareGraphQl::social_share</resource>
<!--        General-->
       <group id="general" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
           <label>General Settings</label>
           <field id="enable" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
               <label>Enable</label>
               <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
           </field>

           <field id="rounded" translate="label" type="select" sortOrder="2" showInDefault="1" showInWebsite="0" showInStore="0">
               <label>Rounded Icons</label>
               <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
           </field>

           <field id="size" translate="label" type="text" sortOrder="3" showInDefault="1" showInWebsite="0" showInStore="0">
               <label>Icon Size</label>
               <comment>in pixel's</comment>
           </field>

           <field id="home_page" translate="label" type="select" sortOrder="4" showInDefault="1" showInWebsite="0" showInStore="0">
               <label>Display On HomePage</label>
               <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
           </field>

           <field id="category_page" translate="label" type="select" sortOrder="5" showInDefault="1" showInWebsite="0" showInStore="0">
               <label>Display On Product Page</label>
               <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
           </field>

           <field id="product_page" translate="label" type="select" sortOrder="6" showInDefault="1" showInWebsite="0" showInStore="0">
               <label>Display On Category Page</label>
               <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
           </field>
       </group>
<!--        FaceBook-->
       <group id="facebook" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
           <label>Facebook</label>
           <field id="enable" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
               <label>Enable Facebook</label>
               <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
           </field>

           <field id="enable_counter" translate="label" type="select" sortOrder="2" showInDefault="1" showInWebsite="0" showInStore="0">
               <label>Enable Facebook Counter</label>
               <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
           </field>
       </group>
<!--        Facebook Messenger-->
       <group id="facebook_messenger" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
           <label>Facebook Messenger</label>
           <field id="enable" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
               <label>Enable Facebook Messenger</label>
               <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
           </field>

           <field id="app_id" translate="text" type="text" sortOrder="2" showInDefault="1" showInWebsite="0" showInStore="0">
               <label>Facebook Messenger App ID</label>
           </field>
       </group>
<!--        Telegram-->
       <group id="telegram" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
           <label>Telegram</label>
           <field id="enable" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
               <label>Enable Telegram</label>
               <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
           </field>
       </group>
<!--        WhatsApp-->
       <group id="whatsapp" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
           <label>WhatsApp</label>
           <field id="enable" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
               <label>Enable WhatsApp</label>
               <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
           </field>
       </group>
<!--        LinkedIn-->
       <group id="linkedin" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
           <label>LinkedIn</label>
           <field id="enable" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
               <label>Enable LinkedIn</label>
               <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
           </field>
       </group>
<!--        Email-->
       <group id="email" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
           <label>Email</label>
           <field id="enable" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
               <label>Enable Email</label>
               <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
           </field>
           <field id="suffix" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
               <label>Email Subject Suffix</label>
           </field>
       </group>
   </section>
</include>

4. Create config.xml in <MODULE ROOT>/etc/

ScandiPWA/SocialShareGraphQl/etc/config.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
   <default>
       <socialshare>
           <general>
               <enable>0</enable>
               <rounded>1</rounded>
               <size>35</size>
               <home_page>0</home_page>
               <category_page>0</category_page>
               <product_page>1</product_page>
           </general>
           <facebook>
               <enable>0</enable>
               <enable_counter>0</enable_counter>
           </facebook>
           <facebook_messenger>
               <enable>0</enable>
           </facebook_messenger>
           <telegram>
               <enable>0</enable>
           </telegram>
           <whatsapp>
               <enable>0</enable>
           </whatsapp>
           <linkedin>
               <enable>0</enable>
           </linkedin>
           <email>
               <enable>0</enable>
               <suffix>ScandiPWA</suffix>
           </email>
       </socialshare>
   </default>
</config>

5. run cache:flush

6. Navigate to Magento backend dashboard STORE -> Settings -> Configuration, expand SCANDIPWA you should see Social Share Option

STEP-3