Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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 1 month ago
JSON representation

This Magento 2 module add the option to get the store info with ease.

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'
```