Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Siteation/magento2-module-storeinfo
This Magento 2 module add the option to get the store info with ease.
https://github.com/Siteation/magento2-module-storeinfo
hyva magento2 magento2-module storeinfo
Last synced: about 2 months ago
JSON representation
This Magento 2 module add the option to get the store info with ease.
- Host: GitHub
- URL: https://github.com/Siteation/magento2-module-storeinfo
- Owner: Siteation
- License: mit
- Archived: true
- Created: 2021-03-02T16:53:37.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-12-17T17:40:12.000Z (about 2 years ago)
- Last Synced: 2024-09-21T09:57:13.242Z (3 months ago)
- Topics: hyva, magento2, magento2-module, storeinfo
- Language: HTML
- Homepage: https://siteation.dev
- Size: 76.2 KB
- Stars: 13
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Siteation - Magento 2 module Store Info
> **Warning** This package has moved to https://github.com/Siteation/magento2-storeinfo
This Magento 2 module adds the option to get the store information with ease.
So you can get the store phone number from the Stores > Config.
Instead using static block or hard code it in your template directly.## Installation
Install the package via;
```bash
composer require siteation/magento2-storeinfo
bin/magento module:enable Siteation_StoreInfo
```> **Note** This Module requires Magento 2.3 or higher!
> For more requirements see the `composer.json`.## How to use
By defaut this module loads nothing.
Use one of the samples to get started.
### Adding a address block
We have made an address block that uses the store information.
And also comes with [schema tags](https://schema.org/) to enrich the Contact data.To load the default store address block use 1 of the following xml samples
in your template.Hyva - XML Sample
```xml
```
Luma - XML Sample
```xml
Siteation\StoreInfo\ViewModel\StoreInfo
```
### Get Store info in your own block.
First get the viewModal in your template.
Hyva - Sample Phtml file head
```php
require(StoreInfo::class);
```Luma - Sample Phtml file head
_For Luma templates,_
_see the previous sample for the xml needed to load the viewModal._```php
getData('viewModelStoreInfo');
```After this you can load any Magento StoreInfo field as text in your phtml;
```php
getPostcode();
$storeInfo->getSalesEmail();// Get the same as above, using the global functions
$storeInfo->getStoreInfo('postcode'); // 'general/store_information/%s'
$storeInfo->getStoreEmail('email', 'ident_sales'); // 'trans_email/%2$s/%1$s'
```