3

I need relevant Block and Templates for Magento 1 to Magento 2? Blcok -> checkout/cart_totals Template -> 1. checkout/onepage/review/totals.phtml 2. checkout/cart/totals.phtml

$this->getLayout()->createBlock('checkout/cart_totals')->setTemplate('checkout/onepage/review/totals.phtml')->toHtml();

$this->getLayout()->createBlock('checkout/cart_totals')->setTemplate('checkout/cart/totals.phtml')->toHtml();

Convert this from Magento 1 to Magento 2?

  • Could you please add screen shot? And enable template hints – Pramod Kharade Mar 7 '18 at 15:24
  • $this->getLayout()->createBlock('checkout/cart_totals')->setTemplate('checkout/onepage/review/totals.phtml')->toHtml(); – Ramanathan Mar 8 '18 at 4:19
  • $this->getLayout()->createBlock('checkout/cart_totals')->setTemplate('checkout/cart/totals.phtml')->toHtml(); – Ramanathan Mar 8 '18 at 4:20
  • How to convert this into Mgento 2? – Ramanathan Mar 8 '18 at 4:20
  • Please answer me @Pramod? – Ramanathan Mar 8 '18 at 4:52
0

For Magento 2 you need to look out below files for your Magento 1 relevant file,

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

Block Path,

/vendor/magento/module-checkout/Block/Cart/Totals.php

Template file path,

vendor/magento/module-checkout/view/frontend/templates/cart/totals.phtml
| improve this answer | |

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.