Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2019
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.41 KB | None | 0 0
  1. <?php
  2. $objectManager = MagentoFrameworkAppObjectManager::getInstance();
  3. $storeInformation = $objectManager->create('MagentoStoreModelInformation');
  4. $store = $objectManager->create('MagentoStoreModelStore');
  5. $storeInfo = $storeInformation->getStoreInformationObject($store);
  6. $product = $block->getCurrentProduct();
  7. ?>
  8.  
  9. <?php if($_product->getData('show_price')): ?>
  10. <?php if($_product->getPriceInfo()->getPrice('final_price')->getValue() == 0): ?>
  11. <span class="price-call"><a href="tel:+1<?php echo $storeInfo->getPhone(); ?>">Call for Price!</a></span>
  12. <?php else: ?>
  13. <span class="price-container <?= /* @escapeNotVerified */ $block->getAdjustmentCssClasses() ?>"
  14. <?= $block->getSchema() ? ' itemprop="offers" itemscope itemtype="http://schema.org/Offer"' : '' ?>>
  15. <?php if ($block->getDisplayLabel()): ?>
  16. <span class="price-label"><?= /* @escapeNotVerified */ $block->getDisplayLabel() ?></span>
  17. <?php endif; ?>
  18. <?php if($_product->getData('priced_starting_at')): ?>
  19. <div class="price-starting-at">Starting at:</div>
  20. <?php else: ?>
  21. <div class="price-regular">Our Price:</div>
  22. <?php endif; ?>
  23. <span <?php if ($block->getPriceId()): ?> id="<?= /* @escapeNotVerified */ $block->getPriceId() ?>"<?php endif;?>
  24. <?= ($block->getPriceDisplayLabel()) ? 'data-label="' . $block->getPriceDisplayLabel() . $block->getPriceDisplayInclExclTaxes() . '"' : '' ?>
  25. data-price-amount="<?= /* @escapeNotVerified */ $block->getDisplayValue() ?>"
  26. data-price-type="<?= /* @escapeNotVerified */ $block->getPriceType() ?>"
  27. class="price-wrapper <?= /* @escapeNotVerified */ $block->getPriceWrapperCss() ?>"
  28. ><?= /* @escapeNotVerified */ $block->formatCurrency($block->getDisplayValue(), (bool)$block->getIncludeContainer()) ?></span>
  29. <?php if ($block->hasAdjustmentsHtml()): ?>
  30. <?= $block->getAdjustmentsHtml() ?>
  31. <?php endif; ?>
  32. <?php if ($block->getSchema()): ?>
  33. <meta itemprop="price" content="<?= /* @escapeNotVerified */ $block->getDisplayValue() ?>" />
  34. <meta itemprop="priceCurrency" content="<?= /* @escapeNotVerified */ $block->getDisplayCurrencyCode() ?>" />
  35. <?php endif; ?>
  36. </span>
  37. <?php endif; ?>
  38. <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement