Hello Everyone,
I've been working on Magento 2.4.2 and I wish to add a tab/block of newly added products on admin dashboard. I tried to call a custom block through phtml file on admin but it doesn't work.
Thanks in advance.
Hi,
1. Log into your Magento admin panel and go to the Products > Inventory > Catalog section.
2. Find the product you need to be set as “New”.
3. Open the Product to edit (click “edit” opposite the product).
4. Move to the Set Product as New From option. You need to set the time period the product will be displayed as “New”.
5. Tap t he “calendar” and then, choose the first date.
6. Move to the To option and choose the last date that you want the product to be set as “New”.
7. Save the changes.
Thanks for replying.
I've already set the date for the product to be new. But this doesn't display the products that are new on the admin dashboard.
example: New customer tab- It shows the newly created customers and it redirects to the customer account on admin. I need the same for newly created products.
You can just take the reference of the YOTPO Review tabs in the Admin Dashboard page.
You can see Yotpo Reviews from the Yotpo module,
vendor/yotpo/magento2-module-yotpo-reviews/Plugin/Backend/Block/Dashboard/Grids.php
Here in the given class, they have just declared Yotpo Tabs on the Admin Dashboard.
Like that you can create your own class and define New Product Tab from the above reference.
You need to create a Plugin with beforeToHtml() with the class
Magento\Backend\Block\Dashboard\Grids
Block Class used to display Yotpo content is the,
vendor/yotpo/magento2-module-yotpo-reviews/Block/Adminhtml/Dashboard/Tab/YotpoReviews.php
Block class define template file to get reviews of the specific items.
You have to follow the same step in the given class with your custom module to display new products.