1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<?php
/*------------------------------------------------------------------------
# SM Shop4u - Version 1.0.0
# Copyright (c) 2016 YouTech Company. All Rights Reserved.
# @license - Copyrighted Commercial Software
# Author: YouTech Company
# Websites: http://www.magentech.com
-------------------------------------------------------------------------*/
namespace Sm\Shop4u\Helper;
use Magento\Store\Model\StoreManagerInterface;
class Data extends \Magento\Framework\App\Helper\AbstractHelper
{
public function __construct(
StoreManagerInterface $storeManagerInterface,
\Magento\Framework\App\Helper\Context $context
) {
$this->_storeManager = $storeManagerInterface;
parent::__construct($context);
}
public function getStoreId(){
return $this->_storeManager->getStore()->getId();
}
public function getUrl(){
return $this->_storeManager->getStore()->getBaseUrl();
}
public function getUrlStatic(){
return $this->_storeManager->getStore()->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_STATIC);
}
public function getLocale()
{
return $this->scopeConfig->getValue(
'general/locale/code',
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
);
}
public function getMediaUrl(){
return $this->_storeManager->getStore()->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_MEDIA );
}
public function getGeneral($name)
{
return $this->scopeConfig->getValue(
'shop4u/general/'.$name,
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
);
}
public function getThemeLayout($name)
{
return $this->scopeConfig->getValue(
'shop4u/theme_layout/'.$name,
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
);
}
public function getProductListing($name)
{
return $this->scopeConfig->getValue(
'shop4u/product_listing/'.$name,
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
);
}
public function getProductDetail($name)
{
return $this->scopeConfig->getValue(
'shop4u/product_detail/'.$name,
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
);
}
public function getSocial($name)
{
return $this->scopeConfig->getValue(
'shop4u/socials/'.$name,
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
);
}
public function getAdvanced($name)
{
return $this->scopeConfig->getValue(
'shop4u/advanced/'.$name,
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
);
}
}