Reading list Switch to dark mode

    Guide for Magento 2 Multi-Tenant SaaS Module

    Updated 9 November 2023

    The Magento 2 Multi-Tenant SaaS Module enables tenants to register and manage their own store here, customers can become tenants and sell products with their own Subdomain name (URL).

    The store owners can manage tenants with various membership plans. As a result, tenants can purchase memberships based on their needs.

    Furthermore, this eliminates the need for tenants/merchants to install additional software.

    As a result, your clients can set up their online customised shop in a matter of minutes.

    Check a brief overview of the plugin –

    Searching for an experienced
    Magento 2 Company ?
    Find out More
    ErgHM26sqb8

    Features of Multi-Tenant SaaS Module

    • Admin can enable the Saas Module From Configuration.
    • It supports online Recurring Payments like Paypal and Stripe.
    • A user can register from the frontend as a tenant.
    • Admin can manage tenants.
    • Admin can manage membership plans.
    • Admin can view tenants’ subscribed plans.
    • Tenants can have their own subdomain(store link).
    • Tenants can Edit their profiles.
    • Tenants can purchase membership plans.
    • Tenants can view their subscribed plans.
    • Tenants can manage products for their stores.
    • Tenants can view sales and graphs on their dashboards.
    • Tenants can manage categories for their stores.
    • Tenants can manage catalog attributes for their stores.
    • Tenants can manage customers.
    • Tenants can manage sales orders of their stores.
    • Tenants can view the order invoices grid.
    • Tenants can view the order shipments grid.
    • Tenants can view the order credit memos grid.
    • Tenants can view the order transactions grid.
    • Tenants can refresh report statistics.
    • Tenants can create new reviews.
    • Tenants can manage the Reviews and Pending Reviews grid.
    • Customers can access tenants’ stores via tenants’ subdomain.
    • Customers can do any action(add the product to the cart, process checkout, …) on the tenants’ subdomain.
    • Customers can place an order for tenants’ products only from the tenants’ stores.
    • Customers can place an order for tenant/admin products from the main store.
    • Tenants can manage payment methods in the Configuration section.
    • Customer can view all tenants’ stores in ‘View Stores’ page.
    • Primary Admin can assign/unassign subscription plans to tenants.
    • Primary Admin can allow/disallow Tenants to purchase more than one subscription plan at the same time.
    • Primary Admin can filter records by Tenant User in Orders, Customers, Products, Invoices, Shipments, and Credit memos Grids.
    • Primary Admin can view the sales reports graphs and other information as their own dashboard by using the tenants’ switcher in their dashboard.

    Install Extension from Webkul Store

    #1 Download Module

    Firstly, you need to log in to Webkul Store, go to My Account>My Purchased Products section, verify and then download and extract the contents of this zip folder on the system.

    #2 Upload Folder

    Once the module zip is extracted, follow path src>app and then copy the app folder into the Magento 2 root directory on the server as shown below:

    #3 Run Commands

    After uploading the module folder, you need to run the following commands in the Magento 2 root directory:

    • composer require stripe/stripe-php:~7.40
    • composer require paypal/rest-api-sdk-php:*
    • php bin/magento setup:upgrade
    • php bin/magento setup:di:compile
    • php bin/magento setup:static-content:deploy
    • php bin/magento indexer:reindex
    • php bin/magento cache:flush

    To disable the module, you can use the following command:

    • php bin/magento multicompanysaas:disable

    Custom Domain:

    In the Multi-Tenant SaaS Extension for Magento 2 module, the client/tenant can run their e-commerce store website on their mapped subdomain name.

    There are multiple benefits of using a custom Subdomain that is as follows:

    • The tenant can host their e-commerce store website where they want.
    • Clients/ Tenants can generate URLs and e-mail addresses that will be completely their own.
    • There will be no restrictions from the hosting provider side.
    • The website of the e-commerce store will be unique, flexible, and easy to access.

    To access the custom subdomain feature in Multi-Tenant SaaS Extension for Magento 2 module tenants need to map the subdomain by using subDomain Mapping.

    This is most important to access the store website through the custom subdomain.

    Important Components for Data Mapping:

    There are a few networking components that are required for subdomain mapping:

    Domain Name System: DNS (Domain Name System) is used to translate the IP address into a subdomain name.

    E.g: If anyone runs a website example.com on their browser then the browser will perform DNS Query against the DNS Server so that the DNS server can take the hostname and convert it into a numeric address so that the web browser can connect to the related IP address.

    DNS Resolver: This is used to check the hostname. It checks if the hostname is available or not in the local cache. After checking the hostname it returns to the web browser or application.

    CNAME Record or Canonical Name: A Canonical Name is the properly denoted hostname of a computer or network server.

    A CNAME specifies an alias or nickname for a canonical hostname record in a DNS. It is used to map one subdomain name to another.

    E.g: If you have your subdomain tenant.mystore.com and you want this subdomain will point to your main subdomain (store.com) then you have to just replace the IP address of mystore.com with store.com.

    Wildcard:– With the help of the Wildcard DNS record, we can match the request for the non-existence subdomain name. A Wildcard DNS record is identified by an “*” asterisk.

    For example *.example.com.

    Language Translation:

    For translating the module language, navigate through src/app/code/Webkul/Multi-TenantSaasModule/i18n and edit the en_US.csv file.

    Thereafter, rename the CSV as “en_SA.csv” and translate all right side content after the comma in the Arabic language. After editing the CSV, save it.

    Then upload it to the path src/app/code/Webkul/MulticompanySaasModule/i18n where the Magento 2 is installed on the server. The module gets translated into the Arabic Language. It supports both RTL and LTR languages.

    Multi-Lingual Support

    For multilingual support, the admin will navigate through Store->Configuration->General ->Locale Options.

    After that, select the locale as English (United States) (the language into which the admin wants to translate his store content).

    Configuration-Settings-Stores-Magento-Admin

    Module Configuration

    Now, after successfully installing the Multi-Tenant Saas module the admin needs to Go Store > setting > configuration > Multi-Tenant SaaS module as per the following image. Furthermore, the admin needs to configure the settings.

    Configuration-Settings-Stores-Magento-Admin-1

    General Settings

    The admin needs to do some general settings for Tenants.

    Enable: Enable/disable the saas configuration from here.

    Allow Tenant(s) to Purchase Multiple Plans: The admin can allow tenant(s) to purchase one or more membership plans for their stores.

    Allowed payment methods for membership: The admin allows recurring accounts for the payment at the checkout page.

    Multi-Tenant Saas Email Template:

    Create Notification Email Template for Tenant Account: When a Tenant created an Account they will get the Notification from the admin.

    Account Email Update Notification for Tenants: While creating an account, Tenants receive an Email Update Notification.

    Tenant Account Username Update Notification Email Template: Tenants get an Account Username Update Notifications.

    Tenant Account Paasword Update Notification Email Template: here, Tenants get password update notifications from the admin.

    Store URL Update Notification Email Template for Tenants: Tenants get notifications for their store URL updation from the admin side.

    Membership Purchased Notification Email Template: When the Tenants buy a membership they automatically received an e-mail from the admin.

    Add Recurring payment

    The Multi-Tenant Saas Module accepts two recurring payment methods only:

    1. Paypal Connect
    2. Stripe connect

    PayPal Connect

    To set up these accounts firstly admin needs to enable the configuration settings, for that they need to navigate into store > configuration > sales > payment methods > PayPal recurring express checkout payment method.

    Screenshot-from-2022-07-11-10-20-28

    The admin needs to complete the setup process.

    Enable this solution: Enable/disable the payment setup.

    Sandbox mode: Select the Sandbox Mode as Yes(Testing Mode) or No(Production Mode).

    Title: The title of the Paypal checkout needs to be set here.

    Merchant PayPal Id: Merchant Id generates while payment setup on PayPal’s website.

    PayPal API Username, Password, and Signature: PayPal API Username, Password, and Signature will generate while creating an account on PayPal.

    Payment from applicable countries: The admin can select all countries or choose specific as well.

    Sort Order: Add preference by sort order.

    PayPal Account creation

    The admin firstly needs a PayPal account to configure it with the SaaS module. For that admin will create an account on PayPal with the required details or they can use their existing account.

    login_3__1_

    Now, After entering the login credentials now, PayPal will redirect you to the next page where the admin needs to select the account settings.

    image-20

    Afterward, The admin will choose an account from the added accounts and click on manage accounts icon.

    image-21

    Here, the admin will click on the view and edit button, it will redirect to your account details page.

    image-22

    you can find the email id, username, password, and account Id. Which we require at the time of payment method configuration.

    image-23

    How to set the IPN key?

    Above all the module supports the recurring profile feature, you need to configure the “Instant Payment Notification” settings. Thus, for this first, log in to your Paypal account.

    image-28

    Basically, In the account settings, the admin will navigate into the business profile>notifications a page will open to get the ids for the PayPal account.

    image-29

    To get complete access to the PayPal portal you need to enter the IPN key for that you need to access the IPN section.

    image-30

    Here, the user will enter his module details like this – yourwebsite/mpsaas/paypal/webhook and hit the save button.

    image-31

    Stripe Connect

    To set up these accounts firstly admin needs to enable the configuration settings, for that they need to navigate into store > configuration > sales > payment methods > Recurring Stripe Payment Method.

    recuuring

    Basically, The admin needs to complete the setup process.

    Enable this solution: Enable/disable the payment setup.

    Title: The title of the Paypal checkout needs to be set here.

    Sandbox mode: Select the Sandbox Mode as Yes(Testing Mode) or No(Production Mode).

    API Publishable Key: For API publishable key you need to access stripe connect.

    API Secret Key: Every stripe account has its own separate secret key.

    Set Name Display on Form: Which name will show on the front panel needs to be set here.

    Payment from applicable countries: Needs to set the countries.

    Minimum Order Total: The admin needs to set the minimum order total amount which is allowed by the stripe connect.

    Maximum Order Total: The admin will set the maximum order total amount to use stripe connect.

    Sort Order: Add preference by sort order.

    Generate Webhook: Webhook is used for web alteration.

    How to get keys and Account ID for stripe configuration

    1st Step:

    To get the API Keys you can use the Stripe website. First, you’ll need to sign in to the stripe account or create an account.

    Go to https://dashboard.stripe.com/login and enter your login details.

    Screenshot-6-1

    2nd Step:

    Now from the stripe dashboard, you can click on the toggle button of the viewing test data and if you’re using the module for the test purpose or you can also use the live credentials of your stripe account APIs if you want to set up the module for the live website.

    Now, enable the Sandbox Mode as Yes(Testing Mode) or No(Production Mode).

    Screenshot-8

    3rd Step:

    Click the API menu option on the side panel to see the Publishable key (API Publishable Key). Now, click the “Reveal test key token” to get your Secret Key (API Key).

    Screenshot-9

    Clicking the “Reveal test key token” will bring up the – Secret Key (API Key).

    The admin can use API Publishable Key, and API Secret keys in the admin configuration to set up the module as per the below image:

    Screenshot-10

    Henceforth, the API Key, API Publishable key, Account ID, and the Client Key are used to configure the module.

    Generate Webhooks In Stripe Payment Gateway

    A webhook is a technique of changing the behavior of a web page or web application with custom callbacks in web development. As a matter of fact, Webhooks are thus user-defined HTTP callbacks that are activated by certain events.

    After that, in the admin dashboard, the admin can click on the Generate Webhook and generate the data.

    image-35

    After successful generating the webhook, the admin can see the successful message from the admin dashboard as shown in the image below –

    image-36

    Whenever that trigger event occurs on the website, the webhook sees the event and collects the data.

    Now, the admin can see the collected data from the stripe dashboard as shown in the image below

    image-24

    Moroever, The admin can also click on the generated URL for a detailed view of the events as shown in the image below –

    image-25
    image-26

    Thus, the Webhooks generates in this way.

    Once both methods are configured it will display on the customer end while checkout.

    SaaS configuration

    Here, The admin needs to handle the Manage membership, Manage Tenants and Manage subscription for that they need to navigate into the Multi- Tenants Saas Management.

    Screenshot-12-1

    Manage Subscriptions

    All Subscriptions will display here with each and every tenant’s details.

    Screenshot-13

    In this section, a list of added subscription plans will display here where the admin can delete, edit, and add the membership type to the tenants.

    Manage Tenants

    A list of all added tenants will display here admin can delete, edit, and add the tenants as mentioned below.

    Screenshot-14

    Manage Memberships

    In Manage Membership, admin can add membership plans and enable, disable, and delete them according to their requirements.

    Screenshot-15

    The admin can add the membership plan and can edit, or delete them.

    Register Your Store

    With the help of this module, the tenant will navigate to Register Your Store, where they can register their stores. The tenant just needs to enter their Personal information, Account Information, Store Information, and Address Information as per the below image.

    Personal Information

    Personal-Information

    Account Information

    Account-Information

    Store Information

    Store-Information

    Address Information

    Address-Information
    Account-Created

    Tenants who successfully register will receive their login, password, and store admin frontend link via their registered e-mail id, as seen below.

    Screenshot-from-2022-07-12-16-18-49

    Purchase Membership

    After tenant registration tenant can login to the admin panel and navigate to purchase membership. Then click on check membership plan

    Membership-Purchase

    Here, tenant can Purchase a Membership Plan according to their requirement.

    Frontend-Saas-Configuration

    From the available memberships plan, the Tenant can choose anyone at a time and proceed further to the next steps.

    Membership-Plans-1

    Hence, After the plan selection, it will redirect you to the shopping cart with a success message.

    Screenshot-from-2022-08-03-13-27-04-1

    Thereafter, the tenant will click on the place order button and it will redirect them to the PayPal login page or stripe login page (If the Tenant selects the stripe method then it will redirect them to the stripe login page).

    image-32

    If the Tenant already has an account they can directly log in to their account and make the payments. Hence, after successful payment order, the status will change on the front panel and display over the success message.

    Screenshot-from-2023-08-18-10-38-43-1

    The Tenant and admin can both check the order summary in the sales>order section tab after successful payment, as per the below image.

    Orders-Operations-Sales-Magento-Admin-1

    The Tenant and admin both can check the order details by clicking on view button at sales>order listing as per the below image.

    000000080-Orders-Operations-Sales-Magento-Admin

    Here, The Tenants can verify their Active Membership Plan and Upgrade their Membership Plan for their store when purchasing a membership.

    Screenshot-from-2022-07-12-12-46-54

    Tenant Account Panel Options

    In the Tenants Account Panel sections Tenants can easily Edit, Manage Subscription, and Purchase Membership.

    s19

    Edit Profile:- In this section Tenants can edit their own profile information, store information address information, Theme configuration, Store Images, as well as View Store as per the below image.

    Screenshot-from-2022-07-11-19-01-59

    Tenants can easily modify their store information such as their store URL, store name, store owner, meta title Language, and currency according to their preferences.

    Screenshot-21

    The Tenants can also change their Address information, such as company name, phone number, street location, city, and Pincode.

    Screenshot-22

    The Tenants can choose different Theme Configurations based on their preferences, and if no value is supplied, the default theme will be applied, as seen in the image below.

    Screenshot-23

    Tenants can customize their store images by simply selecting and uploading their Store’s logo and icon images.

    Store-Images

    You can visit your Store link at view store when you have properly registered.

    Screenshot-from-2022-07-12-12-20-02

    Manage Subscription:

    Tenant Subscription Plan selections will be shown here.

    Screenshot-from-2022-07-12-12-19-28

    Tenant Store Listing

    Customers can view all tenant’s stores by navigating to the View Stores button which will then show all of the Tenant Stores which have been listed.

    View-Stores

    That’s all for the Multi-Tenant SaaS Module. So if you still have any doubts or suggestions, feel free to add a ticket.

    Moreover, let us know your views to make the extension better https://webkul.uvdesk.com/.

    Current Product Version - 5.0.1

    Supported Framework Version - Magento 2.0.x, 2.1.x, 2.2.x,2.3.x, 2.4.x

    . . .

    Leave a Comment

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


    Be the first to comment.

    Back to Top

    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home

    Table of Content