DefaultStockqty.php 981 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\CatalogInventory\Block\Stockqty;
  7. /**
  8. * Product stock qty default block
  9. *
  10. * @api
  11. * @since 100.0.2
  12. *
  13. * @deprecated 100.3.0 Replaced with Multi Source Inventory
  14. * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html
  15. * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html
  16. */
  17. class DefaultStockqty extends AbstractStockqty implements \Magento\Framework\DataObject\IdentityInterface
  18. {
  19. /**
  20. * Render block HTML
  21. *
  22. * @return string
  23. */
  24. protected function _toHtml()
  25. {
  26. if (!$this->isMsgVisible()) {
  27. return '';
  28. }
  29. return parent::_toHtml();
  30. }
  31. /**
  32. * Return identifiers for produced content
  33. *
  34. * @return array
  35. */
  36. public function getIdentities()
  37. {
  38. return $this->getProduct()->getIdentities();
  39. }
  40. }