0

I want to extend Recently Viewed Products widget so I can add review attribute. After creating this file: Vendor/MyModule/view/frontend/ui_component/widget_recently_viewed.xml:

<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <columns name="widget_columns">
        <column name="review" component="Vendor_MyModule/js/product/review" sortOrder="4" displayArea="details-area">
            <settings>
                <label translate="true">Review</label>
                <bodyTmpl>Vendor_MyModule/product/review</bodyTmpl>
            </settings>
        </column>
    </columns>
</listing>

and clear cache, I got this error in browser console:

Uncaught ReferenceError: Unable to process binding "if: function(){return isMsrpApplicable($row()) }"
Message: isMsrpApplicable is not defined

How to properly extend this widget?

0
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
<argument name="data" xsi:type="array">
    <item name="js_config" xsi:type="array">
        <item name="provider" xsi:type="string">widget_recently_viewed.recently_viewed_datasource</item>
    </item>
</argument>
<settings>
    <deps>
        <dep>widget_recently_viewed.recently_viewed_datasource</dep>
    </deps>
</settings>
<dataSource name="recently_viewed_datasource" component="Magento_Catalog/js/product/provider">
    <argument name="dataProvider" xsi:type="configurableObject">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="productStorageConfig" xsi:type="array">
                    <item name="namespace" xsi:type="string">product_data_storage</item>
                    <item name="className" xsi:type="string">DataStorage</item>
                    <item name="updateRequestConfig" xsi:type="array">
                        <item name="url" xsi:type="serviceUrl" path="/products-render-info"/>
                    </item>
                </item>
                <item name="identifiersConfig" xsi:type="array">
                    <item name="namespace" xsi:type="string">recently_viewed_product</item>
                </item>
                <item name="scopeConfig" xsi:type="object">Magento\Framework\App\Config\ScopeConfigInterface</item>
            </item>
        </argument>
    </argument>
    <dataProvider class="\Magento\Catalog\Ui\DataProvider\Product\Listing\DataProvider" name="recently_viewed_datasource">
        <settings>
            <requestFieldName/>
            <primaryFieldName/>
        </settings>
    </dataProvider>
</dataSource>
<columns name="widget_columns" component="Magepow_RecentlyViewed/js/product/list/listing" template="Magepow_RecentlyViewed/product/list/listing">
</columns>

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.