Magento 2 - Overwrite module-swatches view.xmlHow can i rewrite TierPrice Block in Magento2Magento2 view.xml redundant varsmagento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 1.9 : How to override/overwrite customer module core filesMagento 2 : Problem while adding custom button order view page?Magento theme view.xml throws errorHow to resize product images in recently viewed widgetMagento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom Options
How to manage monthly salary
Add an angle to a sphere
How to answer pointed "are you quitting" questioning when I don't want them to suspect
Is Social Media Science Fiction?
Ideas for 3rd eye abilities
Finding files for which a command fails
Is domain driven design an anti-SQL pattern?
Prime joint compound before latex paint?
What is GPS' 19 year rollover and does it present a cybersecurity issue?
Is there a familial term for apples and pears?
Lied on resume at previous job
LWC and complex parameters
Is every set a filtered colimit of finite sets?
How would photo IDs work for shapeshifters?
Extreme, but not acceptable situation and I can't start the work tomorrow morning
"My colleague's body is amazing"
What is it called when one voice type sings a 'solo'?
What are the advantages and disadvantages of running one shots compared to campaigns?
Crop image to path created in TikZ?
How can I fix this gap between bookcases I made?
Why is the design of haulage companies so “special”?
New order #4: World
How to deal with fear of taking dependencies
Are cabin dividers used to "hide" the flex of the airplane?
Magento 2 - Overwrite module-swatches view.xml
How can i rewrite TierPrice Block in Magento2Magento2 view.xml redundant varsmagento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 1.9 : How to override/overwrite customer module core filesMagento 2 : Problem while adding custom button order view page?Magento theme view.xml throws errorHow to resize product images in recently viewed widgetMagento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom Options
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
How do you overwrite the view.xml
in vendormagentomodule-swatchesetcview.xml
in your own template?
I want to overwrite the sizes for swatch_image and swatch_image_base. I tried putting the code in ...mythemeetcview.xml
and in ...mythemeMagento_Swatchesetcview.xml
but it does not work.
The other theme stuff works, so the theme is correctly set up.
Changing the values directly in the original view.xml
works as well.
Edit: Full Code in appdesignfrontend\Vendor\themeetcview.xml
<?xml version="1.0"?>
<!--
/**
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/view.xsd">
<media>
<images module="Magento_Catalog">
<image id="swatch_image" type="swatch_image">
<width>50</width>
<height>50</height>
</image>
<image id="swatch_thumb" type="swatch_thumb">
<width>110</width>
<height>90</height>
</image>
<image id="swatch_image_base" type="swatch_image">
<width>50</width>
<height>50</height>
</image>
<image id="swatch_thumb_base" type="swatch_thumb">
<width>110</width>
<height>90</height>
</image>
</images>
</media>
</view>
magento2 theme
bumped to the homepage by Community♦ 8 hours ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
How do you overwrite the view.xml
in vendormagentomodule-swatchesetcview.xml
in your own template?
I want to overwrite the sizes for swatch_image and swatch_image_base. I tried putting the code in ...mythemeetcview.xml
and in ...mythemeMagento_Swatchesetcview.xml
but it does not work.
The other theme stuff works, so the theme is correctly set up.
Changing the values directly in the original view.xml
works as well.
Edit: Full Code in appdesignfrontend\Vendor\themeetcview.xml
<?xml version="1.0"?>
<!--
/**
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/view.xsd">
<media>
<images module="Magento_Catalog">
<image id="swatch_image" type="swatch_image">
<width>50</width>
<height>50</height>
</image>
<image id="swatch_thumb" type="swatch_thumb">
<width>110</width>
<height>90</height>
</image>
<image id="swatch_image_base" type="swatch_image">
<width>50</width>
<height>50</height>
</image>
<image id="swatch_thumb_base" type="swatch_thumb">
<width>110</width>
<height>90</height>
</image>
</images>
</media>
</view>
magento2 theme
bumped to the homepage by Community♦ 8 hours ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
How do you overwrite the view.xml
in vendormagentomodule-swatchesetcview.xml
in your own template?
I want to overwrite the sizes for swatch_image and swatch_image_base. I tried putting the code in ...mythemeetcview.xml
and in ...mythemeMagento_Swatchesetcview.xml
but it does not work.
The other theme stuff works, so the theme is correctly set up.
Changing the values directly in the original view.xml
works as well.
Edit: Full Code in appdesignfrontend\Vendor\themeetcview.xml
<?xml version="1.0"?>
<!--
/**
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/view.xsd">
<media>
<images module="Magento_Catalog">
<image id="swatch_image" type="swatch_image">
<width>50</width>
<height>50</height>
</image>
<image id="swatch_thumb" type="swatch_thumb">
<width>110</width>
<height>90</height>
</image>
<image id="swatch_image_base" type="swatch_image">
<width>50</width>
<height>50</height>
</image>
<image id="swatch_thumb_base" type="swatch_thumb">
<width>110</width>
<height>90</height>
</image>
</images>
</media>
</view>
magento2 theme
How do you overwrite the view.xml
in vendormagentomodule-swatchesetcview.xml
in your own template?
I want to overwrite the sizes for swatch_image and swatch_image_base. I tried putting the code in ...mythemeetcview.xml
and in ...mythemeMagento_Swatchesetcview.xml
but it does not work.
The other theme stuff works, so the theme is correctly set up.
Changing the values directly in the original view.xml
works as well.
Edit: Full Code in appdesignfrontend\Vendor\themeetcview.xml
<?xml version="1.0"?>
<!--
/**
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/view.xsd">
<media>
<images module="Magento_Catalog">
<image id="swatch_image" type="swatch_image">
<width>50</width>
<height>50</height>
</image>
<image id="swatch_thumb" type="swatch_thumb">
<width>110</width>
<height>90</height>
</image>
<image id="swatch_image_base" type="swatch_image">
<width>50</width>
<height>50</height>
</image>
<image id="swatch_thumb_base" type="swatch_thumb">
<width>110</width>
<height>90</height>
</image>
</images>
</media>
</view>
magento2 theme
magento2 theme
edited May 12 '18 at 9:11
kunj
2,6662523
2,6662523
asked Nov 7 '16 at 13:17
alobeejayalobeejay
187216
187216
bumped to the homepage by Community♦ 8 hours ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ 8 hours ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
You have to apply changes under app/design/frontend/Package/themename/etc/view.xml
file.
For changes value of swatches you have to add your tag inside view.xml
files
<media>
<images module="Magento_Catalog">
<image id="swatch_image" type="swatch_image">
<width>30</width>
<height>20</height>
</image>
<image id="swatch_thumb" type="swatch_thumb">
<width>110</width>
<height>90</height>
</image>
<image id="swatch_image_base" type="swatch_image">
<width>30</width>
<height>20</height>
</image>
<image id="swatch_thumb_base" type="swatch_thumb">
<width>110</width>
<height>90</height>
</image>
</images>
</media>
You can keep your specific field inside images tag.
Now applying changes you have to clear cache and var folder.
In the backend all caches are disabled. Do I only need to clear /var/cache/?
– alobeejay
Nov 7 '16 at 13:33
First try it without if not working then delete and check.
– Suresh Chikani
Nov 7 '16 at 13:34
It is not working unfortunately. I have the code in /theme/etc/view.xml and deleted all contents in /var/cache
– alobeejay
Nov 7 '16 at 13:58
Add your full code so i will check.
– Suresh Chikani
Nov 7 '16 at 15:12
Can you specify Magento 2 version ?
– Suresh Chikani
Nov 8 '16 at 9:23
|
show 6 more comments
Looks like M 2.1.x has some issues with this.
Not only is needed to add your own <media>
tag in app/design/frontend/Package/themename/etc/view.xml
as already mentioned:
<media>
<images module="Magento_Catalog">
<image id="swatch_image" type="swatch_image">
<width>30</width>
<height>20</height>
</image>
<image id="swatch_thumb" type="swatch_thumb">
<width>110</width>
<height>90</height>
</image>
<image id="swatch_image_base" type="swatch_image">
<width>30</width>
<height>20</height>
</image>
<image id="swatch_thumb_base" type="swatch_thumb">
<width>110</width>
<height>90</height>
</image>
</images>
but, as is written in this issue https://github.com/magento/magento2/issues/6382, you'll need to add a DI to override for MagentoFrameworkViewConfig::getViewConfig()
in your module. Make you own class VendorThemeFrameworkViewConfig
and copy the getViewConfig()
method from the original class.
You should replace line 74 from
$config = $this->viewConfigFactory->create($viewConfigParams);
to
$config = $this->viewConfigFactory->create();
I've tried myself and worked after cleaning the cache.
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%2f144518%2fmagento-2-overwrite-module-swatches-view-xml%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
You have to apply changes under app/design/frontend/Package/themename/etc/view.xml
file.
For changes value of swatches you have to add your tag inside view.xml
files
<media>
<images module="Magento_Catalog">
<image id="swatch_image" type="swatch_image">
<width>30</width>
<height>20</height>
</image>
<image id="swatch_thumb" type="swatch_thumb">
<width>110</width>
<height>90</height>
</image>
<image id="swatch_image_base" type="swatch_image">
<width>30</width>
<height>20</height>
</image>
<image id="swatch_thumb_base" type="swatch_thumb">
<width>110</width>
<height>90</height>
</image>
</images>
</media>
You can keep your specific field inside images tag.
Now applying changes you have to clear cache and var folder.
In the backend all caches are disabled. Do I only need to clear /var/cache/?
– alobeejay
Nov 7 '16 at 13:33
First try it without if not working then delete and check.
– Suresh Chikani
Nov 7 '16 at 13:34
It is not working unfortunately. I have the code in /theme/etc/view.xml and deleted all contents in /var/cache
– alobeejay
Nov 7 '16 at 13:58
Add your full code so i will check.
– Suresh Chikani
Nov 7 '16 at 15:12
Can you specify Magento 2 version ?
– Suresh Chikani
Nov 8 '16 at 9:23
|
show 6 more comments
You have to apply changes under app/design/frontend/Package/themename/etc/view.xml
file.
For changes value of swatches you have to add your tag inside view.xml
files
<media>
<images module="Magento_Catalog">
<image id="swatch_image" type="swatch_image">
<width>30</width>
<height>20</height>
</image>
<image id="swatch_thumb" type="swatch_thumb">
<width>110</width>
<height>90</height>
</image>
<image id="swatch_image_base" type="swatch_image">
<width>30</width>
<height>20</height>
</image>
<image id="swatch_thumb_base" type="swatch_thumb">
<width>110</width>
<height>90</height>
</image>
</images>
</media>
You can keep your specific field inside images tag.
Now applying changes you have to clear cache and var folder.
In the backend all caches are disabled. Do I only need to clear /var/cache/?
– alobeejay
Nov 7 '16 at 13:33
First try it without if not working then delete and check.
– Suresh Chikani
Nov 7 '16 at 13:34
It is not working unfortunately. I have the code in /theme/etc/view.xml and deleted all contents in /var/cache
– alobeejay
Nov 7 '16 at 13:58
Add your full code so i will check.
– Suresh Chikani
Nov 7 '16 at 15:12
Can you specify Magento 2 version ?
– Suresh Chikani
Nov 8 '16 at 9:23
|
show 6 more comments
You have to apply changes under app/design/frontend/Package/themename/etc/view.xml
file.
For changes value of swatches you have to add your tag inside view.xml
files
<media>
<images module="Magento_Catalog">
<image id="swatch_image" type="swatch_image">
<width>30</width>
<height>20</height>
</image>
<image id="swatch_thumb" type="swatch_thumb">
<width>110</width>
<height>90</height>
</image>
<image id="swatch_image_base" type="swatch_image">
<width>30</width>
<height>20</height>
</image>
<image id="swatch_thumb_base" type="swatch_thumb">
<width>110</width>
<height>90</height>
</image>
</images>
</media>
You can keep your specific field inside images tag.
Now applying changes you have to clear cache and var folder.
You have to apply changes under app/design/frontend/Package/themename/etc/view.xml
file.
For changes value of swatches you have to add your tag inside view.xml
files
<media>
<images module="Magento_Catalog">
<image id="swatch_image" type="swatch_image">
<width>30</width>
<height>20</height>
</image>
<image id="swatch_thumb" type="swatch_thumb">
<width>110</width>
<height>90</height>
</image>
<image id="swatch_image_base" type="swatch_image">
<width>30</width>
<height>20</height>
</image>
<image id="swatch_thumb_base" type="swatch_thumb">
<width>110</width>
<height>90</height>
</image>
</images>
</media>
You can keep your specific field inside images tag.
Now applying changes you have to clear cache and var folder.
answered Nov 7 '16 at 13:24
Suresh ChikaniSuresh Chikani
10.5k53471
10.5k53471
In the backend all caches are disabled. Do I only need to clear /var/cache/?
– alobeejay
Nov 7 '16 at 13:33
First try it without if not working then delete and check.
– Suresh Chikani
Nov 7 '16 at 13:34
It is not working unfortunately. I have the code in /theme/etc/view.xml and deleted all contents in /var/cache
– alobeejay
Nov 7 '16 at 13:58
Add your full code so i will check.
– Suresh Chikani
Nov 7 '16 at 15:12
Can you specify Magento 2 version ?
– Suresh Chikani
Nov 8 '16 at 9:23
|
show 6 more comments
In the backend all caches are disabled. Do I only need to clear /var/cache/?
– alobeejay
Nov 7 '16 at 13:33
First try it without if not working then delete and check.
– Suresh Chikani
Nov 7 '16 at 13:34
It is not working unfortunately. I have the code in /theme/etc/view.xml and deleted all contents in /var/cache
– alobeejay
Nov 7 '16 at 13:58
Add your full code so i will check.
– Suresh Chikani
Nov 7 '16 at 15:12
Can you specify Magento 2 version ?
– Suresh Chikani
Nov 8 '16 at 9:23
In the backend all caches are disabled. Do I only need to clear /var/cache/?
– alobeejay
Nov 7 '16 at 13:33
In the backend all caches are disabled. Do I only need to clear /var/cache/?
– alobeejay
Nov 7 '16 at 13:33
First try it without if not working then delete and check.
– Suresh Chikani
Nov 7 '16 at 13:34
First try it without if not working then delete and check.
– Suresh Chikani
Nov 7 '16 at 13:34
It is not working unfortunately. I have the code in /theme/etc/view.xml and deleted all contents in /var/cache
– alobeejay
Nov 7 '16 at 13:58
It is not working unfortunately. I have the code in /theme/etc/view.xml and deleted all contents in /var/cache
– alobeejay
Nov 7 '16 at 13:58
Add your full code so i will check.
– Suresh Chikani
Nov 7 '16 at 15:12
Add your full code so i will check.
– Suresh Chikani
Nov 7 '16 at 15:12
Can you specify Magento 2 version ?
– Suresh Chikani
Nov 8 '16 at 9:23
Can you specify Magento 2 version ?
– Suresh Chikani
Nov 8 '16 at 9:23
|
show 6 more comments
Looks like M 2.1.x has some issues with this.
Not only is needed to add your own <media>
tag in app/design/frontend/Package/themename/etc/view.xml
as already mentioned:
<media>
<images module="Magento_Catalog">
<image id="swatch_image" type="swatch_image">
<width>30</width>
<height>20</height>
</image>
<image id="swatch_thumb" type="swatch_thumb">
<width>110</width>
<height>90</height>
</image>
<image id="swatch_image_base" type="swatch_image">
<width>30</width>
<height>20</height>
</image>
<image id="swatch_thumb_base" type="swatch_thumb">
<width>110</width>
<height>90</height>
</image>
</images>
but, as is written in this issue https://github.com/magento/magento2/issues/6382, you'll need to add a DI to override for MagentoFrameworkViewConfig::getViewConfig()
in your module. Make you own class VendorThemeFrameworkViewConfig
and copy the getViewConfig()
method from the original class.
You should replace line 74 from
$config = $this->viewConfigFactory->create($viewConfigParams);
to
$config = $this->viewConfigFactory->create();
I've tried myself and worked after cleaning the cache.
add a comment |
Looks like M 2.1.x has some issues with this.
Not only is needed to add your own <media>
tag in app/design/frontend/Package/themename/etc/view.xml
as already mentioned:
<media>
<images module="Magento_Catalog">
<image id="swatch_image" type="swatch_image">
<width>30</width>
<height>20</height>
</image>
<image id="swatch_thumb" type="swatch_thumb">
<width>110</width>
<height>90</height>
</image>
<image id="swatch_image_base" type="swatch_image">
<width>30</width>
<height>20</height>
</image>
<image id="swatch_thumb_base" type="swatch_thumb">
<width>110</width>
<height>90</height>
</image>
</images>
but, as is written in this issue https://github.com/magento/magento2/issues/6382, you'll need to add a DI to override for MagentoFrameworkViewConfig::getViewConfig()
in your module. Make you own class VendorThemeFrameworkViewConfig
and copy the getViewConfig()
method from the original class.
You should replace line 74 from
$config = $this->viewConfigFactory->create($viewConfigParams);
to
$config = $this->viewConfigFactory->create();
I've tried myself and worked after cleaning the cache.
add a comment |
Looks like M 2.1.x has some issues with this.
Not only is needed to add your own <media>
tag in app/design/frontend/Package/themename/etc/view.xml
as already mentioned:
<media>
<images module="Magento_Catalog">
<image id="swatch_image" type="swatch_image">
<width>30</width>
<height>20</height>
</image>
<image id="swatch_thumb" type="swatch_thumb">
<width>110</width>
<height>90</height>
</image>
<image id="swatch_image_base" type="swatch_image">
<width>30</width>
<height>20</height>
</image>
<image id="swatch_thumb_base" type="swatch_thumb">
<width>110</width>
<height>90</height>
</image>
</images>
but, as is written in this issue https://github.com/magento/magento2/issues/6382, you'll need to add a DI to override for MagentoFrameworkViewConfig::getViewConfig()
in your module. Make you own class VendorThemeFrameworkViewConfig
and copy the getViewConfig()
method from the original class.
You should replace line 74 from
$config = $this->viewConfigFactory->create($viewConfigParams);
to
$config = $this->viewConfigFactory->create();
I've tried myself and worked after cleaning the cache.
Looks like M 2.1.x has some issues with this.
Not only is needed to add your own <media>
tag in app/design/frontend/Package/themename/etc/view.xml
as already mentioned:
<media>
<images module="Magento_Catalog">
<image id="swatch_image" type="swatch_image">
<width>30</width>
<height>20</height>
</image>
<image id="swatch_thumb" type="swatch_thumb">
<width>110</width>
<height>90</height>
</image>
<image id="swatch_image_base" type="swatch_image">
<width>30</width>
<height>20</height>
</image>
<image id="swatch_thumb_base" type="swatch_thumb">
<width>110</width>
<height>90</height>
</image>
</images>
but, as is written in this issue https://github.com/magento/magento2/issues/6382, you'll need to add a DI to override for MagentoFrameworkViewConfig::getViewConfig()
in your module. Make you own class VendorThemeFrameworkViewConfig
and copy the getViewConfig()
method from the original class.
You should replace line 74 from
$config = $this->viewConfigFactory->create($viewConfigParams);
to
$config = $this->viewConfigFactory->create();
I've tried myself and worked after cleaning the cache.
answered Dec 26 '16 at 23:48
Elio ErminiElio Ermini
387216
387216
add a comment |
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%2f144518%2fmagento-2-overwrite-module-swatches-view-xml%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