Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Sidebar.php
Go to the documentation of this file.
1 <?php
11 
14 
20 {
26  public function getTitle()
27  {
28  return __('My Wish List');
29  }
30 
41  public function getProductPriceHtml(
43  $priceType,
44  $renderZone = Render::ZONE_ITEM_LIST,
45  array $arguments = []
46  ) {
47  if (!isset($arguments['zone'])) {
48  $arguments['zone'] = $renderZone;
49  }
50 
51  $price = '';
52 
53  $priceRender = $this->getPriceRender();
54  if ($priceRender) {
55  $price = $priceRender->render($priceType, $product, $arguments);
56  }
57 
58  return $price;
59  }
60 
66  private function getPriceRender()
67  {
69  $priceRender = $this->getLayout()->getBlock('product.price.render.default');
70  if (!$priceRender) {
71  $priceRender = $this->getLayout()->createBlock(
72  \Magento\Framework\Pricing\Render::class,
73  'product.price.render.default',
74  [
75  'data' => [
76  'price_render_handle' => 'catalog_product_prices',
77  ],
78  ]
79  );
80  }
81  return $priceRender;
82  }
83 }
getProductPriceHtml(Product $product, $priceType, $renderZone=Render::ZONE_ITEM_LIST, array $arguments=[])
Definition: Sidebar.php:41
__()
Definition: __.php:13
$price
$priceType
Definition: msrp.phtml:18
$arguments