backend_marketing_promo_expenses

Allows modification of marketing expenses list for a promo and adding of custom content to that list’s section.

Shop-Script

Input (passed by reference)

$params['expenses'] array Marketing expenses data.
$params['expenses']['type'] string Entry type name. Default value is 'promo'.
$params['expenses']['storefront'] string Address of the storefront to which an entry belongs.
$params['expenses']['start'] string Date and time of the beginning if the period to which the entry belongs, in the “yyyy-mm-ss hh:mm:ss” format.
$params['expenses']['end'] string Date and time of the end if the period to which the entry belongs, in the “yyyy-mm-ss hh:mm:ss” format.
$params['expenses']['amount'] float Amount of expenses expressed in the main store currency.
$params['expenses']['color'] string Entry color value.
$params['expenses']['note'] string Entry comment.
… your plugin code …

Output

{$backend_marketing_promo_expenses.%plugin_id%.top}

Extra content at the top of a promo’s expenses listing area. E.g., an information block or a JavaScript code snippet.

{$backend_marketing_promo_expenses.%plugin_id%.bottom}

Extra content at the bottom of a promo’s expenses listing area. E.g., an information block or a JavaScript code snippet.

Shop-Script

Plugin code example

PHP

public function backendMarketingPromoExpenses(&$params)
{
    foreach ($params['expenses'] as &$entry) {
        if (!strlen($entry['note'])) {
            $entry['note'] = _wp('Auxiliary expenses.');
        }
    }

    return [
        'top'  => '<div class="block double-padded highlighted">' . _wp('My top block') . '</div>',
        'bottom'  => '<div class="block double-padded highlighted">' . _wp('My bottom block') . '</div>',
    ];
}