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
magento2-base
dev
tests
functional
tests
app
Magento
SalesRule
Test
TestStep
ApplySalesRuleOnFrontendStep.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\SalesRule\Test\TestStep
;
8
9
use Magento\Checkout\Test\Page\CheckoutCart;
10
use
Magento\SalesRule\Test\Fixture\SalesRule
;
11
use Magento\Mtf\TestStep\TestStepInterface;
12
16
class
ApplySalesRuleOnFrontendStep
implements
TestStepInterface
17
{
23
protected
$checkoutCart
;
24
30
protected
$salesRule
;
31
37
public
function
__construct
(
CheckoutCart
$checkoutCart
, SalesRule
$salesRule
=
null
)
38
{
39
$this->checkoutCart =
$checkoutCart
;
40
$this->salesRule =
$salesRule
;
41
}
42
48
public
function
run
()
49
{
50
if
($this->salesRule !==
null
) {
51
$this->checkoutCart->getDiscountCodesBlock()->applyCouponCode($this->salesRule->getCouponCode());
52
$this->checkoutCart->getTotalsBlock()->waitForUpdatedTotals();
53
}
54
}
55
}
Magento\SalesRule\Test\TestStep\ApplySalesRuleOnFrontendStep
Definition:
ApplySalesRuleOnFrontendStep.php:16
Magento\Checkout\Model\Cart
Definition:
CartInterface.php:6
Magento\SalesRule\Test\TestStep\ApplySalesRuleOnFrontendStep\__construct
__construct(CheckoutCart $checkoutCart, SalesRule $salesRule=null)
Definition:
ApplySalesRuleOnFrontendStep.php:37
Magento\SalesRule\Test\TestStep\ApplySalesRuleOnFrontendStep\$checkoutCart
$checkoutCart
Definition:
ApplySalesRuleOnFrontendStep.php:23
Magento\SalesRule\Test\TestStep\ApplySalesRuleOnFrontendStep\run
run()
Definition:
ApplySalesRuleOnFrontendStep.php:48
Magento\SalesRule\Test\TestStep\ApplySalesRuleOnFrontendStep\$salesRule
$salesRule
Definition:
ApplySalesRuleOnFrontendStep.php:30
Magento\SalesRule\Test\Fixture\SalesRule
Definition:
ConditionsSerialized.php:7
Magento\SalesRule\Test\TestStep
Definition:
ApplySalesRuleOnBackendStep.php:7