13 <div
class=
"store-switcher store-view">
14 <span
class=
"store-switcher-label"><?=
__(
'Store View:') ?></span>
15 <div
class=
"actions dropdown closable">
16 <input type=
"hidden" name=
"store_switcher" id=
"store_switcher" 17 data-role=
"store-view-id" data-param=
"<?= /* @escapeNotVerified */ $block->getStoreVarName() ?>" 18 value=
"<?= $block->escapeHtml($block->getStoreId()) ?>" 19 onchange=
"switchScope(this);"<?=
$block->getUiId() ?> />
20 <input type=
"hidden" name=
"store_group_switcher" id=
"store_group_switcher" 21 data-role=
"store-group-id" data-param=
"<?= /* @escapeNotVerified */ $block->getStoreGroupVarName() ?>" 22 value=
"<?= $block->escapeHtml($block->getStoreGroupId()) ?>" 23 onchange=
"switchScope(this);"<?=
$block->getUiId() ?> />
24 <input type=
"hidden" name=
"website_switcher" id=
"website_switcher" 25 data-role=
"website-id" data-param=
"<?= /* @escapeNotVerified */ $block->getWebsiteVarName() ?>" 26 value=
"<?= $block->escapeHtml($block->getWebsiteId()) ?>" 27 onchange=
"switchScope(this);"<?=
$block->getUiId() ?> />
30 class=
"admin__action-dropdown" 31 data-
mage-init=
'{"dropdown":{}}' 32 data-toggle=
"dropdown" 34 id=
"store-change-button">
35 <?=
$block->getCurrentSelectionName() ?>
37 <ul
class=
"dropdown-menu" data-role=
"stores-list">
38 <?php
if (
$block->hasDefaultOption()): ?>
39 <li
class=
"store-switcher-all <?php if ( ! ($block->getDefaultSelectionName() != $block->getCurrentSelectionName())) { 41 } ?> <?php if ( ! $block->hasScopeSelected()) { 44 <?php
if (
$block->getDefaultSelectionName() !=
$block->getCurrentSelectionName()) {
46 <a data-role=
"store-view-id" data-
value=
"" href=
"#">
47 <?=
$block->getDefaultSelectionName() ?>
52 <span><?=
$block->getDefaultSelectionName() ?></span>
60 <?php $showGroup =
false; ?>
64 <li
class=
"store-switcher-website <?php if ( ! ($block->isWebsiteSwitchEnabled() && ! $block->isWebsiteSelected($website))) { 66 } ?> <?php if ($block->isWebsiteSelected($website)) { 71 <a data-role=
"website-id" data-
value=
"<?= $block->escapeHtml($website->getId()) ?>" href=
"#">
82 <?php
if ($showGroup ==
false): ?>
83 <?php $showGroup =
true; ?>
84 <li
class=
"store-switcher-store <?php if ( ! ($block->isStoreGroupSwitchEnabled() && ! $block->isStoreGroupSelected($group))) { 86 } ?> <?php if ($block->isStoreGroupSelected($group)) { 89 <?php
if (
$block->isStoreGroupSwitchEnabled() && !
$block->isStoreGroupSelected(
$group)) {
91 <a data-role=
"store-group-id" data-
value=
"<?= $block->escapeHtml($group->getId()) ?>" href=
"#">
97 <span><?=
$block->escapeHtml(
$group->getName()) ?></span>
102 <li
class=
"store-switcher-store-view <?php if ( ! ($block->isStoreSwitchEnabled() && ! $block->isStoreSelected($store))) { 104 } ?> <?php if ($block->isStoreSelected($store)) { 109 <a data-role=
"store-view-id" data-
value=
"<?= $block->escapeHtml($store->getId()) ?>" href=
"#">
122 <?php
if (
$block->getShowManageStoresLink() &&
$block->getAuthorization()->isAllowed(
'Magento_Backend::store')): ?>
123 <li
class=
"dropdown-toolbar">
124 <a href=
"<?= /* @escapeNotVerified */ $block->getUrl('*/system_store') ?>"><?=
__(
'Stores Configuration') ?></a>
129 <?=
$block->getHintHtml() ?>
135 'Magento_Ui/js/modal/confirm' 136 ],
function(
jQuery, confirm){
139 var $storesList = $(
'[data-role=stores-list]');
140 $storesList.on(
'click',
'[data-value]',
function(event) {
141 var val = $(
event.target).data(
'value');
142 var role = $(
event.target).data(
'role');
143 var switcher = $(
'[data-role='+role+
']');
145 event.preventDefault();
147 if (!switcher.val() || val != switcher.val()) {
148 switcher.val(val).trigger(
'change');
153 var scopeSwitcherHandler;
155 function switchScope(obj) {
156 var switcher =
jQuery(obj);
157 var scopeId = switcher.val();
158 var scopeParams =
'';
160 scopeParams = switcher.data(
'param') +
'/' + scopeId +
'/';
163 if (obj.switchParams) {
164 scopeParams += obj.switchParams;
167 if ((typeof scopeSwitcherHandler) !=
'undefined') {
168 var switcherParams = {
170 scopeParams: scopeParams,
171 useConfirm: <?= (int)
$block->getUseConfirm() ?>
173 scopeSwitcherHandler(switcherParams);
176 <?php
if (
$block->getUseConfirm()): ?>
179 content:
"<?= /* @escapeNotVerified */ __('Please confirm scope switching. All data that hasn\'t been saved will be lost.') ?>",
181 confirm:
function() {
185 obj.value =
'<?= $block->escapeHtml($block->getStoreId()) ?>';
196 <?php
if (!
$block->isUsingIframe()): ?>
197 var url =
'<?= /* @escapeNotVerified */ $block->getSwitchUrl() ?>' + scopeParams;
200 jQuery(
'#preview_selected_store').val(scopeId);
201 jQuery(
'#preview_form').submit();
203 jQuery(
'.store-switcher .dropdown-menu li a').each(
function() {
206 if ($this.data(
'role') ===
'store-view-id' && $this.data(
'value') == scopeId) {
207 jQuery(
'#store-change-button').html($this.text());
211 jQuery(
'#store-change-button').click();
216 window.scopeSwitcherHandler = scopeSwitcherHandler;
217 window.switchScope = switchScope;
if( $websites=$block->getWebsites())(__( 'Choose Store View:')) ?></label >< div class $showWebsite
$block setTitle( 'CMS Block Title') -> setIdentifier('fixture_block') ->setContent('< h1 >Fixture Block Title</h1 >< a href=" store url</a><p> Config value
if( $form)() ?>< script > require(['jquery' mage mage
jQuery('.store-switcher .dropdown-menu li a').each(function()
foreach($block->getWebsiteCollection() as $_website) foreach($block->getGroupCollection($_website) as $_group) foreach( $block->getStoreCollection( $_group) as $_store)($showWebsite==false) if($block->getRequest() ->getParam('website')==$_website->getId()) endif
if($block->getStoreId()==$_store->getId()) endforeach