1

I have change magnifier vars in view.xml file under luma theme. Its working fine .

I have change it in my custom module like this ...

app/code/XXX/YYY/etc/view.xml.

<view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/view.xsd">

        <var name="magnifier">
            <var name="fullscreenzoom">20</var>  <!-- Zoom for fullscreen (integer)-->
            <var name="top"></var> <!-- Top position of magnifier -->
            <var name="left"></var> <!-- Left position of magnifier -->
            <var name="width">400</var> <!-- Width of magnifier block -->
            <var name="height">400</var> <!-- Height of magnifier block -->
            <var name="eventType">hover</var> <!-- Action that atcivates zoom (hover/click) -->
            <var name="enabled">true</var> <!-- Turn on/off magnifier (true/false) -->
            <var name="mode">outside</var> <!-- Zoom type (outside/inside) -->
        </var>

Its not working .

And also In theme.xml

<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
     <title>theme name</title>
     <parent>Magento/blank

registration.php:

<?php
\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::THEME,
    'frontend/OX/yyy',
    __DIR__
);

/app/design/frontend/XXX/yyy/etc/view.xml

<view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/view.xsd">
        <var name="magnifier">
            <var name="fullscreenzoom">20</var>  <!-- Zoom for fullscreen (integer)-->
            <var name="top"></var> <!-- Top position of magnifier -->
            <var name="left"></var> <!-- Left position of magnifier -->
            <var name="width">400</var> <!-- Width of magnifier block -->
            <var name="height">400</var> <!-- Height of magnifier block -->
            <var name="eventType">hover</var> <!-- Action that atcivates zoom (hover/click) -->
            <var name="enabled">true</var> <!-- Turn on/off magnifier (true/false) -->
            <var name="mode">outside</var> <!-- Zoom type (outside/inside) -->
        </var>
  </view>

its also not working.

If anything i want to change it.

Thanks.

enter image description here

1

Try this,

To create a theme and override a view.xml

app/design/frontend/{Vendor}/{theme-name}/registration.php

<?php                
\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::THEME,
'frontend/{Vendor}/{theme-name}',
__DIR__);

then create theme.xml

app/design/frontend/{Vendor}/{theme-name}/theme.xml

<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
<title>Theme Title</title>
<parent>Magento/blank</parent></theme>

Check whether the theme is installed by the following query via mysql

select * from theme;

then add

app/design/frontend/{Vendor}/{theme-name}/etc/view.xml

and add composer.json in

app/design/frontend/{vendor}/{theme-name}/composer.json

then add the below code in it

{
"name": "{vendor}/{theme-name}",
"description": "N/A",
"require": {
    "php": "~5.5.0|~5.6.0|~7.0.0",
    "magento/theme-frontend-blank": "100.0.*",
    "magento/framework": "100.0.*"
},
"type": "magento2-theme",
"version": "100.0.1",
"license": [
    "OSL-3.0",
    "AFL-3.0"
],
"autoload": {
    "files": [
        "registration.php"
    ]
}}

You must configure your theme to see the changes on frontend.

To configure new theme for your store, just follow the below steps :

Go to-> content-> configuration-> select your store-> then change the new theme by clicking drop down and save configuration.

NOTE : After creating theme setup:upgrade and once after configured theme cache:flush.

Hope this helps :)

  • I have done all step as you mentioned above ..except Go to-> content-> configuration-> select your store-> then change the new theme by clicking drop down and save configuration. – Mano M Mar 4 at 9:21
  • Bcoz, the design configuration grid was empty. – Mano M Mar 4 at 9:22
  • Is it working or not? – Prathap Gunasekaran Mar 4 at 9:23
  • theme was created in table ...i can't config store ..Go to-> content-> configuration-> select your store-> then change the new theme by clicking drop down and save configuration. – Mano M Mar 4 at 9:24
  • @prathap.updated on my post – Mano M Mar 4 at 9:26
2

according documentation custom theme files must be under following path:

/app/design/frontend/<Vendor>/<Theme>

So your view.xml should be there:

/app/design/frontend/<Vendor>/<Theme>/etc

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.