1

I've created a custom theme and wishlist page looks like this enter image description here

Product is getting added in the cart for qty 1. But when I set qty more than 1, I am redirecting to the product detail page.

Here is my xml code

Magento_Wishlist/layout/wishlist_index_index.xml

<?xml version="1.0"?>
<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <update handle="customer_account"/>
    <body>
        <referenceBlock name="customer.wishlist.button.toCart" remove="true" /> 
        <referenceBlock name="head.components">
            <block class="Magento\Framework\View\Element\Js\Components" name="wishlist_head_components" template="Magento_Wishlist::js/components.phtml"/>
        </referenceBlock>
        <referenceContainer name="content">
            <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-inners</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\Button" name="customer.wishlist.button.update" template="Magento_Wishlist::button/update.phtml" 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 class="Magento\Wishlist\Block\Customer\Wishlist\Button" name="customer.wishlist.button.share" template="Magento_Wishlist::button/share.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.toCart" template="Magento_Wishlist::button/tocart.phtml" cacheable="false"/>
                </container>
            </block>
        </referenceContainer>
    </body>
</page>
  • More than One quantity to be added to the cart is allowed? Did you clicked on the update button after updating the quantity & before adding it to the cart? – Abhishek Tripathi Apr 17 at 11:59
  • I am able to add more than 1 in luma theme without clicking on update button – Bhakti Thakkar Apr 17 at 12:04
  • @ABHISHEKTRIPATHI – Bhakti Thakkar Apr 17 at 12:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.