Guest User

Untitled

a guest
Jan 4th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. public function getProductPriceHtml(
  2. MagentoCatalogModelProduct $product,
  3. $priceType = null,
  4. $renderZone = MagentoFrameworkPricingRender::ZONE_ITEM_LIST,
  5. array $arguments = []
  6. ) {
  7. if (!isset($arguments['zone'])) {
  8. $arguments['zone'] = $renderZone;
  9. }
  10. $arguments['price_id'] = isset($arguments['price_id'])
  11. ? $arguments['price_id']
  12. : 'old-price-' . $product->getId() . '-' . $priceType;
  13. $arguments['include_container'] = isset($arguments['include_container'])
  14. ? $arguments['include_container']
  15. : true;
  16. $arguments['display_minimal_price'] = isset($arguments['display_minimal_price'])
  17. ? $arguments['display_minimal_price']
  18. : true;
  19.  
  20. /** @var MagentoFrameworkPricingRender $priceRender */
  21. $priceRender = $this->getLayout()->getBlock('product.price.render.default');
  22.  
  23. $price = '';
  24. if ($priceRender) {
  25. $price = $priceRender->render(
  26. MagentoCatalogPricingPriceFinalPrice::PRICE_CODE,
  27. $product,
  28. $arguments
  29. );
  30. }
  31. return $price;
  32. }
Add Comment
Please, Sign In to add comment