Configure.php 990 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Checkout\Block\Cart\Item;
  7. /**
  8. * Cart Item Configure block
  9. * Updates templates and blocks to show 'Update Cart' button and set right form submit url
  10. *
  11. * @api
  12. * @module Checkout
  13. * @since 100.0.2
  14. */
  15. class Configure extends \Magento\Framework\View\Element\Template
  16. {
  17. /**
  18. * Configure product view blocks
  19. *
  20. * @return $this
  21. */
  22. protected function _prepareLayout()
  23. {
  24. // Set custom submit url route for form - to submit updated options to cart
  25. $block = $this->getLayout()->getBlock('product.info');
  26. if ($block) {
  27. $block->setSubmitRouteData(
  28. [
  29. 'route' => 'checkout/cart/updateItemOptions',
  30. 'params' => ['id' => $this->getRequest()->getParam('id')],
  31. ]
  32. );
  33. }
  34. return parent::_prepareLayout();
  35. }
  36. }