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_free_shipping_by_product_weight.php
Go to the documentation of this file.
1
<?php
7
require
'cart_rule_free_shipping.php'
;
8
$row
=
9
[
10
'name'
=>
'Free shipping if item weight <= 1'
,
11
'conditions'
=> [
12
1 =>
13
[
14
'type'
=> \Magento\SalesRule\Model\Rule\Condition\Combine::class,
15
'attribute'
=>
null
,
16
'operator'
=>
null
,
17
'value'
=>
'1'
,
18
'is_value_processed'
=>
null
,
19
'aggregator'
=>
'all'
,
20
'conditions'
=> [
21
[
22
'type'
=> Magento\SalesRule\Model\Rule\Condition\Address::class,
23
'attribute'
=>
'weight'
,
24
'operator'
=>
'<='
,
25
'value'
=>
'1'
,
26
'is_value_processed'
=>
false
,
27
]
28
]
29
]
30
31
],
32
'actions'
=> [],
33
];
34
$salesRule
->loadPost(
$row
);
35
$salesRule
->save();
$row
$row
Definition:
rule_free_shipping_by_product_weight.php:8
$salesRule
$salesRule
Definition:
discount_10percent.php:14