Price.php 772 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\ProductAlert\Block\Product\View;
  7. /**
  8. * Product view price
  9. *
  10. * @api
  11. * @since 100.0.2
  12. */
  13. class Price extends \Magento\ProductAlert\Block\Product\View
  14. {
  15. /**
  16. * Prepare price info
  17. *
  18. * @param string $template
  19. * @return $this
  20. */
  21. public function setTemplate($template)
  22. {
  23. if (!$this->_helper->isPriceAlertAllowed()
  24. || !$this->getProduct() ||
  25. false === $this->getProduct()->getCanShowPrice()
  26. ) {
  27. $template = '';
  28. } else {
  29. $this->setSignupUrl($this->_helper->getSaveUrl('price'));
  30. }
  31. return parent::setTemplate($template);
  32. }
  33. }