backend_storefront_seo

Allows adding custom content to backend section Sales channels › Site › Settings & SEO and to change the list of storefronts available for setup in that section.

Shop-Script

Input (passed by reference)

Array with the following keys:
$params['routes'] array List of storefronts available for setup. Each list item is a subarray with the following keys:
$params['routes'][domain][sort_order]['_name'] string Name.
$params['routes'][domain][sort_order]['url'] string Address.
$params['routes'][domain][sort_order]['locale'] string Locale identifier.
$params['routes'][domain][sort_order]['theme'] string Identifier of the main design theme.
$params['routes'][domain][sort_order]['theme_mobile'] string Identifier of the design theme for mobile devices.
$params['routes'][domain][sort_order]['checkout_version'] int Checkout mode: 1 (multi-step, deprecated), 2 (in-cart).
$params['routes'][domain][sort_order]['title'] string TITLE tag value for the home page.
$params['routes'][domain][sort_order]['meta_keywords'] string keywords meta tag value for the home page.
$params['routes'][domain][sort_order]['meta_description'] string description meta tag value for the home page
$params['routes'][domain][sort_order]['og_title'] string og:title meta tag value for the home page.
$params['routes'][domain][sort_order]['og_image'] string og:image meta tag value for the home page.
$params['routes'][domain][sort_order]['og_video'] string og:video meta tag value for the home page.
$params['routes'][domain][sort_order]['og_description'] string og:description meta tag value for the home page.
$params['routes'][domain][sort_order]['og_type'] string og:type meta tag value for the home page.
$params['routes'][domain][sort_order]['og_url'] string og:url meta tag value for the home page.
$params['routes'][domain][sort_order]['url_type'] int Page URL type: 0 (mixed), 1 (plain), 2 (natural).
$params['routes'][domain][sort_order]['products_per_page'] int Number of products displayed per page.
$params['routes'][domain][sort_order]['type_id'] int|array<int> Selected product type IDs. Or 0 if no types are selected.
$params['routes'][domain][sort_order]['currency'] string 3-letter main currency code.
$params['routes'][domain][sort_order]['public_stocks'] int|array<int> Displayed stocks’ IDs. Or 0 if no stocks are selected.
$params['routes'][domain][sort_order]['drop_out_of_stock'] int Display mode for out-of-stock products: 0 (show “as is”), 1 (move to the end of a list), 2 (hide).
$params['routes'][domain][sort_order]['payment_id'] int|array<int> IDs of selected payment methods. Or 0 no methods are selected.
$params['routes'][domain][sort_order]['shipping_id'] int|array<int> IDs of selected shipping methods. Or 0 no methods are selected.
$params['routes'][domain][sort_order]['checkout_storefront_id'] string In-cart checkout storefront identifier.
$params['routes'][domain][sort_order]['storefront_mode'] string Headless API availability mode: empty string '' (disabled storefront), 'storefront_api' (both the storefront and Headless API are available), 'api' (only Headless API is available).
$params['routes'][domain][sort_order]['settings_url'] string Storefront settings page URL.
… your plugin code …

Output

{$backend_storefront_seo.main_html}
Custom HTML code to be added after the storefront list.
Shop-Script

Plugin code example

PHP

public function backendStorefrontSeo(&$params)
{
    $routes = &$params['routes'];
    
    // modify the available route list if necessary
    // shopMyPluginHelper::updateRouteList($routes);
    
    waLog::log(
        _wp('Available storefronts:')
            . PHP_EOL
            . wa_dump_helper($routes),
        'shop/plugins/' . $this->id . '/backend_storefront_seo.log'
    );

    return [
        'main_html' => '<!-- some additional HTML -->',
    ];
}