Skip to content
CWPControl Web PanelDocumentation
  1. Home
  2. Docs
  3. CWP Billing
  4. Administration
  5. Client area, themes and languages

Client area, themes and languages

Updated

The client area is the part of the billing your customers see: the store, their services, invoices, domains and tickets, the knowledgebase and the status page. You can give it your own look with a theme, use it in 9 languages, and run several brands from one installation.

The logo uploaded under Billing settings → Invoice issuer → Logo replaces the company name in the header of the default layout. A theme with its own layout places the logo itself (\CwpBilling\Services\Logo::url() returns its URL, or null when none is set).

The client area dashboard
The store

What clients see

PageAddress
Dashboard/
Store / order/store, /store/<product id>
Services, domains, invoices, tickets/services, /domains, /invoices, /tickets
Open a ticket (also guests)/tickets/new
Contact form/contact
Knowledgebase, announcements/knowledgebase, /announcements
Status page/status
Affiliate program/affiliates

Clients manage these themselves:

  • their profile, password and 2FA;
  • users of the account;
  • quantity options of their services, for example the number of licenses (see Changing a quantity);
  • saved cards;
  • the e-mail history;
  • whether they receive general e-mails.

Forgotten password: clients can enter their login address or a contact address of the account; the reset link goes to the address they entered, and the reset page shows the login address to use.

Themes

A theme changes the look of the client area without touching the application. The admin area is not themed.

themes/<name>/
  theme.php        theme settings (brand, menu links, footer columns)
  views/           overrides any template from views/ with the same path, e.g.
                   views/layout/client.php   page frame (header, footer)
                   views/client/login.php    login page
  assets/          CSS, fonts and images
  lang/<code>.php  extra or changed translations
  1. Create themes/mytheme/.
  2. Copy views/layout/client.php to themes/mytheme/views/layout/client.php and change it.
  3. Add themes/mytheme/assets/theme.css, and link it in the layout with Theme::asset('theme.css').
  4. Set 'theme' => 'mytheme' in config/config.php.
  5. Run php bin/console theme:publish. It copies the assets to the web root.

Rules:

  • Print every value with e() and every visible text with t(), so it stays safe and translatable.
  • Inline <script> and style="" attributes are blocked by the Content Security Policy. Put styles in the theme CSS.
  • After an update, compare your overridden templates with the new views/ files.

Languages

These languages are included and enabled by the installer:

LanguageCodeLanguageCode
EnglishenItalianit
GermandePortuguese (Brazil)pt
SpanishesRussianru
FrenchfrTurkishtr
Croatianhr|
  • Clients choose the language in the footer. Otherwise the browser language is used. E-mails use the client’s E-mail language.
  • Enabled languages are set in config.php: 'languages' => ['en', 'de', ...] and 'default_language' => 'en'.
  • Change a text: lang/<code>.php. The English text is the key. For a theme, use themes/<name>/lang/<code>.php, which survives updates.
  • Add a language: copy lang/de.php to lang/<code>.php and lang/emails/de.php to lang/emails/<code>.php, translate the values, and add the code to languages.
  • E-mail texts can also be edited in the admin area under E-mail templates.

Brands

One installation can serve several brands, for example two hosting companies with their own sites. A brand has its own:

  • name and host name;
  • client area URL;
  • theme;
  • e-mail sender;
  • company details on invoices (legal name, address, tax ID, bank details, footer).

Brands → Add brand. Point the brand’s host name to the same installation. Web pages use the brand of the host name. E-mails and invoice PDFs use the client’s brand (field Brand on the client). Without brands, everything uses config.php and the settings.

Knowledgebase and announcements

Knowledgebase: categories and articles, shown at /knowledgebase. Announcements: news for your clients at /announcements.

Downloads

Downloads in the left menu (Support): add a category, then upload files into it. Each file has a title, a description and who can download it:

AccessWho
EveryoneAlso visitors who are not logged in
Logged-in clientsEvery client with a login
Clients with an active service of the products belowOnly clients with an active service of one of the chosen products

The files are stored outside the web root (storage/downloads) and are only sent after the access check. The client area shows Downloads in the menu once a file is published. The upload size is limited by PHP (upload_max_filesize and post_max_size).

Sign in with Google

Clients can log in with their Google account. Create an OAuth client ID (Web application) in the Google Cloud Console → APIs & Services → Credentials, add the redirect URI shown under General settings → Sign in with Google, and enter the client ID and secret there.

  • The login page then shows Sign in with Google.
  • A client links a Google account under My account, or simply signs in with a Google account whose verified address is the same as their login e-mail.
  • Two-factor authentication still applies: a login with 2FA asks for the code after Google.
  • No new accounts are created through Google; an unknown address is sent to the registration form.

Status page

Status page shows the components of your service, for example servers, the website and mail, with their status and uptime:

The public status page
  • Monitor: HTTP (2xx/3xx, optionally a text that the answer must contain) or TCP (port open), checked every 5 minutes. Two failures in a row mean major outage, and the next success means operational.
  • Staff can set a status by hand. The monitor then leaves that component alone.
  • Post incidents and planned maintenance with updates.
  • A ticket can be opened in a chosen department when a monitor changes.

Affiliate program

Enable it in Billing settings (percentage, delay days, minimum payout, cookie days).

  1. A client activates it and gets a link (aff.php?aff=<id>).
  2. Services ordered by visitors within the cookie days are linked to the affiliate.
  3. Every paid invoice of such a service earns a commission. The commission is set per product, per affiliate, or as the default percentage.
  4. The commission becomes available after the delay days.
  5. Payouts are requested as a ticket. Affiliates shows the referrals, the commissions and the payouts.

Common problems

ProblemCause and solution
Theme changes are not visibleRun php bin/console theme:publish and reload with the cache cleared. Check public_dir in config.php.
A text is still in EnglishIt has no translation in lang/<code>.php yet. Add it with the English text as the key.
A brand shows the default lookThe host name of the brand does not match exactly (with or without www).

Related