I'm using a plugin Gift Registry I want to add the Gift Registry button in my product list view. Right now the plugin only shows in the Product View Page. But we want to show it in the Product List View. But I keep getting an error of
I added this in the
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Magenest\GiftRegistry\Block\Product\View" name="product.info.additem" as="additem" template="Magenest_GiftRegistry::item/configure/addto.phtml" after="-"/> </referenceContainer> </body> </page>
It seems that it's throwing an error because the plugin is expecting an ID for the product page but since this is a product list so its not really targeting the exact product but a list. How can I fix this?
I tried to add this in the
Magento_Catalog/layut/catalog_category_view.xml and added this code
As you can see the highlighted below is pointing to a block in
Magenest\GiftRegistry\Block\Product\View but when running the site it's giving me this error
As seen here. It's pointing to the
magento-catalog/Block/Product/View instead in
Magenest\GiftRegistry\Block\Product\View. How do I let the layout loads the correct block?