Go to the backend of Magento and access the CMS page where you want to add the new products.
In the content section, insert the following code:
<referenceContainer name="content">
<block class="Magento\Catalog\Block\Product\NewProduct" name="new_products" template="Magento_Catalog::product/newproduct.phtml">
<arguments>
<argument name="products_count" xsi:type="number">12</argument>
</arguments>
</block>
</referenceContainer>
This will add a new-products block on the homepage that will display the latest 12 products. You can customize the number of products you want to display by changing the value of the "products_count" argument.
Asked: 2022-02-22 11:00:00 +0000
Seen: 10 times
Last updated: Sep 19 '22