backend_marketing_promos

Allows modification of or adding of custom content to promos listing pages in the “Marketing” section.

Shop-Script

Input (passed by reference)

$params['show_unatt_storefronts'] bool Whether a user is shown the interface element to view promos not linked to any storefront.
$params['unattached_active'] bool Whether the interface element to view promos not linked to any storefront is currently selected.
$params['active_promos'] array List of active promos and their properties.
$params['planned_promos'] array List of planned promos and their properties.
$params['completed_promos'] array List of completed promos and their properties.
$params['promos_charts'] array Values for promos’ stats charts.
$params['promos_markers'] array Promos’ displaying info.
$params['promos_stats'] array Promos’ stats data.
$params['storefronts'] array List of all storefronts.
$params['filtering'] array Promo list filtering parameters.
$params['filtering']['storefront'] string|null Selected storefrontnt.
$params['filtering']['status'] string|null Selected type of promos: 'planned', 'active', or 'completed'. Or null if no status is selected.
$params['filtering']['page'] int Promos listing page No.
… your plugin code …

Output

{$backend_marketing_promos.%plugin_id%.action_link}

Extra content next to actions links. E.g., HTML code of additional action links.

{$backend_marketing_promos.%plugin_id%.bottom}

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

Shop-Script

Plugin code example

PHP

public function backendMarketingPromos($params)
{
    $page = $params['filtering']['page'];

    return [
        'action_link'  => '<a href="">' . _wp('My plugin’s action link') . '</a>',
        'bottom'       => '<div class="block double-padded highlighted">' . sprintf_wp('Current page No. is %d.', $page) . '</div>',
    ];
}