Как я могу показать товар из списка пожеланий в панели мониторинга на страницах учетной записи?
Я хочу добавить блок списка пожеланий клиента на Свою панель мониторинга после информации об учетной записи. Как я могу это сделать?
1 answers
Вы можете сделать это с помощью файлов макета:
Создать customer_account.xml
, если не завершается в в
Приложение/дизайн/интерфейс/{Имя поставщика}/{Тема}/magento_wishlist/макет
Затем
Добавить код:
<?xml version="1.0"?>
<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="Magento\Wishlist\Block\Customer\Wishlist" name="customer.wishlist" template="view.phtml" cacheable="false" >
<block class="Magento\Wishlist\Block\Rss\Link" name="wishlist.rss.link" template="rss/wishlist.phtml"/>
<block class="Magento\Wishlist\Block\Customer\Wishlist\Items" name="customer.wishlist.items" as="items" template="item/list.phtml" cacheable="false">
<block class="Magento\Wishlist\Block\Customer\Wishlist\Item\Column\Image" name="customer.wishlist.item.image" template="item/column/image.phtml" cacheable="false"/>
<block class="Magento\Wishlist\Block\Customer\Wishlist\Item\Column\Info" name="customer.wishlist.item.name" template="item/column/name.phtml" cacheable="false"/>
<block class="Magento\Wishlist\Block\Customer\Wishlist\Item\Column\Cart" name="customer.wishlist.item.price" template="item/column/price.phtml" cacheable="false">
<block class="Magento\Catalog\Pricing\Render" name="product.price.render.wishlist">
<arguments>
<argument name="price_render" xsi:type="string">product.price.render.default</argument>
<argument name="price_type_code" xsi:type="string">wishlist_configured_price</argument>
<argument name="price_label" xsi:type="boolean">false</argument>
<argument name="zone" xsi:type="string">item_list</argument>
</arguments>
</block>
<block class="Magento\Wishlist\Block\Customer\Wishlist\Item\Options" name="customer.wishlist.item.options" cacheable="false"/>
</block>
<block class="Magento\Wishlist\Block\Customer\Wishlist\Item\Column\Actions" name="customer.wishlist.item.inner" template="item/column/actions.phtml" cacheable="false">
<arguments>
<argument name="css_class" xsi:type="string">product-item-inner</argument>
</arguments>
<block class="Magento\Wishlist\Block\Customer\Wishlist\Item\Column\Comment" name="customer.wishlist.item.comment" template="item/column/comment.phtml" cacheable="false">
<arguments>
<argument name="title" translate="true" xsi:type="string">Product Details and Comment</argument>
</arguments>
</block>
<block class="Magento\Wishlist\Block\Customer\Wishlist\Item\Column\Cart" name="customer.wishlist.item.cart" template="item/column/cart.phtml" cacheable="false">
<arguments>
<argument name="title" translate="true" xsi:type="string">Add to Cart</argument>
</arguments>
</block>
<block class="Magento\Wishlist\Block\Customer\Wishlist\Item\Column\Actions" name="customer.wishlist.item.actions" template="item/column/actions.phtml" cacheable="false">
<arguments>
<argument name="css_class" xsi:type="string">product-item-actions</argument>
</arguments>
<block class="Magento\Wishlist\Block\Customer\Wishlist\Item\Column\Edit" name="customer.wishlist.item.edit" template="item/column/edit.phtml" before="-" cacheable="false"/>
<block class="Magento\Wishlist\Block\Customer\Wishlist\Item\Column\Remove" name="customer.wishlist.item.remove" template="item/column/remove.phtml" cacheable="false"/>
</block>
</block>
</block>
<container name="customer.wishlist.buttons" as="control_buttons" label="Wishlist Control Buttons">
<block class="Magento\Wishlist\Block\Customer\Wishlist\Button" name="customer.wishlist.button.update" template="button/update.phtml" cacheable="false"/>
<block class="Magento\Wishlist\Block\Customer\Wishlist\Button" name="customer.wishlist.button.share" template="button/share.phtml" cacheable="false"/>
<block class="Magento\Wishlist\Block\Customer\Wishlist\Button" name="customer.wishlist.button.toCart" template="button/tocart.phtml" cacheable="false"/>
</container>
</block>
</referenceContainer>
</body>
</page>
Если customer_account.xml
выходит в
Приложение/дизайн/интерфейс/{Имя поставщика}/{Тема}/magento_wishlist/макет
Затем добавьте код ниже на вкладке тело <body></body>
Продукт.цена.визуализация.по умолчанию список желаний_конфигурированная_цена ложный список элементов продукт-товар-внутренний Подробная информация о продукте и комментарии Добавить в корзину
<block class="Magento\Wishlist\Block\Customer\Wishlist\Item\Column\Actions" name="customer.wishlist.item.actions" template="item/column/actions.phtml" cacheable="false">
<arguments>
<argument name="css_class" xsi:type="string">product-item-actions</argument>
</arguments>
<block class="Magento\Wishlist\Block\Customer\Wishlist\Item\Column\Edit" name="customer.wishlist.item.edit" template="item/column/edit.phtml" before="-" cacheable="false"/>
<block class="Magento\Wishlist\Block\Customer\Wishlist\Item\Column\Remove" name="customer.wishlist.item.remove" template="item/column/remove.phtml" cacheable="false"/>
</block>
</block>
</block>
<container name="customer.wishlist.buttons" as="control_buttons" label="Wishlist Control Buttons">
<block class="Magento\Wishlist\Block\Customer\Wishlist\Button" name="customer.wishlist.button.update" template="button/update.phtml" cacheable="false"/>
<block class="Magento\Wishlist\Block\Customer\Wishlist\Button" name="customer.wishlist.button.share" template="button/share.phtml" cacheable="false"/>
<block class="Magento\Wishlist\Block\Customer\Wishlist\Button" name="customer.wishlist.button.toCart" template="button/tocart.phtml" cacheable="false"/>
</container>
</block>
</referenceContainer>