therealworld / specialcustomer-module
Customers can tell you are 'special' during signup. The OXID7 shop merchant then receives an email and can start further manual actions.
Package info
bitbucket.org/therealworld/specialcustomer-module
Type:oxideshop-module
pkg:composer/therealworld/specialcustomer-module
Requires
- php: ^8.3
- oxid-esales/oxideshop-ce: >=v7.4
- therealworld/tools-plugin: >=v3.2
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Deutsche Fassung: README.de.md

description
Adds a checkbox to the customer registration and to the checkout (with or without account) with which a customer can say they are a "special" customer and ask for additional rights. When the box is ticked, the shop operator receives an e-mail and decides by hand what to do with the account (e.g. assign a customer group).
- Composer package:
therealworld/specialcustomer-module - OXID module id:
trwspecialcustomer
Requirements and installation
- OXID eShop CE
>= 7.4, PHP^8.3 therealworld/tools-plugin>= 3.2
composer require therealworld/specialcustomer-module
vendor/bin/oe-console trw:module:setup trwspecialcustomer
trw:module:setup comes with therealworld/clirun-plugin; without it use
oe:module:install vendor/therealworld/specialcustomer-module and
oe:module:activate trwspecialcustomer. The module has no database tables and no migration.
Configuration
Extensions > Modules > the-real-world - Special customer > Settings
| Setting (admin) | Name | Default | Effect |
|---|---|---|---|
| Activate additional checkbox in the checkout | boolTRWSpecialCustomerActive | on | Shows the checkbox |
| Text for the checkbox in the registration process | aarrTRWSpecialCustomerCheckbox | de => Ich bin ein besonderer Kunde, …, en => I am a special customer, please enable additional rights | Label of the checkbox |
| Text for the help text on the checkbox in the registration process | aarrTRWSpecialCustomerCheckboxHelp | de => Der Shopbetreiber wird …, en => The shop merchant will be informed by e-mail and will contact you. | Hint below the checkbox; empty means no hint |
| Text for notification email - Subject | aarrTRWSpecialCustomerEMailSubject | en => The customer with the email address %s is requesting additional rights. (de likewise) | Subject of the notification |
| Text for notification email - Text | aarrTRWSpecialCustomerEMailText | same as the subject | Body of the notification |
The four text settings are lists of language abbreviation => text (de => …, en => …). Add
a line for every active shop language — a language without a line gets an empty text. In subject
and body %s is replaced by the customer's e-mail address.
Behaviour
- The checkbox appears below the newsletter checkbox in three places: on the registration page
(
cl=register) and in the checkout step "address" (cl=user) both when opening an account and for a guest order. Fieldsets:form/fieldset/user_account.html.twig(blockuser_account_newsletter) andform/fieldset/user_noaccount.html.twig(blockuser_noaccount_newsletter). - When the account (or the guest customer) is created with the box ticked, the module sends a mail to the shop's info e-mail address (Master Settings > Core Settings), with the customer's address as reply-to. The subject is converted to plain text.
Nothing is stored at the customer: the mail is the only trace. What happens next (customer group, price group, activation) is up to the operator.
The mail goes out once per created customer; logging in or changing the address later does not send it again.
Limits
- With private sales enabled, OXID does not log the new customer in after registration, so no mail is sent.
- The mail is sent through OXID's
sendContactMail(); there is no own mail template.
For developers
- Chain extensions:
Application\Component\UserComponent(afterLogin()sends the mail when the request parameterbtrwspecialcustomer=1is set —createUser()callsafterLogin()once after a successful registration, oncl=registeras well as in the checkout),Application\Controller\UserController(template parameterisSpecialCustomerCheck, gettersgetSpecialCustomerCheckboxText(),getSpecialCustomerCheckboxHelp(); the coreRegisterControllerextendsUserControllerand inherits them),Application\Model\User(adds theDataGettertrait). - Templates:
@trwspecialcustomer/frontend/trwspecialcustomer_checkout.html.twig(the checkbox), included through the theme extensions ofform/fieldset/user_account.html.twigandform/fieldset/user_noaccount.html.twig. - Helper:
Core\SpecialCustomerHelper::getSpecialCustomerConfigText()reads a text setting for the current language and fills in%s.