Advertisement
Guest User

Untitled

a guest
Apr 1st, 2015
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.92 KB | None | 0 0
  1. <?php
  2. /**
  3. * Copyright © 2015 Magento. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6.  
  7. // @codingStandardsIgnoreFile
  8.  
  9. /** @var $block \Magento\Checkout\Block\Cart\Sidebar */
  10. ?>
  11.  
  12. <?php $_cartQty = (float) $block->getSummaryCount() ?>
  13. <div data-block="minicart" class="minicart-wrapper">
  14. <a class="action showcart" href="<?php echo $block->getShoppingCartUrl(); ?>">
  15. <span class="text"><?php echo __('My Cart'); ?></span>
  16. <span class="counter qty<?php echo($_cartQty > 0) ? '' : ' empty'; ?>">
  17. <span class="counter-number">
  18. <?php echo $_cartQty;?>
  19. </span>
  20. <span class="counter-label">
  21. <?php echo $block->getSummaryText($_cartQty); ?>
  22. </span>
  23. </span>
  24. </a>
  25. <?php if ($block->getIsNeedToDisplaySideBar()): ?>
  26. <div class="block block-minicart<?php echo($_cartQty > 0) ? '' : ' empty'; ?>"
  27. data-mage-init='{"dropdownDialog":{
  28. "appendTo":"[data-block=minicart]",
  29. "triggerTarget":".showcart",
  30. "timeout": "2000",
  31. "closeOnMouseLeave": false,
  32. "closeOnEscape": true,
  33. "triggerClass":"active",
  34. "parentClass":"active",
  35. "buttons":[]}}'>
  36. <div id="minicart-content-wrapper">
  37. <?php echo $block->getChildHtml('minicart_content') ?>
  38. </div>
  39. </div>
  40. <?php endif ?>
  41. <script type="text/x-magento-init">
  42. {
  43. "[data-block='minicart']": {
  44. "sidebar": {
  45. "targetElement": "div.block.block-minicart",
  46. "url": {
  47. "checkout": "<?php echo $block->getCheckoutUrl();?>",
  48. "update": "<?php echo $block->getUpdateItemQtyUrl(); ?>",
  49. "remove": "<?php echo $block->getRemoveItemUrl(); ?>"
  50. },
  51. "button": {
  52. "checkout": "#top-cart-btn-checkout",
  53. "remove": "#mini-cart a.action.delete",
  54. "close": "#btn-minicart-close"
  55. },
  56. "showcart": {
  57. "parent": "span.counter",
  58. "qty": "span.counter-number",
  59. "label": "span.counter-label"
  60. },
  61. "minicart": {
  62. "list": "#mini-cart",
  63. "content": "#minicart-content-wrapper",
  64. "qty": "div.items-total",
  65. "subtotal": "div.subtotal span.price"
  66. },
  67. "item": {
  68. "qty": ":input.cart-item-qty",
  69. "button": ":button.update-cart-item"
  70. },
  71. "confirmMessage": "<?php echo __('Are you sure you would like to remove this item from the shopping cart?') ?>"
  72. }
  73. }
  74. }
  75. </script>
  76. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement