php js css php js css

Scripts

Save Script Run
Attached Artifacts
Title
PHP Code
<?php $before = \Components\Marketing\Automation\Progress::getDisabledIds(); \Components\Marketing\Automation\Progress::setDisabledIds(array_column(\Components\Marketing\Automation::getAll(), 'automation_id')); try { \Components\Commerce\Discounts::save([ 'discount_id' => 26, 'discount_entity_type' => \Components\AF\Courses\CollectiveCourses::class, 'discount_excluded_product_entities' => [513] ]); $d = \Components\Commerce\Discounts::get(26); echo json_encode(array_intersect_key($d, array_flip(['discount_id', 'discount_entity_type', 'discount_excluded_product_entities', 'discount_is_enabled_admin', 'discount_is_enabled_public'])), JSON_PRETTY_PRINT); } finally { \Components\Marketing\Automation\Progress::setDisabledIds($before); }

Run Log

▼ Today 4:33am ✓ Completed 0.0s
{
    "discount_id": "26",
    "discount_entity_type": "Components\\AF\\Courses\\CollectiveCourses",
    "discount_excluded_product_entities": [
        513
    ],
    "discount_is_enabled_public": "0",
    "discount_is_enabled_admin": "0"
}