3

I have a custom page where users can fill out their e-mail to receive a quotation. I would like to add a column with a list of items currently in the shopping cart. How to achieve this?

When I Google for the above question, the only results I get are how to add custom content to the checkout page, which is exactly the other way around.

I am fairly new to Magento, these are the things I've tried:

<block class="Magento\Checkout\Block\Cart" name="checkout.cart" template="Magento_Checkout::cart.phtml" />

or:

<referenceBlock class="Magento\Checkout\Block\Cart" name="checkout.cart" template="Magento_Checkout::cart.phtml" />

Both options don't show anything. I even tried to add the full container contents from checkout_cart_index.xml from the Magento_Checkout module, but that doesn't seem right and of course I got a lot of reference errors.

  • are you using a module for the custom page? – ASR Oct 9 '19 at 3:53
  • Do you want to display just item list with add to cart button or you want to display other things as well like order summary , coupon box. If you wan to display just items with add to cart then you can just create a custom module with function of getAllVisibleItems and display items on .phtml file and add that block in custom page via xml. – Hitesh Agrawal Oct 9 '19 at 5:10

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.