4

I want to make magnifier disable in mobile device, I have tried below code in view.xml file but not working in mobile devices.

<var name="breakpoints">
        <var name="mobile">
            <var name="conditions">
                <var name="max-width">767px</var>
            </var>                
            <var name="magnifier">
                <var name="enabled">false</var>
            </var>
        </var>
</var>

When i tap on product image in mobile devices page get blank.

1

Create a view.xml file if you havent allready in app\design\frontend\YOUR_VENDOR\base\etc\view.xml

<?xml version="1.0"?>
<view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/view.xsd">
    <vars module="Magento_Catalog">
        <var name="breakpoints">
            <var name="mobile">
                <var name="conditions">
                    <var name="max-width">767px</var>
                </var>
                <var name="options">
                    <var name="options">
                        <var name="allowfullscreen">false</var>
                    </var>

                </var>
            </var>
        </var>
    </vars>
</view>

allowfullscreen enables or disables magnifier

Tested on magento 2.3 EE

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.