Last active
April 2, 2018 03:22
-
-
Save gamaup/e139586d65b741f1fe8bb9aba9c6f865 to your computer and use it in GitHub Desktop.
Custom Price Rules data structure
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$rules = array( | |
"ruleset_f45Is7PCFWd4mjU" => array( | |
"label" => "Ruleset Name", | |
"enabled" => true, | |
"rules" => array( | |
"rule_mVk9lHtMJLw38vD" => array( | |
"label" => "Rule Name", | |
"method" => "bulk", | |
"rewards" => array( | |
"bulk-discount" => array( | |
array( | |
"from" => 1, | |
"to" => 2, | |
"type" => "fixed_discount", | |
"amount" => 1000 | |
), | |
array( | |
"from" => 3, | |
"to" => , | |
"type" => "fixed_discount", | |
"amount" => 2000 | |
) | |
) | |
), | |
"restrictions" => array( | |
"product" => array( | |
array( | |
array( | |
"param" => "id" | |
"operator" => "in_list" | |
"value" => array( | |
2469 | |
) | |
) | |
) | |
) | |
) | |
) | |
), | |
"is_exclusive" => false | |
) | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$rules = array( | |
// rule 1, | |
"rule_H1HpHSlUMxw4bHN" => array( | |
"method" => "bulk", // method. | |
"rewards" => array( // rewards. | |
"bulk-pricing" => array( | |
array( | |
"from" => 1, | |
"to" => 2, | |
"price" => 90000 | |
), | |
array( | |
"from" => 3, | |
"to" => 4, | |
"price" => 80000 | |
), | |
array( | |
"from" => 5 | |
"to" => | |
"price" => 70000 | |
) | |
) | |
), | |
"restrictions" => array( // restrictions. | |
"condition" => array( | |
array( // or clause. | |
array( // and clause. | |
"param" => "reseller_type", | |
"operator" => "in_list", | |
"value" => array( | |
"all" | |
) | |
) | |
) | |
) | |
) | |
) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment