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
integration
testsuite
Magento
SalesRule
_files
rule_specific_date.php
Go to the documentation of this file.
1
<?php
8
$tomorrow
= new \DateTime();
9
$tomorrow
->add(\DateInterval::createFromDateString(
'+1 day'
));
10
11
$rule
=
\Magento\TestFramework\Helper\Bootstrap::getObjectManager
()->create(\
Magento
\SalesRule\Model\Rule::class);
12
$rule
->setName(
13
'#1'
14
)->setIsActive(
15
1
16
)->setStopRulesProcessing(
17
0
18
)->setIsAdvanced(
19
1
20
)->setCouponType(
21
Magento
\SalesRule\Model\Rule::COUPON_TYPE_NO_COUPON
22
)->setUseAutoGeneration(
23
0
24
)->setWebsiteIds(
25
'1'
26
)->setCustomerGroupIds(
27
'0'
28
)->setDiscountStep(
29
0
30
)->setFromDate(
31
date(
'Y-m-d'
)
32
)->setToDate(
33
$tomorrow
->format(
'Y-m-d'
)
34
)->save();
$rule
$rule
Definition:
rule_specific_date.php:11
Magento
$tomorrow
$tomorrow
Definition:
rule_specific_date.php:8
Magento\TestFramework\Helper\Bootstrap\getObjectManager
static getObjectManager()
Definition:
Bootstrap.php:125