Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-bundle
Pricing
Price
SpecialPrice.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Bundle\Pricing\Price
;
8
9
use
Magento\Catalog\Pricing\Price\RegularPrice
;
10
14
class
SpecialPrice
extends
\Magento\Catalog\Pricing\Price\SpecialPrice
implements
DiscountProviderInterface
15
{
19
protected
$percent
;
20
26
public
function
getDiscountPercent
()
27
{
28
if
($this->percent ===
null
) {
29
$this->percent = parent::getValue();
30
}
31
return
$this->percent
;
32
}
33
39
public
function
getValue
()
40
{
41
if
($this->
value
!==
null
) {
42
return
$this->value
;
43
}
44
45
$specialPrice = $this->
getDiscountPercent
();
46
if
($specialPrice) {
47
$regularPrice = $this->
getRegularPrice
();
48
$this->
value
= $regularPrice * ($specialPrice / 100);
49
}
else
{
50
$this->
value
=
false
;
51
}
52
return
$this->value
;
53
}
54
60
protected
function
getRegularPrice
()
61
{
62
return
$this->priceInfo->getPrice(
RegularPrice::PRICE_CODE
)->getValue();
63
}
64
68
public
function
isPercentageDiscount
()
69
{
70
return
true
;
71
}
72
}
Magento\Bundle\Pricing\Price\SpecialPrice
Definition:
SpecialPrice.php:14
Magento\Bundle\Pricing\Price\SpecialPrice\$percent
$percent
Definition:
SpecialPrice.php:19
Magento\Bundle\Pricing\Price\DiscountProviderInterface
Definition:
DiscountProviderInterface.php:14
value
$block setTitle( 'CMS Block Title') -> setIdentifier('fixture_block') ->setContent('< h1 >Fixture Block Title</h1 >< a href=" store url</a><p> Config value
Definition:
block.php:9
Magento\Catalog\Pricing\Price\SpecialPrice
Definition:
SpecialPrice.php:18
Magento\Catalog\Pricing\Price\RegularPrice\PRICE_CODE
const PRICE_CODE
Definition:
RegularPrice.php:20
Magento\Bundle\Pricing\Price\SpecialPrice\getDiscountPercent
getDiscountPercent()
Definition:
SpecialPrice.php:26
Magento\Framework\Pricing\Price\AbstractPrice\$value
$value
Definition:
AbstractPrice.php:61
Magento\Bundle\Pricing\Price\SpecialPrice\getValue
getValue()
Definition:
SpecialPrice.php:39
Magento\Bundle\Pricing\Price\SpecialPrice\getRegularPrice
getRegularPrice()
Definition:
SpecialPrice.php:60
Magento\Catalog\Pricing\Price\RegularPrice
Definition:
RegularPrice.php:15
Magento\Bundle\Pricing\Price\SpecialPrice\isPercentageDiscount
isPercentageDiscount()
Definition:
SpecialPrice.php:68
Magento\Bundle\Pricing\Price
Definition:
BundleOptionPrice.php:6