backend_marketing_promo

Allows modification of or adding of custom content to promo-viewing pages in the “Marketing” section.

Shop-Script

Input (passed by reference)

$params['options'] string Value if the GET parameter 'options'.
$params['promo'] array Promo’s properties.
$params['overall_totals'] array Total statistical values relating to orders received from all storefronts included in the promo.
$params['promo_totals'] array Total statistical values relating to orders matching the promo’s settings.
$params['chart_data'] array Values used to draw the chart on the promo-viewing page.
$params['storefronts'] array The list of storefronts selected in the promo’s settings.
$params['rule_types'] array The list of tools available in the promo’s settings.
… your plugin code …

Output

{$backend_marketing_promo.%plugin_id%.action_link}

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

{$backend_marketing_promo.%plugin_id%.info_section}

Extra content under the list of promo settings fields. E.g., HTML code of extra settings fields.

{$backend_marketing_promo.%plugin_id%.button}

Extra content next to the promo saving button. E.g., HTML code of additional buttons.

{$backend_marketing_promo.%plugin_id%.bottom}

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

Shop-Script

Plugin code example

PHP

public function backendMarketingPromo($params)
{
    $promo_settings = $params['promo'];

    return [
        'action_link'  => '<a href="">' . _wp('My plugin’s action link') . '</a>',
        'info_section' => waHtmlControl::getControl(waHtmlControl::INPUT, 'custom_field', [
            'namespace' => 'myplugin',
            'title' => _wp('My custom field'),
            'control_wrapper' => '<div class="field"><div class="name">%s</div><div class="value">%s%s</div></div>',
            'title_wrapper' => '%s',
            'value' => $promo_settings['name'],
        ]),
        'button'       => '<button class="button blue">' . _wp('My plugin’s button') . '</button>',
        'bottom'       => '<div class="block double-padded highlighted">' . _wp('My plugin’s bottom block.') . '</div>',
    ];
}