<?xml version="1.0"?>
<!--
/**
 * Hyvä Themes - https://hyva.io
 * Copyright © Hyvä Themes. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Catalog\Model\Category">
        <plugin name="hyva_theme" type="Hyva\Theme\Plugin\PageCache\AddCategoryNavigationCacheTag"/>
    </type>
    <type name="Magento\Theme\Model\Theme\Registration">
        <plugin name="hyva_theme" type="Hyva\Theme\Plugin\Theme\CheckVirtualThemes"/>
    </type>

    <type name="Magento\CatalogWidget\Block\Product\ProductsList">
        <plugin name="hyva_theme" type="Hyva\Theme\Plugin\PageBuilder\ProductListWidgetPreviewFixPlugin"/>
    </type>

    <type name="Magento\PageBuilder\Model\Stage\Config">
        <plugin name="hyva_theme" type="Hyva\Theme\Plugin\PageBuilder\PageBuilderConfigPlugin"/>
    </type>

    <!-- The shortcut button needs to be defined for the admin area also because of PageBuilder block previews -->
    <virtualType name="Magento\Catalog\Block\ShortcutButtons\InCatalog" type="Magento\Catalog\Block\ShortcutButtons">
        <arguments>
            <argument name="isCatalogProduct" xsi:type="boolean">true</argument>
        </arguments>
    </virtualType>
</config>
