Skip to content

Commit 93cbb05

Browse files
author
Stanislav Idolov
authored
ENGCOM-2230: Add spelling correction: formatedPrice to formattedPrice #16607
2 parents 62976e5 + 609a8c3 commit 93cbb05

File tree

10 files changed

+77
-13
lines changed

10 files changed

+77
-13
lines changed

app/code/Magento/Catalog/Block/Product/View/Options/AbstractOptions.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,11 @@ public function getOption()
105105
}
106106

107107
/**
108+
* Retrieve formatted price
109+
*
108110
* @return string
109111
*/
110-
public function getFormatedPrice()
112+
public function getFormattedPrice()
111113
{
112114
if ($option = $this->getOption()) {
113115
return $this->_formatPrice(
@@ -120,6 +122,17 @@ public function getFormatedPrice()
120122
return '';
121123
}
122124

125+
/**
126+
* @return string
127+
*
128+
* @deprecated
129+
* @see getFormattedPrice()
130+
*/
131+
public function getFormatedPrice()
132+
{
133+
return $this->getFormattedPrice();
134+
}
135+
123136
/**
124137
* Return formated price
125138
*

app/code/Magento/Catalog/Block/Product/View/Price.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
*/
1010
namespace Magento\Catalog\Block\Product\View;
1111

12+
use Magento\Catalog\Model\Product;
13+
1214
class Price extends \Magento\Framework\View\Element\Template
1315
{
1416
/**
@@ -37,7 +39,8 @@ public function __construct(
3739
*/
3840
public function getPrice()
3941
{
42+
/** @var Product $product */
4043
$product = $this->_coreRegistry->registry('product');
41-
return $product->getFormatedPrice();
44+
return $product->getFormattedPrice();
4245
}
4346
}

app/code/Magento/Catalog/Model/Product.php

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,11 +1124,24 @@ public function getTierPrice($qty = null)
11241124
/**
11251125
* Get formatted by currency product price
11261126
*
1127-
* @return array || double
1127+
* @return array|double
1128+
*/
1129+
public function getFormattedPrice()
1130+
{
1131+
return $this->getPriceModel()->getFormattedPrice($this);
1132+
}
1133+
1134+
/**
1135+
* Get formatted by currency product price
1136+
*
1137+
* @return array|double
1138+
*
1139+
* @deprecated
1140+
* @see getFormattedPrice()
11281141
*/
11291142
public function getFormatedPrice()
11301143
{
1131-
return $this->getPriceModel()->getFormatedPrice($this);
1144+
return $this->getFormattedPrice();
11321145
}
11331146

11341147
/**

app/code/Magento/Catalog/Model/Product/Type/Price.php

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -474,14 +474,15 @@ public function getTierPriceCount($product)
474474
*
475475
* @param float $qty
476476
* @param Product $product
477+
*
477478
* @return array|float
478479
*/
479-
public function getFormatedTierPrice($qty, $product)
480+
public function getFormattedTierPrice($qty, $product)
480481
{
481482
$price = $product->getTierPrice($qty);
482483
if (is_array($price)) {
483484
foreach (array_keys($price) as $index) {
484-
$price[$index]['formated_price'] = $this->priceCurrency->convertAndFormat(
485+
$price[$index]['formatted_price'] = $this->priceCurrency->convertAndFormat(
485486
$price[$index]['website_price']
486487
);
487488
}
@@ -492,15 +493,45 @@ public function getFormatedTierPrice($qty, $product)
492493
return $price;
493494
}
494495

496+
/**
497+
* Get formatted by currency tier price
498+
*
499+
* @param float $qty
500+
* @param Product $product
501+
*
502+
* @return array|float
503+
*
504+
* @deprecated
505+
* @see getFormattedTierPrice()
506+
*/
507+
public function getFormatedTierPrice($qty, $product)
508+
{
509+
return $this->getFormattedTierPrice($qty, $product);
510+
}
511+
512+
/**
513+
* Get formatted by currency product price
514+
*
515+
* @param Product $product
516+
* @return array|float
517+
*/
518+
public function getFormattedPrice($product)
519+
{
520+
return $this->priceCurrency->format($product->getFinalPrice());
521+
}
522+
495523
/**
496524
* Get formatted by currency product price
497525
*
498526
* @param Product $product
499527
* @return array || float
528+
*
529+
* @deprecated
530+
* @see getFormattedPrice()
500531
*/
501532
public function getFormatedPrice($product)
502533
{
503-
return $this->priceCurrency->format($product->getFinalPrice());
534+
return $this->getFormattedPrice($product);
504535
}
505536

506537
/**

app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/composite/fieldset/options/type/date.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<div class="admin__field field<?php if ($_option->getIsRequire()) echo ' required _required' ?>">
1414
<label class="label admin__field-label">
1515
<?= $block->escapeHtml($_option->getTitle()) ?>
16-
<?= /* @escapeNotVerified */ $block->getFormatedPrice() ?>
16+
<?= /* @escapeNotVerified */ $block->getFormattedPrice() ?>
1717
</label>
1818
<div class="admin__field-control control">
1919

app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/composite/fieldset/options/type/file.phtml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
// @codingStandardsIgnoreFile
88

99
?>
10+
<?php /* @var $block \Magento\Catalog\Block\Product\View\Options\Type\File */ ?>
1011
<?php $_option = $block->getOption(); ?>
1112
<?php $_fileInfo = $block->getFileInfo(); ?>
1213
<?php $_fileExists = $_fileInfo->hasData() ? true : false; ?>
@@ -64,7 +65,7 @@ require(['prototype'], function(){
6465
<div class="admin__field <?php if ($_option->getIsRequire()) echo ' required _required' ?>">
6566
<label class="admin__field-label label">
6667
<?= $block->escapeHtml($_option->getTitle()) ?>
67-
<?= /* @escapeNotVerified */ $block->getFormatedPrice() ?>
68+
<?= /* @escapeNotVerified */ $block->getFormattedPrice() ?>
6869
</label>
6970
<div class="admin__field-control control">
7071
<?php if ($_fileExists): ?>

app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/composite/fieldset/options/type/text.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<div class="field admin__field<?php if ($_option->getIsRequire()) echo ' required _required' ?>">
1313
<label class="admin__field-label label">
1414
<?= $block->escapeHtml($_option->getTitle()) ?>
15-
<?= /* @escapeNotVerified */ $block->getFormatedPrice() ?>
15+
<?= /* @escapeNotVerified */ $block->getFormattedPrice() ?>
1616
</label>
1717
<div class="control admin__field-control">
1818
<?php if ($_option->getType() == \Magento\Catalog\Api\Data\ProductCustomOptionInterface::OPTION_TYPE_FIELD): ?>

app/code/Magento/Catalog/view/frontend/templates/product/view/options/type/date.phtml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
// @codingStandardsIgnoreFile
88

99
?>
10+
<?php /* @var $block \Magento\Catalog\Block\Product\View\Options\Type\Date */ ?>
1011
<?php $_option = $block->getOption() ?>
1112
<?php $_optionId = $_option->getId() ?>
1213
<?php $class = ($_option->getIsRequire()) ? ' required' : ''; ?>
@@ -15,7 +16,7 @@
1516
<fieldset class="fieldset fieldset-product-options-inner<?= /* @escapeNotVerified */ $class ?>">
1617
<legend class="legend">
1718
<span><?= $block->escapeHtml($_option->getTitle()) ?></span>
18-
<?= /* @escapeNotVerified */ $block->getFormatedPrice() ?>
19+
<?= /* @escapeNotVerified */ $block->getFormattedPrice() ?>
1920
</legend>
2021
<div class="control">
2122
<?php if ($_option->getType() == \Magento\Catalog\Api\Data\ProductCustomOptionInterface::OPTION_TYPE_DATE_TIME

app/code/Magento/Catalog/view/frontend/templates/product/view/options/type/file.phtml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
// @codingStandardsIgnoreFile
88

99
?>
10+
<?php /* @var $block \Magento\Catalog\Block\Product\View\Options\Type\File */ ?>
1011
<?php $_option = $block->getOption(); ?>
1112
<?php $_fileInfo = $block->getFileInfo(); ?>
1213
<?php $_fileExists = $_fileInfo->hasData(); ?>
@@ -19,7 +20,7 @@
1920
<div class="field file<?= /* @escapeNotVerified */ $class ?>">
2021
<label class="label" for="<?= /* @noEscape */ $_fileName ?>" id="<?= /* @noEscape */ $_fileName ?>-label">
2122
<span><?= $block->escapeHtml($_option->getTitle()) ?></span>
22-
<?= /* @escapeNotVerified */ $block->getFormatedPrice() ?>
23+
<?= /* @escapeNotVerified */ $block->getFormattedPrice() ?>
2324
</label>
2425
<?php if ($_fileExists): ?>
2526
<div class="control">

app/code/Magento/Catalog/view/frontend/templates/product/view/options/type/text.phtml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
// @codingStandardsIgnoreFile
88

99
?>
10+
<?php /* @var $block \Magento\Catalog\Block\Product\View\Options\Type\Text */ ?>
1011
<?php
1112
$_option = $block->getOption();
1213
$class = ($_option->getIsRequire()) ? ' required' : '';
@@ -17,7 +18,7 @@ $class = ($_option->getIsRequire()) ? ' required' : '';
1718
} ?><?= /* @escapeNotVerified */ $class ?>">
1819
<label class="label" for="options_<?= /* @escapeNotVerified */ $_option->getId() ?>_text">
1920
<span><?= $block->escapeHtml($_option->getTitle()) ?></span>
20-
<?= /* @escapeNotVerified */ $block->getFormatedPrice() ?>
21+
<?= /* @escapeNotVerified */ $block->getFormattedPrice() ?>
2122
</label>
2223

2324
<div class="control">

0 commit comments

Comments
 (0)