0

We have a shop, where we want a low stock report with cost prices, so we can see how much we need to pay for these products before buying them.

What I want is to add an extra column with the cost price in the low stock report.

I have tried to add a block in reports_report_product_lowstock_grid.xml

But I can't see anything new on the grid.

I hope an expert can help, and I'm sure many can use this.

Best regards Martin

<block class="Magento\Backend\Block\Widget\Grid\Column" name="adminhtml.block.report.product.lowstock.grid.columnSet.price" as="price">
<arguments>
    <argument name="header" xsi:type="string" translate="true">Kost pris</argument>
    <argument name="filter" xsi:type="string">Magento\Backend\Block\Widget\Grid\Column\Filter\Range</argument>
    <argument name="sortable" xsi:type="string">0</argument>
    <argument name="index" xsi:type="string">price</argument>
    <argument name="type" xsi:type="string">number</argument>
    <argument name="header_css_class" xsi:type="string">col-price</argument>
    <argument name="column_css_class" xsi:type="string">col-price</argument>
</arguments>

0

you can override reports_report_product_lowstock_grid.xml in your module

app/code/Vendor/Module/view/adminhtml/layout/ reports_report_product_lowstock_grid.xml
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="adminhtml.report.grid.container">
            <referenceBlock name="adminhtml.block.report.product.lowstock.grid">
                    <block class="Magento\Backend\Block\Widget\Grid\Column" name="adminhtml.block.report.product.lowstock.grid.columnSet.status" as="status">
                        <arguments>
                            <argument name="header" xsi:type="string" translate="true">Status</argument>
                            <argument name="sortable" xsi:type="string">0</argument>
                            <argument name="index" xsi:type="string">status</argument>
                            <argument name="header_css_class" xsi:type="string">col-status</argument>
                            <argument name="column_css_class" xsi:type="string">col-status</argument>
                        </arguments>
                    </block>
             </referenceBlock>
        </referenceBlock>
    </body>
</page>

Hope this will help you!

Please let me know if you need my help.

| improve this answer | |

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.