yf_shop__site_title user module

Fileplugins/shop/modules/shop/yf_shop__site_title.class.php
Usemodule('shop__site_title'), URL ?object=shop__site_title

Public properties

PropertyDefaultDescription
None declared in this class.

Public methods 1

None without a leading underscore.

Methods starting with _ hooks and helpers; not routable as page actions

_site_title

public function _site_title($title)
    public function _site_title($title)
    {
        $title = module('shop')->COMPANY_INFO['company_title'] ? module('shop')->COMPANY_INFO['company_title'] : module('shop')->COMPANY_INFO['company_name'];
        $subtitle = '';
        if (in_array(($_GET['action'] ?? null), ['show', 'products_show']) && ($_GET['id'] ?? null)) {
            $subtitle .= module('shop')->_shop_cats[($_GET['id'] ?? null)];
        } elseif (in_array(($_GET['action'] ?? null), ['product_details']) /* && $_GET["id"] */) {
            $man = module('shop')->_manufacturer[module('shop')->_product_info['manufacturer_id']]['name'];
            $subtitle .= module('shop')->_product_info['name'] . ' - ' . $man;
        }
        if ($subtitle) {
            $title = $subtitle . ' - ' . $title;
        }
        return $title;
    }