Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/peterbrain/magento2-modal-overlay
Display custom content from a static block in a modal
https://github.com/peterbrain/magento2-modal-overlay
magento magento-2 magento-extension magento-module magento2 magento2-extension magento2-extension-free magento2-module
Last synced: about 2 months ago
JSON representation
Display custom content from a static block in a modal
- Host: GitHub
- URL: https://github.com/peterbrain/magento2-modal-overlay
- Owner: PeterBrain
- License: mit
- Created: 2021-11-29T01:03:30.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-03-24T21:37:17.000Z (almost 2 years ago)
- Last Synced: 2024-08-24T01:22:41.120Z (4 months ago)
- Topics: magento, magento-2, magento-extension, magento-module, magento2, magento2-extension, magento2-extension-free, magento2-module
- Language: PHP
- Homepage:
- Size: 19.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Magento 2 Module - ModalOverlay
Package name: `peterbrain/magento2-modal-overlay`
- [Magento 2 Module - ModalOverlay](#magento-2-module---modaloverlay)
- [Main Functionalities](#main-functionalities)
- [Installation](#installation)
- [Method 1: Composer (recommended)](#method-1-composer-recommended)
- [Method 2: Zip file (not recommended)](#method-2-zip-file-not-recommended)
- [Enable \& deploy](#enable--deploy)
- [Usage](#usage)
- [In-depth information](#in-depth-information)## Main Functionalities
- Display custom content from a static block in a modal.
- Show modal after a configurable amount of visited pages.## Installation
### Method 1: Composer (recommended)
```bash
composer require peterbrain/magento2-modal-overlay
```### Method 2: Zip file (not recommended)
- Unzip the zip file in `app/code/PeterBrain`
This extension is dependent on [PeterBrain Core](https://github.com/PeterBrain/magento2-peterbrain-core). Make sure that you have installed it first.
### Enable & deploy
```bash
php bin/magento module:enable PeterBrain_ModalOverlay
php bin/magento setup:upgrade
php bin/magento cache:flush
```## Usage
- Enable module ouptut in `Stores > Configuration > PeterBrain Extensions > Modal Overlay > General Configuration`
- In Magento 2 admin, navigate to `Content > Blocks` and create a new static block with the identifier `modal-overlay_popup`.
- If the module is enabled, the static block exists and is enabled, the modal pops up:
- when a user vistits at least three pages
- once per user (stored in local storage - cookieless!)## In-depth information
The visited pages (count) and status of modal are stored in local storage as follows:
* `mage-cache-storage`: {"modal-overlay":{"displayed":false,"visited_pages":2}}