1

How can I hide price based on a condition from customer wishlist products.

<block class="Magento\Wishlist\Block\Customer\Wishlist" name="customer.wishlist" template="Magento_Wishlist::view.phtml" cacheable="false">
                <block class="Magento\Wishlist\Block\Rss\Link" name="wishlist.rss.link" template="Magento_Wishlist::rss/wishlist.phtml"/>
                <block class="Magento\Wishlist\Block\Customer\Wishlist\Items" name="customer.wishlist.items" as="items" template="Magento_Wishlist::item/list.phtml" cacheable="false">
                    <block class="Magento\Wishlist\Block\Customer\Wishlist\Item\Column\Image" name="customer.wishlist.item.image" template="Magento_Wishlist::item/column/image.phtml" cacheable="false"/>
                    <block class="Magento\Wishlist\Block\Customer\Wishlist\Item\Column\Info" name="customer.wishlist.item.name" template="Magento_Wishlist::item/column/name.phtml" cacheable="false"/>
                    <block class="Magento\Wishlist\Block\Customer\Wishlist\Item\Column\Cart" name="customer.wishlist.item.price" template="Magento_Wishlist::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="Magento_Wishlist::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="Magento_Wishlist::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="Magento_Wishlist::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="Magento_Wishlist::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="Magento_Wishlist::item/column/edit.phtml" before="-" cacheable="false"/>
                            <block class="Magento\Wishlist\Block\Customer\Wishlist\Item\Column\Remove" name="customer.wishlist.item.remove" template="Magento_Wishlist::item/column/remove.phtml" cacheable="false"/>
                        </block>
                    </block>
                </block>

Need to override for this <argument name="price_render" xsi:type="string">product.price.render.default</argument>

1
  • What your condition where you where you want to hide price product page listing page and or somewhere else?
    – Aman Alam
    Dec 17 '18 at 17:46
0

Create wishlist_index_index.xml file under your module, view/frontend/layout/wishlist_index_index.xml

<?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>
        <referenceBlock name="product.price.render.wishlist" remove='true' />
    </body>
</page>
1
  • I want to hide based on product attribute
    – Yogita
    Dec 18 '18 at 12:49

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.