Skip to content

Commit 9b265ca

Browse files
Initial Release
0 parents  commit 9b265ca

6 files changed

Lines changed: 87 additions & 0 deletions

File tree

Observer/BaseFinalPrice.php

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?php
2+
3+
/**
4+
* This file is part of GulshanDev_StoreLayoutHandle Module
5+
*
6+
* @author Gulshan Kumar <gulshan.4dream@gmail.com>
7+
*/
8+
9+
namespace GulshanDev\StoreLayoutHandle\Observer;
10+
11+
use Magento\Framework\Event\ObserverInterface;
12+
13+
class AddStoreLayout implements ObserverInterface
14+
{
15+
protected $storeManager;
16+
17+
/**
18+
* AddStoreLayout constructor.
19+
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
20+
*/
21+
public function __construct(
22+
\Magento\Store\Model\StoreManagerInterface $storeManager
23+
) {
24+
$this->storeManager = $storeManager;
25+
}
26+
27+
public function execute(\Magento\Framework\Event\Observer $observer) {
28+
$layout = $observer->getLayout();
29+
$layout->getUpdate()->addHandle('store_'.$this->storeManager->getStore()->getCode());
30+
}
31+
}

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# StoreLayoutHandle

composer.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"name": "gulshandev/storelayouthandle",
3+
"description": "Adds a layout handle store_<STORE_CODE> for store view customization",
4+
"type": "magento2-module",
5+
"version": "1.0.0",
6+
"license": [
7+
"OSL-3.0",
8+
"AFL-3.0"
9+
],
10+
"autoload": {
11+
"files": [
12+
"registration.php"
13+
],
14+
"psr-4": {
15+
"GulshanDev\\StoreLayoutHandle\\": "."
16+
}
17+
}
18+
}

etc/frontend/events.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
/**
4+
* This file is part of GulshanDev_StoreLayoutHandle Module
5+
*
6+
* @author Gulshan Kumar <gulshan.4dream@gmail.com>
7+
*/
8+
-->
9+
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
10+
<event name="layout_load_before">
11+
<observer name="add_Store_layout" instance="GulshanDev\StoreLayoutHandle\Observer\AddStoreLayout" />
12+
</event>
13+
</config>

etc/module.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
/**
4+
* This file is part of GulshanDev_StoreLayoutHandle Module
5+
*
6+
* @author Gulshan Kumar <gulshan.4dream@gmail.com>
7+
*/
8+
-->
9+
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
10+
<module name="GulshanDev_StoreLayoutHandle" setup_version="1.0.0" />
11+
</config>

registration.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
/**
4+
* This file is part of GulshanDev_StoreLayoutHandle Module
5+
*
6+
* @author Gulshan Kumar <gulshan.4dream@gmail.com>
7+
*/
8+
9+
\Magento\Framework\Component\ComponentRegistrar::register(
10+
\Magento\Framework\Component\ComponentRegistrar::MODULE,
11+
'GulshanDev_StoreLayoutHandle',
12+
__DIR__
13+
);

0 commit comments

Comments
 (0)