Magento2: How to remove footer and header for the second store created?How to create two store views with different designs?No Homepage CMS or Footer Links on second Magento Store? Multi-DomainLinking a category to a pageMagento2 store and store viewChange the structure of the footer in Magento2Magento 2 - How to Manage different theme for different store?How to create admin user for specific store in magento2?Magento 2 : How to remove the default Store langauge code from the URLHow to add new custom dynamic link in magento2 top header links?How can i reselect the website option from store view?
How can I tell if a flight itinerary is fake
What does VB stand for?
Why are the inside diameters of some pipe larger than the stated size?
Do other countries guarantee freedoms that the United States does not have?
What is to be understood by the assertion 'Israels right to exist'?
How quickly could a country build a tall concrete wall around a city?
Ampacity of Conductive Tape
Will a paper be retracted if a flaw in released software code invalidates its central idea?
Unexpected route on a flight from USA to Europe
Where to pee in London?
How to realistically deal with a shield user?
What are good ways to improve as a writer other than writing courses?
Secure my password from unsafe servers
French equivalent of "Make leaps and bounds"
Purchased new computer from DELL with pre-installed Ubuntu. Won't boot. Should assume its an error from DELL?
How does the oscilloscope trigger really work?
Is it double speak?
Does this put me at risk for identity theft?
Why can I log in to my Facebook account with a misspelled email/password?
What are the examples (applications) of the MIPs in which the objective function has nonzero coefficients for only continuous variables?
Is alignment needed after replacing upper control arms?
Did WWII Japanese soldiers engage in cannibalism of their enemies?
Why should public servants be apolitical?
Look mom! I made my own (Base 10) numeral system!
Magento2: How to remove footer and header for the second store created?
How to create two store views with different designs?No Homepage CMS or Footer Links on second Magento Store? Multi-DomainLinking a category to a pageMagento2 store and store viewChange the structure of the footer in Magento2Magento 2 - How to Manage different theme for different store?How to create admin user for specific store in magento2?Magento 2 : How to remove the default Store langauge code from the URLHow to add new custom dynamic link in magento2 top header links?How can i reselect the website option from store view?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I have created two stores in Magento2.
One is main website and the second one is retailer site.
I need to remove the footer section and the navigation bar for my retailer site.
I also need to remove the favorites section from the header only for my retailer site.
Please anyone guide me on this.
Any help would be appreciated.
magento2 footer stores headerlink
add a comment |
I have created two stores in Magento2.
One is main website and the second one is retailer site.
I need to remove the footer section and the navigation bar for my retailer site.
I also need to remove the favorites section from the header only for my retailer site.
Please anyone guide me on this.
Any help would be appreciated.
magento2 footer stores headerlink
add a comment |
I have created two stores in Magento2.
One is main website and the second one is retailer site.
I need to remove the footer section and the navigation bar for my retailer site.
I also need to remove the favorites section from the header only for my retailer site.
Please anyone guide me on this.
Any help would be appreciated.
magento2 footer stores headerlink
I have created two stores in Magento2.
One is main website and the second one is retailer site.
I need to remove the footer section and the navigation bar for my retailer site.
I also need to remove the favorites section from the header only for my retailer site.
Please anyone guide me on this.
Any help would be appreciated.
magento2 footer stores headerlink
magento2 footer stores headerlink
asked Jul 29 at 9:44
AmyAmy
4411 silver badge10 bronze badges
4411 silver badge10 bronze badges
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
There is another way to can remove the block from the layout.
Create layout unique handle fro each store like store_en
, store_retailer
, where to assume that the retailer
is the store code of your retailer store & `en is default store code.
Add custom layout handle using on layout_load_before
.
Observer code
<?php
namespace StackExchangeMagentoObserverFrontend;
class LayoutLoadBefore implements MagentoFrameworkEventObserverInterface
/**
* @var MagentoStoreModelStoreManagerInterface
*/
private $storeManager;
public function __construct(
MagentoStoreModelStoreManagerInterface $storeManager
)
$this->storeManager = $storeManager;
public function execute(MagentoFrameworkEventObserver $observer)
$layout = $observer->getEvent()->getLayout();
$handlecode ='store_'.strtolower($this->storeManager->getStore()->getCode());
$layout->getUpdate()->addHandle($handlecode);
return $this;
public function execute(MagentoFrameworkEventObserver $observer)
$layout = $observer->getLayout();
$handlecode = 'store_'. strtolower($this->_storeManager->getStore()->getCode());
$layout->getUpdate()->addHandle($handlecode);
return $this;
}
After adding this observer, you need to do Cache flush/Di compile.
Now. if you need to create a handler file at app/code/Vendorname/Module Name/view/frontend/layout/store_retailerSITEStoreCode.xml
<?xml version="1.0" ?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceContainer name="header.container" remove="true" />
<referenceContainer name="footer" remove="true" />
</body>
</page>
Hi Amit after adding your code I am getting this error Warning: Uncaught Exception: Warning: require(/var/www/html/magento2_dev/pub/errors/report.php): failed to open stream: No such file or directory in /var/www/html/
– Amy
Jul 29 at 13:20
Could you please help me how to resolve this.
– Amy
Jul 29 at 13:20
Still the same error I am receiving.
– Amy
Jul 29 at 14:12
Please check your files/folder permission...
– Amit Bera♦
Jul 29 at 14:13
Thanks Amit, It is working perfectly fine.. Ur really a genius.
– Amy
Jul 29 at 16:51
add a comment |
I would recommend creating a child theme
for your retailer site and remove elements accordingly.
Can you share me some examples, how to create a child theme
– Amy
Jul 29 at 10:07
I have already created a child theme for my main website.
– Amy
Jul 29 at 10:07
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f283635%2fmagento2-how-to-remove-footer-and-header-for-the-second-store-created%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
There is another way to can remove the block from the layout.
Create layout unique handle fro each store like store_en
, store_retailer
, where to assume that the retailer
is the store code of your retailer store & `en is default store code.
Add custom layout handle using on layout_load_before
.
Observer code
<?php
namespace StackExchangeMagentoObserverFrontend;
class LayoutLoadBefore implements MagentoFrameworkEventObserverInterface
/**
* @var MagentoStoreModelStoreManagerInterface
*/
private $storeManager;
public function __construct(
MagentoStoreModelStoreManagerInterface $storeManager
)
$this->storeManager = $storeManager;
public function execute(MagentoFrameworkEventObserver $observer)
$layout = $observer->getEvent()->getLayout();
$handlecode ='store_'.strtolower($this->storeManager->getStore()->getCode());
$layout->getUpdate()->addHandle($handlecode);
return $this;
public function execute(MagentoFrameworkEventObserver $observer)
$layout = $observer->getLayout();
$handlecode = 'store_'. strtolower($this->_storeManager->getStore()->getCode());
$layout->getUpdate()->addHandle($handlecode);
return $this;
}
After adding this observer, you need to do Cache flush/Di compile.
Now. if you need to create a handler file at app/code/Vendorname/Module Name/view/frontend/layout/store_retailerSITEStoreCode.xml
<?xml version="1.0" ?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceContainer name="header.container" remove="true" />
<referenceContainer name="footer" remove="true" />
</body>
</page>
Hi Amit after adding your code I am getting this error Warning: Uncaught Exception: Warning: require(/var/www/html/magento2_dev/pub/errors/report.php): failed to open stream: No such file or directory in /var/www/html/
– Amy
Jul 29 at 13:20
Could you please help me how to resolve this.
– Amy
Jul 29 at 13:20
Still the same error I am receiving.
– Amy
Jul 29 at 14:12
Please check your files/folder permission...
– Amit Bera♦
Jul 29 at 14:13
Thanks Amit, It is working perfectly fine.. Ur really a genius.
– Amy
Jul 29 at 16:51
add a comment |
There is another way to can remove the block from the layout.
Create layout unique handle fro each store like store_en
, store_retailer
, where to assume that the retailer
is the store code of your retailer store & `en is default store code.
Add custom layout handle using on layout_load_before
.
Observer code
<?php
namespace StackExchangeMagentoObserverFrontend;
class LayoutLoadBefore implements MagentoFrameworkEventObserverInterface
/**
* @var MagentoStoreModelStoreManagerInterface
*/
private $storeManager;
public function __construct(
MagentoStoreModelStoreManagerInterface $storeManager
)
$this->storeManager = $storeManager;
public function execute(MagentoFrameworkEventObserver $observer)
$layout = $observer->getEvent()->getLayout();
$handlecode ='store_'.strtolower($this->storeManager->getStore()->getCode());
$layout->getUpdate()->addHandle($handlecode);
return $this;
public function execute(MagentoFrameworkEventObserver $observer)
$layout = $observer->getLayout();
$handlecode = 'store_'. strtolower($this->_storeManager->getStore()->getCode());
$layout->getUpdate()->addHandle($handlecode);
return $this;
}
After adding this observer, you need to do Cache flush/Di compile.
Now. if you need to create a handler file at app/code/Vendorname/Module Name/view/frontend/layout/store_retailerSITEStoreCode.xml
<?xml version="1.0" ?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceContainer name="header.container" remove="true" />
<referenceContainer name="footer" remove="true" />
</body>
</page>
Hi Amit after adding your code I am getting this error Warning: Uncaught Exception: Warning: require(/var/www/html/magento2_dev/pub/errors/report.php): failed to open stream: No such file or directory in /var/www/html/
– Amy
Jul 29 at 13:20
Could you please help me how to resolve this.
– Amy
Jul 29 at 13:20
Still the same error I am receiving.
– Amy
Jul 29 at 14:12
Please check your files/folder permission...
– Amit Bera♦
Jul 29 at 14:13
Thanks Amit, It is working perfectly fine.. Ur really a genius.
– Amy
Jul 29 at 16:51
add a comment |
There is another way to can remove the block from the layout.
Create layout unique handle fro each store like store_en
, store_retailer
, where to assume that the retailer
is the store code of your retailer store & `en is default store code.
Add custom layout handle using on layout_load_before
.
Observer code
<?php
namespace StackExchangeMagentoObserverFrontend;
class LayoutLoadBefore implements MagentoFrameworkEventObserverInterface
/**
* @var MagentoStoreModelStoreManagerInterface
*/
private $storeManager;
public function __construct(
MagentoStoreModelStoreManagerInterface $storeManager
)
$this->storeManager = $storeManager;
public function execute(MagentoFrameworkEventObserver $observer)
$layout = $observer->getEvent()->getLayout();
$handlecode ='store_'.strtolower($this->storeManager->getStore()->getCode());
$layout->getUpdate()->addHandle($handlecode);
return $this;
public function execute(MagentoFrameworkEventObserver $observer)
$layout = $observer->getLayout();
$handlecode = 'store_'. strtolower($this->_storeManager->getStore()->getCode());
$layout->getUpdate()->addHandle($handlecode);
return $this;
}
After adding this observer, you need to do Cache flush/Di compile.
Now. if you need to create a handler file at app/code/Vendorname/Module Name/view/frontend/layout/store_retailerSITEStoreCode.xml
<?xml version="1.0" ?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceContainer name="header.container" remove="true" />
<referenceContainer name="footer" remove="true" />
</body>
</page>
There is another way to can remove the block from the layout.
Create layout unique handle fro each store like store_en
, store_retailer
, where to assume that the retailer
is the store code of your retailer store & `en is default store code.
Add custom layout handle using on layout_load_before
.
Observer code
<?php
namespace StackExchangeMagentoObserverFrontend;
class LayoutLoadBefore implements MagentoFrameworkEventObserverInterface
/**
* @var MagentoStoreModelStoreManagerInterface
*/
private $storeManager;
public function __construct(
MagentoStoreModelStoreManagerInterface $storeManager
)
$this->storeManager = $storeManager;
public function execute(MagentoFrameworkEventObserver $observer)
$layout = $observer->getEvent()->getLayout();
$handlecode ='store_'.strtolower($this->storeManager->getStore()->getCode());
$layout->getUpdate()->addHandle($handlecode);
return $this;
public function execute(MagentoFrameworkEventObserver $observer)
$layout = $observer->getLayout();
$handlecode = 'store_'. strtolower($this->_storeManager->getStore()->getCode());
$layout->getUpdate()->addHandle($handlecode);
return $this;
}
After adding this observer, you need to do Cache flush/Di compile.
Now. if you need to create a handler file at app/code/Vendorname/Module Name/view/frontend/layout/store_retailerSITEStoreCode.xml
<?xml version="1.0" ?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceContainer name="header.container" remove="true" />
<referenceContainer name="footer" remove="true" />
</body>
</page>
edited Jul 29 at 13:32
answered Jul 29 at 12:04
Amit Bera♦Amit Bera
62.8k16 gold badges84 silver badges183 bronze badges
62.8k16 gold badges84 silver badges183 bronze badges
Hi Amit after adding your code I am getting this error Warning: Uncaught Exception: Warning: require(/var/www/html/magento2_dev/pub/errors/report.php): failed to open stream: No such file or directory in /var/www/html/
– Amy
Jul 29 at 13:20
Could you please help me how to resolve this.
– Amy
Jul 29 at 13:20
Still the same error I am receiving.
– Amy
Jul 29 at 14:12
Please check your files/folder permission...
– Amit Bera♦
Jul 29 at 14:13
Thanks Amit, It is working perfectly fine.. Ur really a genius.
– Amy
Jul 29 at 16:51
add a comment |
Hi Amit after adding your code I am getting this error Warning: Uncaught Exception: Warning: require(/var/www/html/magento2_dev/pub/errors/report.php): failed to open stream: No such file or directory in /var/www/html/
– Amy
Jul 29 at 13:20
Could you please help me how to resolve this.
– Amy
Jul 29 at 13:20
Still the same error I am receiving.
– Amy
Jul 29 at 14:12
Please check your files/folder permission...
– Amit Bera♦
Jul 29 at 14:13
Thanks Amit, It is working perfectly fine.. Ur really a genius.
– Amy
Jul 29 at 16:51
Hi Amit after adding your code I am getting this error Warning: Uncaught Exception: Warning: require(/var/www/html/magento2_dev/pub/errors/report.php): failed to open stream: No such file or directory in /var/www/html/
– Amy
Jul 29 at 13:20
Hi Amit after adding your code I am getting this error Warning: Uncaught Exception: Warning: require(/var/www/html/magento2_dev/pub/errors/report.php): failed to open stream: No such file or directory in /var/www/html/
– Amy
Jul 29 at 13:20
Could you please help me how to resolve this.
– Amy
Jul 29 at 13:20
Could you please help me how to resolve this.
– Amy
Jul 29 at 13:20
Still the same error I am receiving.
– Amy
Jul 29 at 14:12
Still the same error I am receiving.
– Amy
Jul 29 at 14:12
Please check your files/folder permission...
– Amit Bera♦
Jul 29 at 14:13
Please check your files/folder permission...
– Amit Bera♦
Jul 29 at 14:13
Thanks Amit, It is working perfectly fine.. Ur really a genius.
– Amy
Jul 29 at 16:51
Thanks Amit, It is working perfectly fine.. Ur really a genius.
– Amy
Jul 29 at 16:51
add a comment |
I would recommend creating a child theme
for your retailer site and remove elements accordingly.
Can you share me some examples, how to create a child theme
– Amy
Jul 29 at 10:07
I have already created a child theme for my main website.
– Amy
Jul 29 at 10:07
add a comment |
I would recommend creating a child theme
for your retailer site and remove elements accordingly.
Can you share me some examples, how to create a child theme
– Amy
Jul 29 at 10:07
I have already created a child theme for my main website.
– Amy
Jul 29 at 10:07
add a comment |
I would recommend creating a child theme
for your retailer site and remove elements accordingly.
I would recommend creating a child theme
for your retailer site and remove elements accordingly.
answered Jul 29 at 9:48
oliveroliver
1691 silver badge6 bronze badges
1691 silver badge6 bronze badges
Can you share me some examples, how to create a child theme
– Amy
Jul 29 at 10:07
I have already created a child theme for my main website.
– Amy
Jul 29 at 10:07
add a comment |
Can you share me some examples, how to create a child theme
– Amy
Jul 29 at 10:07
I have already created a child theme for my main website.
– Amy
Jul 29 at 10:07
Can you share me some examples, how to create a child theme
– Amy
Jul 29 at 10:07
Can you share me some examples, how to create a child theme
– Amy
Jul 29 at 10:07
I have already created a child theme for my main website.
– Amy
Jul 29 at 10:07
I have already created a child theme for my main website.
– Amy
Jul 29 at 10:07
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f283635%2fmagento2-how-to-remove-footer-and-header-for-the-second-store-created%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown