Renders product price.

@param \Magento\Catalog\Model\Product $product   The product
@param string                         $priceCode The Price Code to render

@return string
195718
private function renderProductPrice(\Magento\Catalog\Model\Product $product, $priceCode)
    {
        $priceRender = $this->getPriceRenderer();

        $price = $product->getData($priceCode);

        if ($priceRender) {
            $price = $priceRender->render(
                $priceCode,
                $product,
                [
                    'include_container' => false,
                    'display_minimal_price' => true,
                    'zone' => Render::ZONE_ITEM_LIST,
                    'list_category_page' => true,
                ]
            );
        }

        return $price;
    }
863671
private function getPriceOfProduct(ProductInterface $product, $quantity, $currency)
    {
        $specialPriceValue = null;
        $bulkPriceValue = null;

        // Get special price.
        $specialPrice = $this->priceManager->getSpecialPriceForCurrency($product, $currency);
        if ($specialPrice) {
            $specialPriceValue = $specialPrice->getPrice();
        }

        // Get bulk price.
        $bulkPrice = $this->priceManager->getBulkPriceForCurrency($product, $quantity, $currency);
        if ($bulkPrice) {
            $bulkPriceValue = $bulkPrice->getPrice();
        }

        if (!empty($specialPriceValue) && !empty($bulkPriceValue)) {
            // Else take the smallest product price.
            $priceValue = $specialPriceValue;
            if ($specialPriceValue > $bulkPriceValue) {
                $priceValue = $bulkPriceValue;
            }
        } elseif (!empty($specialPriceValue)) {
            $priceValue = $specialPriceValue;
        } else {
            $priceValue = $bulkPriceValue;
        }

        // If product has no price check if it's a product variant. Then get price of product parent.
        if (!$priceValue
            && $product->getType()->getId() === $this->retrieveProductTypeIdByKey(self::PRODUCT_VARIANT_KEY)
            && $product->getParent()
        ) {
            $priceValue = $this->getPriceOfProduct($product->getParent(), $quantity, $currency);
        }

        return $priceValue;
    }
103434
private function provideProductAttribute($type, $name, $code = null)
    {
        $code = $code ?: StringInflector::nameToCode($name);

        /** @var ProductAttributeInterface $productAttribute */
        $productAttribute = $this->productAttributeRepository->findOneBy(['code' => $code]);
        if (null !== $productAttribute) {
            return $productAttribute;
        }

        $productAttribute = $this->createProductAttribute($type, $name, $code);
        $this->saveProductAttribute($productAttribute);

        return $productAttribute;
    }
350154
protected function prepareProductReview(array &$product)
    {
        $this->setItemImages($product, 'product', $this->image);
        $this->setItemThumbProduct($product, $this->image);
        $this->setItemPriceCalculated($product, $this->product);
        $this->setItemPriceFormatted($product, $this->price, $this->current_currency);
    }
306975
private function renderDefaultPriceItem()
    {
        $item = Html::tag('strong',
            Yii::$app->formatter->asCurrency($this->product->getDiscountPrice()),
            $this->discountPriceOptions
        );

        if (!empty($this->product->price->discount_type_id)) {
            $item .= Html::tag('strike',
                Yii::$app->formatter->asCurrency($this->product->getOldPrice()),
                $this->priceOptions
            );
        }

        return $item;
    }
250747
public function renderCode($code, $semicolon = true, $newLine = true)
    {
        if ($semicolon) {
            $code .= ';';
        }

        return $this->renderLine($code, $newLine);
    }
916373
protected function _getProductPrice($orderProduct)
    {
        $data = Kwc_Shop_VoucherProduct_AddToCart_OrderProductData::getInstance($orderProduct->add_component_class);
        return $data->getPrice($orderProduct);
    }
1112721
protected function _getProductData(Product $product, ProductIterator $children)
    {
        $categoryIds = $this->categoryRepository->getCategoryIds($product);
        $productData = new IndexDocument(array(
            'id' => $product->getSolrId(), // primary identifier, must be unique
            'product_id' => $product->getId(),
            'category' => $categoryIds, // @todo get category ids from parent anchor categories as well
            'category_name_t_mv' => $this->categoryRepository->getCategoryNames($categoryIds, $product->getStoreId()),
            'store_id' => $product->getStoreId(),
            'content_type' => self::CONTENT_TYPE,
            'is_visible_in_catalog_i' => intval($product->isVisibleInCatalog()),
            'is_visible_in_search_i' => intval($product->isVisibleInSearch()),
            'has_special_price_i' => intval($product->hasSpecialPrice()),
            'is_in_stock_i' => intval($product->isInStock()),
        ));

        $this->_addBoostToProductData($product, $productData);

        $this->_addFacetsToProductData($product, $productData, $children);

        $this->_addSearchDataToProductData($product, $productData, $children);

        $this->_addSortingDataToProductData($product, $productData);

        $this->_addResultHtmlToProductData($product, $productData);

        $this->_addCategoryProductPositionsToProductData($product, $productData);

        $this->eventDispatcher->dispatch('integernet_solr_get_product_data', array(
            'product' => $product,
            'product_data' => $productData,
            'children' => $children,
        ));

        return $productData;
    }
25745
public function renderPropertiesAction(ProductInterface $product)
    {
        $provider = $this->get('sonata.product.pool')->getProvider($product);

        return $this->render(sprintf('%s:properties.html.twig', $provider->getBaseControllerName()), [
            'product' => $product,
        ]);
    }
916063
protected function prepare(array $product)
    {
        $data = array();
        foreach ($this->job['data']['header'] as $key => $value) {
            $data[$key] = isset($product[$key]) ? $product[$key] : '';
        }

        $this->prepareImages($data, $product);
        $this->preparePrice($data, $product);
        $this->prepareImages($data, $product);

        return $data;
    }
365064
private function createDeleteForm(Product $product)
    {
        return $this->createFormBuilder()
            ->setAction($this->generateUrl('ecommerce_product_delete', array('id' => $product->getId())))
            ->setMethod('DELETE')
            ->getForm()
        ;
    }
377612
public function getBasePriceForCurrency(ProductInterface $product, $currency = null)
    {
        $currency = $currency ?: $this->defaultCurrency;
        if ($prices = $product->getPrices()) {
            foreach ($prices as $price) {
                if ($price->getCurrency()->getCode() == $currency && $price->getMinimumQuantity() == 0) {
                    return $price;
                }
            }
        }

        return null;
    }
537605
protected function _getProductItem( $code )
	{
		$productManager = MShop_Factory::createManager( $this->_getContext(), 'product' );

		$search = $productManager->createSearch( true );
		$expr = array(
			$search->compare( '==', 'product.code', $code ),
			$search->getConditions(),
		);
		$search->setConditions( $search->combine( '&&', $expr ) );

		$result = $productManager->searchItems( $search, array( 'price', 'text' ) );

		if( ( $productItem = reset( $result ) ) === false )
		{
			$msg = sprintf( 'No product with code "%1$s" found', $code );
			throw new Controller_Frontend_Basket_Exception( $msg );
		}

		return $productItem;
	}
842072
public function code( $codes )
	{
		if( !empty( $codes ) ) {
			$this->conditions[] = $this->filter->compare( '==', 'stock.productcode', $codes );
		}

		return $this;
	}
747838
public function get($priceRuleId, $discountCodeId)
    {
        $endpoint = '/admin/price_rules/'.$priceRuleId.'/discount_codes/'.$discountCodeId.'.json';
        $response = $this->request($endpoint);
        return $this->createObject(DiscountCode::class, $response['discount_code']);
    }
1002832
public function delete($priceRuleId, DiscountCode $discountCode)
    {
        $endpoint = '/admin/price_rules/'.$priceRuleId.'/discount_codes/'.$discountCode->id.'.json';
        $this->request($endpoint, 'DELETE');
        return;
    }
689913
private function createProduct($productName, int $price = 100, ChannelInterface $channel = null)
    {
        if (null === $channel && $this->sharedStorage->has('channel')) {
            $channel = $this->sharedStorage->get('channel');
        }

        /** @var ProductInterface $product */
        $product = $this->productFactory->createWithVariant();

        $product->setCode(StringInflector::nameToUppercaseCode($productName));
        $product->setName($productName);
        $product->setSlug($this->slugGenerator->generate($productName));

        if (null !== $channel) {
            $product->addChannel($channel);

            foreach ($channel->getLocales() as $locale) {
                $product->setFallbackLocale($locale->getCode());
                $product->setCurrentLocale($locale->getCode());

                $product->setName($productName);
                $product->setSlug($this->slugGenerator->generate($productName));
            }
        }

        /** @var ProductVariantInterface $productVariant */
        $productVariant = $this->defaultVariantResolver->getVariant($product);

        if (null !== $channel) {
            $productVariant->addChannelPricing($this->createChannelPricingForChannel($price, $channel));
        }

        $productVariant->setCode($product->getCode());
        $productVariant->setName($product->getName());

        return $product;
    }