Creating custom seller account fields in MultiMerch

Since we don't have a feature in MultiMerch that would allow the store owner to define custom seller account fields, here's a quick tutorial on adding them manually in about 5 simple steps. A separate vQmod xml file is included in the end of the tutorial - use it instead of overwriting MultiMerch and OpenCart core files!

Let's say we want add a new text field called Phone to make it possible for our sellers to specify their phone number and display it in their profile.

1. Modifying the database

First we need to modify the database to include our new field. MultiMerch stores seller information in the ms_seller table, so we'll use phpMyAdmin to create the new field. Alternatively, we can also do it manually by using the following SQL command:

ALTER TABLE ms_seller ADD phone VARCHAR(35) NOT NULL ;

In case we ever want to reinstall MultiMerch and want this field to get created automatically during installation, we'll need to modify MultiMerch installation model and add our new field to the ms_seller CREATE statement:

admin/model/multiseller/install.php ~65

CREATE TABLE " . DB_PREFIX . "ms_seller (
seller_id int(11) NOT NULL AUTO_INCREMENT,
commission_id int(11) DEFAULT NULL,
PRIMARY KEY (seller_id)) default CHARSET=utf8");

This will create the new phone field will be created when MultiMerch is installed.

2. Adding the new field to the seller model

We've modified the database, but MultiMerch doesn't know about it yet, so we need to modify the seller model to read and write information to our new field.

There are 4 functions we're interested in: getSeller, getSellers, createSeller & editSeller. We simply add the new field to all of the functions:


public function getSeller($seller_id, $data = array()) {
$sql = "SELECT CONCAT(c.firstname, ' ', c.lastname) as name, as '',
ms.seller_id as 'seller_id', as '',
public function getSellers($data = array(), $sort = array(), $cols = array()) {
$sql = "SELECT
// default columns
." CONCAT(c.firstname, ' ', c.lastname) as '', as '', as '',
public function createSeller($data) {
$sql = "INSERT INTO " . DB_PREFIX . "ms_seller
SET seller_id = " . (int)$data['seller_id'] . ",
nickname = '" . $this->db->escape($data['nickname']) . "',
phone = '" . (isset($data['phone']) ? $this->db->escape($data['phone']) : '') . "',
public function editSeller($data) {
$sql = "UPDATE " . DB_PREFIX . "ms_seller
SET description = '" . $this->db->escape($data['description']) . "',
nickname = '" . $this->db->escape($data['nickname']) . "',
phone = '" . (isset($data['phone']) ? $this->db->escape($data['phone']) : '') . "',

That's it! MultiMerch now knows about our new field and will store and retrieve the new data from the database.

3. Displaying the field in the account template

We can now proceed to modifying the seller account template to tell our sellers about the new phone field they can use. We'll add the new phone field before the company field.

catalog/view/theme/default/template/multiseller/account-profile.tpl ~60

As you can see, we're using language variables $ms_account_sellerinfo_phone and $ms_account_sellerinfo_phone_note to display field name and description. Let's add them to our language file:

catalog/language/english/multiseller/multiseller.php ~420

$_['ms_account_sellerinfo_phone'] = 'Phone';
$_['ms_account_sellerinfo_phone_note'] = 'Your phone number (optional)';
$_['ms_account_sellerinfo_company'] = 'Company';
$_['ms_account_sellerinfo_company_note'] = 'Your company (optional)';

Try refreshing the seller profile account page now – the new field should be visible.

4. Adding some validation to the account controller

Now let's add just a little validation. OpenCart (and MultiMerch) follows the MVC pattern that uses controllers to pass data from template to models. MultiMerch uses the jxSaveSellerInfo function in the account-profile.php controller to perform things like form validation, so we'll modify it a little.

catalog/controller/seller/account-profile.php ~90

if (mb_strlen($data['seller']['phone']) > 35 ) {
$json['errors']['seller[phone]'] = $this->language->get('ms_error_sellerinfo_phone_length');
if (mb_strlen($data['seller']['company']) > 50 ) {

We'll also add the error message to the language file to make it translatable.

catalog/language/english/multiseller/multiseller.php ~237

$_['ms_error_sellerinfo_phone_length'] = 'Phone number cannot be longer than 35 characters';
$_['ms_error_sellerinfo_company_length'] = 'Company name cannot be longer than 50 characters';

This simple check will warn the seller if he tries to enter too much information in the phone field. You can use any of the phone number regular expressions available in the web instead for a more advanced validation.

5. Showing the new data in the public seller profile

Now our sellers can specify their phone number, so let's display it on their profile in store.

catalog/controller/seller/catalog-seller.php ~233

$this->data['seller']['phone'] = $seller[''];
$this->data['seller']['nickname'] = $seller['ms.nickname'];

catalog/view/theme/default/template/multiseller/catalog-seller-profile.tpl ~71

  • catalog/language/english/multiseller/multiseller.php ~658

    $_['ms_catalog_seller_profile_phone'] = 'Phone:';
    $_['ms_catalog_seller_profile_company'] = 'Company:';

    That's pretty much it! Your sellers can now specify their phone number and display it in their public profile.

    You can use this guide to create all kinds of extra seller fields until we implement a separate feature to do this. Also, we strongly suggest you use vQmod to keep the changes out of Multimerch core files so that you don't lose them during upgrade. For this matter, we've created a ready-made vQmod file based on this tutorial for you to use – grab it here!

    P.S. We also have our very own MultiMerch Community Forums - drop by and share your thoughts about this article and the rest of MultiMerch!

    Build a multi vendor marketplace with MultiMerch

    Martin Boss

    Martin is the founder of MultiMerch, an ex-OpenCart developer and an e-commerce enthusiast.You can also find him on LinkedIn, Twitter and Quora.