Advertisement
Guest User

Untitled

a guest
Feb 18th, 2018
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.96 KB | None | 0 0
  1. <?php
  2. /**
  3.  * Copyright © Magento, Inc. All rights reserved.
  4.  * See COPYING.txt for license details.
  5.  */
  6.  
  7. // @codingStandardsIgnoreFile
  8.  
  9. ?>
  10.  
  11. <?php /** @var \Magento\Framework\Pricing\Render\Amount $block */ ?>
  12. <?php
  13. $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
  14.  $_product = $objectManager->get('Magento\Catalog\Model\Product')->load($block->getSaleableItem()->getId());  
  15.  $unit = $_product->getResource()->getAttribute('unit')->getFrontend()->getValue($_product);;
  16. ?>
  17.  
  18. <span class="price-container <?= /* @escapeNotVerified */ $block->getAdjustmentCssClasses() ?>"
  19.         <?= $block->getSchema() ? ' itemprop="offers" itemscope itemtype="http://schema.org/Offer"' : '' ?>>
  20.     <?php if ($block->getDisplayLabel()): ?>
  21.         <span class="price-label"><?= /* @escapeNotVerified */ $block->getDisplayLabel() ?></span>
  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 class=\"price\">/".$unit."</span>" ?>
  29.     </span>
  30.     <?php if ($block->hasAdjustmentsHtml()): ?>
  31.         <?= $block->getAdjustmentsHtml() ?>
  32.     <?php endif; ?>
  33.     <?php if ($block->getSchema()): ?>
  34.         <meta itemprop="price" content="<?= /* @escapeNotVerified */ $block->getDisplayValue() ?>" />
  35.         <meta itemprop="priceCurrency" content="<?= /* @escapeNotVerified */ $block->getDisplayCurrencyCode() ?>" />
  36.     <?php endif; ?>
  37. </span>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement