Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Automatic Vendor Approval Rate Topic   - - - - -

 
  • dynamok
  • Advanced Member
  • Members
  • Join Date: 12-Nov 15
  • 89 posts

Posted 23 March 2016 - 09:18 PM #1

Trying to find anything on automatic vendor approval, have no luck. Is there such a function that I can turn on?

If there isn't, what would be the reason for not having it? Just to check everyone?

Is it an easy fix to add?

 

Thank you



 
  • CS-Cart team
  • CS-Cart support team
  • Moderators
  • Join Date: 04-Apr 11
  • 3800 posts

Posted 24 March 2016 - 06:51 AM #2

Trying to find anything on automatic vendor approval, have no luck. Is there such a function that I can turn on?

If there isn't, what would be the reason for not having it? Just to check everyone?

Is it an easy fix to add?

 

Thank you

 

Pay attention to the Vendor Data Premoderation add-on. You can find the information on it in our Docs:  http://docs.cs-cart....tion/index.html


Sincerely yours, CS-Cart Support Team

 

User guide       |  Developer documentation  |  Core API documentation


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19044 posts

Posted 24 March 2016 - 07:42 AM #3

Do you mean that the Vendor account should not receive Pending status after registration?


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • dynamok
  • Advanced Member
  • Members
  • Join Date: 12-Nov 15
  • 89 posts

Posted 24 March 2016 - 02:18 PM #4

Pay attention to the Vendor Data Premoderation add-on. You can find the information on it in our Docs:  http://docs.cs-cart....tion/index.html

 

This doesn't solve the problem. I want a way for vendors apply for an account and being approved without us looking at it. Is there such thing?



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19044 posts

Posted 24 March 2016 - 02:50 PM #5

Try the following:

 

app/controllers/frontend/companies.php

 

replace:

if (!$result) {
            fn_save_post_data('user_data', 'company_data');
            fn_set_notification('E', __('error'), __('text_error_adding_request'));


            return array(CONTROLLER_STATUS_REDIRECT, 'companies.apply_for_vendor');
}
with
 
if (!$result) {
            fn_save_post_data('user_data', 'company_data');
            fn_set_notification('E', __('error'), __('text_error_adding_request'));


            return array(CONTROLLER_STATUS_REDIRECT, 'companies.apply_for_vendor');
} else {
           fn_companies_change_status($result, 'A', '', 'N');
}

(!) Not tested


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • dynamok
  • Advanced Member
  • Members
  • Join Date: 12-Nov 15
  • 89 posts

Posted 06 April 2016 - 05:09 PM #6

 

Try the following:

 

app/controllers/frontend/companies.php

 

replace:

if (!$result) {
            fn_save_post_data('user_data', 'company_data');
            fn_set_notification('E', __('error'), __('text_error_adding_request'));


            return array(CONTROLLER_STATUS_REDIRECT, 'companies.apply_for_vendor');
}
with
 
if (!$result) {
            fn_save_post_data('user_data', 'company_data');
            fn_set_notification('E', __('error'), __('text_error_adding_request'));


            return array(CONTROLLER_STATUS_REDIRECT, 'companies.apply_for_vendor');
} else {
           fn_companies_change_status($result, 'A', '', 'N');
}

(!) Not tested

 

 

Get this page:

http://screencast.com/t/QqBCsMoB8lf

The vendor registration goes through, but no automatic approval.



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19044 posts

Posted 07 April 2016 - 10:10 AM #7

Please check the source code of this page. Error message should be displayed at bottom


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19044 posts

Posted 19 May 2016 - 08:30 AM #8

The correct solution is:

if (!$result) {
            fn_save_post_data('user_data', 'company_data');
            fn_set_notification('E', __('error'), __('text_error_adding_request'));


            return array(CONTROLLER_STATUS_REDIRECT, 'companies.apply_for_vendor');
} else {
           $status_from = 'N';
           fn_companies_change_status($result, 'A', '', $status_from);
}

also it is required to open the app/functions/fn.users.php file and replace:

'user_type' => 'C', // FIXME?

with

'user_type' => (!empty($user_data['user_type']) && $user_data['user_type'] != 'A') ? $user_data['user_type'] : 'C',

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • Vivek Gupta
  • Senior Member
  • Members
  • Join Date: 09-Jul 15
  • 247 posts

Posted 19 May 2016 - 11:06 AM #9

Tested Sure it will help

 

Go To: [CScart root]/app/controllers/frontend/companies.php

 

& replace all code with this :

<?php
/***************************************************************************
*                                                                          *
*   (c) 2004 Vladimir V. Kalynyak, Alexey V. Vinokurov, Ilya M. Shalnev    *
*                                                                          *
* This  is  commercial  software,  only  users  who have purchased a valid *
* license  and  accept  to the terms of the  License Agreement can install *
* and use this program.                                                    *
*                                                                          *
****************************************************************************
* PLEASE READ THE FULL TEXT  OF THE SOFTWARE  LICENSE   AGREEMENT  IN  THE *
* "copyright.txt" FILE PROVIDED WITH THIS DISTRIBUTION PACKAGE.            *
****************************************************************************/

use Tygh\Registry;
use Tygh\Mailer;

if (!defined('BOOTSTRAP')) { die('Access denied'); }

if ($_SERVER['REQUEST_METHOD'] == 'POST') {

    if ($mode == 'apply_for_vendor') {

        if (Registry::get('settings.Vendors.apply_for_vendor') != 'Y') {
            return array(CONTROLLER_STATUS_NO_PAGE);
        }

        if (fn_image_verification('apply_for_vendor_account', $_REQUEST) == false) {
            fn_save_post_data('user_data', 'company_data');

            return array(CONTROLLER_STATUS_REDIRECT, 'companies.apply_for_vendor');
        }

        $data = $_REQUEST['company_data'];

        $data['timestamp'] = TIME;
        $data['status'] = 'N';
        $data['request_user_id'] = !empty($auth['user_id']) ? $auth['user_id'] : 0;

        $account_data = array();
        $account_data['fields'] = isset($_REQUEST['user_data']['fields']) ? $_REQUEST['user_data']['fields'] : '';
        $account_data['admin_firstname'] = isset($_REQUEST['company_data']['admin_firstname']) ? $_REQUEST['company_data']['admin_firstname'] : '';
        $account_data['admin_lastname'] = isset($_REQUEST['company_data']['admin_lastname']) ? $_REQUEST['company_data']['admin_lastname'] : '';
        $data['request_account_data'] = serialize($account_data);

        if (empty($data['request_user_id'])) {
            $login_condition = empty($data['request_account_name']) ? '' : db_quote(" OR user_login = ?s", $data['request_account_name']);
            $user_account_exists = db_get_field("SELECT user_id FROM ?:users WHERE email = ?s ?p", $data['email'], $login_condition);

            if ($user_account_exists) {
                fn_save_post_data('user_data', 'company_data');
                fn_set_notification('E', __('error'), __('error_user_exists'));

                return array(CONTROLLER_STATUS_REDIRECT, 'companies.apply_for_vendor');
            }
        }

        $company_id = fn_update_company($data);

        $data = array_merge($data, fn_get_company_data($company_id));

        if (!$company_id) {
            fn_save_post_data('user_data', 'company_data');
            fn_set_notification('E', __('error'), __('text_error_adding_request'));

            return array(CONTROLLER_STATUS_REDIRECT, 'companies.apply_for_vendor');
        }

        $status_from = 'N';
        fn_change_company_status($company_id, 'A','', $status_from);

        // Notify user department on the new vendor application
        Mailer::sendMail(array(
            'to' => 'default_company_users_department',
            'from' => 'default_company_users_department',
            'data' => array(
                'company_id' => $company_id,
                'company' => $data
            ),
            'tpl' => 'companies/apply_for_vendor_notification.tpl',
        ), 'A', Registry::get('settings.Appearance.backend_default_language'));
        
        $return_url = !empty(Tygh::$app['session']['apply_for_vendor']['return_url']) ? Tygh::$app['session']['apply_for_vendor']['return_url'] : fn_url('');
        unset(Tygh::$app['session']['apply_for_vendor']['return_url']);

        return array(CONTROLLER_STATUS_REDIRECT, $return_url);
    }
}

if (fn_allowed_for('ULTIMATE')) {
    if ($mode == 'entry_page') {
        $countries = array();

        $companies_countries = db_get_array('SELECT storefront, countries_list FROM ?:companies');
        foreach ($companies_countries as $data) {
            if (empty($data['countries_list'])) {
                continue;
            }
            $_countries = explode(',', $data['countries_list']);
            foreach ($_countries as $code) {
                $countries[$code] = strpos($data['storefront'], 'http://') === false ? 'http://' . $data['storefront'] : $data['storefront'];
            }
        }

        $country_descriptions = fn_get_countries_name(array_keys($countries));

        Tygh::$app['session']['entry_page'] = true;

        Tygh::$app['view']->assign('countries', $countries);
        Tygh::$app['view']->assign('country_descriptions', $country_descriptions);
        Tygh::$app['view']->display('views/companies/components/entry_page.tpl');

        exit;
    }
}

if ($mode == 'view') {

    $company_data = !empty($_REQUEST['company_id']) ? fn_get_company_data($_REQUEST['company_id']) : array();

    if (empty($company_data) || empty($company_data['status']) || !empty($company_data['status']) && $company_data['status'] != 'A') {
        return array(CONTROLLER_STATUS_NO_PAGE);
    }

    fn_add_breadcrumb(__('all_vendors'), 'companies.catalog');
    fn_add_breadcrumb($company_data['company']);

    $company_data['total_products'] = count(db_get_fields(fn_get_products(array(
        'get_query' => true,
        'company_id' => $_REQUEST['company_id']
    ))));

    $company_data['logos'] = fn_get_logos($company_data['company_id']);

    Registry::set('navigation.tabs', array(
        'description' => array(
            'title' => __('description'),
            'js' => true
        )
    ));

    $params = array(
        'company_id' => $_REQUEST['company_id'],
    );

    Tygh::$app['view']->assign('company_data', $company_data);

} elseif ($mode == 'catalog') {

    fn_add_breadcrumb(__('all_vendors'));

    $params = $_REQUEST;
    $params['status'] = 'A';
    $params['get_description'] = 'Y';

    $vendors_per_page = Registry::get('settings.Vendors.vendors_per_page');
    list($companies, $search) = fn_get_companies($params, $auth, $vendors_per_page);

    foreach ($companies as &$company) {
        $company['logos'] = fn_get_logos($company['company_id']);
    }

    Tygh::$app['view']->assign('companies', $companies);
    Tygh::$app['view']->assign('search', $search);

} elseif ($mode == 'apply_for_vendor') {

    if (Registry::get('settings.Vendors.apply_for_vendor') != 'Y') {
        return array(CONTROLLER_STATUS_NO_PAGE);
    }

    $restored_company_data = fn_restore_post_data('company_data');
    if ($restored_company_data) {
        Tygh::$app['view']->assign('company_data', $restored_company_data);
    }

    $restored_user_data = fn_restore_post_data('user_data');
    if ($restored_user_data) {
        Tygh::$app['view']->assign('user_data', $restored_user_data);
    }

    $profile_fields = fn_get_profile_fields('A', array(), CART_LANGUAGE, array('get_custom' => true, 'get_profile_required' => true));

    Tygh::$app['view']->assign('profile_fields', $profile_fields);
    Tygh::$app['view']->assign('countries', fn_get_simple_countries(true, CART_LANGUAGE));
    Tygh::$app['view']->assign('states', fn_get_all_states());

    fn_add_breadcrumb(__('apply_for_vendor_account'));

    Tygh::$app['session']['apply_for_vendor']['return_url'] = !empty($_REQUEST['return_previous_url']) ? $_REQUEST['return_previous_url'] : fn_url('');

} elseif ($mode == 'products') {
    $company_data = !empty($_REQUEST['company_id']) ? fn_get_company_data($_REQUEST['company_id']) : array();

    if (empty($company_data)) {
        return array(CONTROLLER_STATUS_NO_PAGE);
    }

    $company_id = $company_data['company_id'];

    fn_add_breadcrumb(__('all_vendors'), 'companies.catalog');

    $params = $_REQUEST;

    $params['company_id'] = $company_id;
    $params['extend'] = array('description');

    if (!empty($_REQUEST['category_id'])) {
        fn_add_breadcrumb($company_data['company'], 'companies.products?company_id=' . $company_id);

        $category_id = $_REQUEST['category_id'];
        // Get full data for current category
        $category_data = fn_get_category_data($category_id);

        if (!empty($category_data)) {
            $params['cid'] = $category_id;
            if (Registry::get('settings.General.show_products_from_subcategories') == 'Y') {
                $params['subcats'] = 'Y';
            }

            // [Breadcrumbs]
            $parent_ids = explode('/', $category_data['id_path']);
            array_pop($parent_ids);

            if (!empty($parent_ids)) {
                $cats = fn_get_category_name($parent_ids);
                foreach ($parent_ids as $c_id) {
                    fn_add_breadcrumb($cats[$c_id], "companies.products?category_id=$c_id&company_id=$company_id");
                }
            }
            fn_add_breadcrumb($category_data['category']);
        }

        // Get subcategories list for current category
        Tygh::$app['view']->assign('subcategories', fn_get_subcategories(
            $category_id, array('company_ids' => $company_data['company_id'])
        ));
        Tygh::$app['view']->assign('category_data', $category_data);
        Tygh::$app['view']->assign('reset_url', fn_url('companies.products?category_id=' . $category_id . '&company_id=' . $company_id));

    } else {
        if (!empty($_REQUEST['q'])) {
            fn_add_breadcrumb($company_data['company'], 'companies.products?company_id=' . $company_id);
            fn_add_breadcrumb(__('search'));
        } else {
            fn_add_breadcrumb($company_data['company']);
        }
        Tygh::$app['view']->assign('reset_url', fn_url('companies.products?company_id=' . $company_id));
    }

    list($products, $search) = fn_get_products($params, Registry::get('settings.Appearance.products_per_page'));

    if (defined('AJAX_REQUEST') && (!empty($params['features_hash']) && !$products)) {
        fn_filters_not_found_notification();
        exit;
    }

    fn_gather_additional_products_data($products, array('get_icon' => true, 'get_detailed' => true, 'get_additional' => true, 'get_options'=> true));

    if (!empty($products)) {
        Tygh::$app['session']['continue_url'] = Registry::get('config.current_url');
    }

    $selected_layout = fn_get_products_layout($params);

    Tygh::$app['view']->assign('products', $products);
    Tygh::$app['view']->assign('search', $search);
    Tygh::$app['view']->assign('selected_layout', $selected_layout);
    Tygh::$app['view']->assign('company_id', $company_data['company_id']);

    Registry::set('runtime.vendor_id', $company_id);
}


Vivek Gupta 
 


 
  • buging
  • Member
  • Members
  • Join Date: 12-Jan 11
  • 332 posts

Posted 17 October 2016 - 05:29 AM #10

this is really great! Has anyone figured out how to automatically assign a group to the vendor user profile?



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19044 posts

Posted 17 October 2016 - 07:35 AM #11

this is really great! Has anyone figured out how to automatically assign a group to the vendor user profile?

You can use the fn_change_usergroup_status function. E.g.
 

 
if (!$company_id) {
            fn_save_post_data('user_data', 'company_data');
            fn_set_notification('E', __('error'), __('text_error_adding_request'));
 
 
            return array(CONTROLLER_STATUS_REDIRECT, 'companies.apply_for_vendor');
} else {
           fn_companies_change_status($company_id, 'A', '', 'N');
           $users = db_get_fields("SELECT user_id FROM ?:users WHERE user_type = ?s AND company_id = ?i", 'V', $company_id);
           foreach ($users as $uid) {
                fn_change_usergroup_status('A', $uid, USERGROUP_ID);
           }
}

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • buging
  • Member
  • Members
  • Join Date: 12-Jan 11
  • 332 posts

Posted 19 October 2016 - 02:06 PM #12

 

You can use the fn_change_usergroup_status function. E.g.
 

 
if (!$company_id) {
            fn_save_post_data('user_data', 'company_data');
            fn_set_notification('E', __('error'), __('text_error_adding_request'));
 
 
            return array(CONTROLLER_STATUS_REDIRECT, 'companies.apply_for_vendor');
} else {
           fn_companies_change_status($company_id, 'A', '', 'N');
           $users = db_get_fields("SELECT user_id FROM ?:users WHERE user_type = ?s AND company_id = ?i", 'V', $company_id);
           foreach ($users as $uid) {
                fn_change_usergroup_status('A', $uid, USERGROUP_ID);
           }
}

 

Thanks eCOMLabs

 

Do i replace USERGROUP_ID with the name of the group?



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19044 posts

Posted 19 October 2016 - 02:20 PM #13

Thanks eCOMLabs

 

Do i replace USERGROUP_ID with the name of the group?

 

Replace it with user group ID

 

http://prntscr.com/cw9lk3


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • buging
  • Member
  • Members
  • Join Date: 12-Jan 11
  • 332 posts

Posted 24 October 2016 - 12:23 PM #14

 

Tested Sure it will help

 

Go To: [CScart root]/app/controllers/frontend/companies.php

 

& replace all code with this :

<?php
/***************************************************************************
*                                                                          *
*   (c) 2004 Vladimir V. Kalynyak, Alexey V. Vinokurov, Ilya M. Shalnev    *
*                                                                          *
* This  is  commercial  software,  only  users  who have purchased a valid *
* license  and  accept  to the terms of the  License Agreement can install *
* and use this program.                                                    *
*                                                                          *
****************************************************************************
* PLEASE READ THE FULL TEXT  OF THE SOFTWARE  LICENSE   AGREEMENT  IN  THE *
* "copyright.txt" FILE PROVIDED WITH THIS DISTRIBUTION PACKAGE.            *
****************************************************************************/

use Tygh\Registry;
use Tygh\Mailer;

if (!defined('BOOTSTRAP')) { die('Access denied'); }

if ($_SERVER['REQUEST_METHOD'] == 'POST') {

    if ($mode == 'apply_for_vendor') {

        if (Registry::get('settings.Vendors.apply_for_vendor') != 'Y') {
            return array(CONTROLLER_STATUS_NO_PAGE);
        }

        if (fn_image_verification('apply_for_vendor_account', $_REQUEST) == false) {
            fn_save_post_data('user_data', 'company_data');

            return array(CONTROLLER_STATUS_REDIRECT, 'companies.apply_for_vendor');
        }

        $data = $_REQUEST['company_data'];

        $data['timestamp'] = TIME;
        $data['status'] = 'N';
        $data['request_user_id'] = !empty($auth['user_id']) ? $auth['user_id'] : 0;

        $account_data = array();
        $account_data['fields'] = isset($_REQUEST['user_data']['fields']) ? $_REQUEST['user_data']['fields'] : '';
        $account_data['admin_firstname'] = isset($_REQUEST['company_data']['admin_firstname']) ? $_REQUEST['company_data']['admin_firstname'] : '';
        $account_data['admin_lastname'] = isset($_REQUEST['company_data']['admin_lastname']) ? $_REQUEST['company_data']['admin_lastname'] : '';
        $data['request_account_data'] = serialize($account_data);

        if (empty($data['request_user_id'])) {
            $login_condition = empty($data['request_account_name']) ? '' : db_quote(" OR user_login = ?s", $data['request_account_name']);
            $user_account_exists = db_get_field("SELECT user_id FROM ?:users WHERE email = ?s ?p", $data['email'], $login_condition);

            if ($user_account_exists) {
                fn_save_post_data('user_data', 'company_data');
                fn_set_notification('E', __('error'), __('error_user_exists'));

                return array(CONTROLLER_STATUS_REDIRECT, 'companies.apply_for_vendor');
            }
        }

        $company_id = fn_update_company($data);

        $data = array_merge($data, fn_get_company_data($company_id));

        if (!$company_id) {
            fn_save_post_data('user_data', 'company_data');
            fn_set_notification('E', __('error'), __('text_error_adding_request'));

            return array(CONTROLLER_STATUS_REDIRECT, 'companies.apply_for_vendor');
        }

        $status_from = 'N';
        fn_change_company_status($company_id, 'A','', $status_from);

        // Notify user department on the new vendor application
        Mailer::sendMail(array(
            'to' => 'default_company_users_department',
            'from' => 'default_company_users_department',
            'data' => array(
                'company_id' => $company_id,
                'company' => $data
            ),
            'tpl' => 'companies/apply_for_vendor_notification.tpl',
        ), 'A', Registry::get('settings.Appearance.backend_default_language'));
        
        $return_url = !empty(Tygh::$app['session']['apply_for_vendor']['return_url']) ? Tygh::$app['session']['apply_for_vendor']['return_url'] : fn_url('');
        unset(Tygh::$app['session']['apply_for_vendor']['return_url']);

        return array(CONTROLLER_STATUS_REDIRECT, $return_url);
    }
}

if (fn_allowed_for('ULTIMATE')) {
    if ($mode == 'entry_page') {
        $countries = array();

        $companies_countries = db_get_array('SELECT storefront, countries_list FROM ?:companies');
        foreach ($companies_countries as $data) {
            if (empty($data['countries_list'])) {
                continue;
            }
            $_countries = explode(',', $data['countries_list']);
            foreach ($_countries as $code) {
                $countries[$code] = strpos($data['storefront'], 'http://') === false ? 'http://' . $data['storefront'] : $data['storefront'];
            }
        }

        $country_descriptions = fn_get_countries_name(array_keys($countries));

        Tygh::$app['session']['entry_page'] = true;

        Tygh::$app['view']->assign('countries', $countries);
        Tygh::$app['view']->assign('country_descriptions', $country_descriptions);
        Tygh::$app['view']->display('views/companies/components/entry_page.tpl');

        exit;
    }
}

if ($mode == 'view') {

    $company_data = !empty($_REQUEST['company_id']) ? fn_get_company_data($_REQUEST['company_id']) : array();

    if (empty($company_data) || empty($company_data['status']) || !empty($company_data['status']) && $company_data['status'] != 'A') {
        return array(CONTROLLER_STATUS_NO_PAGE);
    }

    fn_add_breadcrumb(__('all_vendors'), 'companies.catalog');
    fn_add_breadcrumb($company_data['company']);

    $company_data['total_products'] = count(db_get_fields(fn_get_products(array(
        'get_query' => true,
        'company_id' => $_REQUEST['company_id']
    ))));

    $company_data['logos'] = fn_get_logos($company_data['company_id']);

    Registry::set('navigation.tabs', array(
        'description' => array(
            'title' => __('description'),
            'js' => true
        )
    ));

    $params = array(
        'company_id' => $_REQUEST['company_id'],
    );

    Tygh::$app['view']->assign('company_data', $company_data);

} elseif ($mode == 'catalog') {

    fn_add_breadcrumb(__('all_vendors'));

    $params = $_REQUEST;
    $params['status'] = 'A';
    $params['get_description'] = 'Y';

    $vendors_per_page = Registry::get('settings.Vendors.vendors_per_page');
    list($companies, $search) = fn_get_companies($params, $auth, $vendors_per_page);

    foreach ($companies as &$company) {
        $company['logos'] = fn_get_logos($company['company_id']);
    }

    Tygh::$app['view']->assign('companies', $companies);
    Tygh::$app['view']->assign('search', $search);

} elseif ($mode == 'apply_for_vendor') {

    if (Registry::get('settings.Vendors.apply_for_vendor') != 'Y') {
        return array(CONTROLLER_STATUS_NO_PAGE);
    }

    $restored_company_data = fn_restore_post_data('company_data');
    if ($restored_company_data) {
        Tygh::$app['view']->assign('company_data', $restored_company_data);
    }

    $restored_user_data = fn_restore_post_data('user_data');
    if ($restored_user_data) {
        Tygh::$app['view']->assign('user_data', $restored_user_data);
    }

    $profile_fields = fn_get_profile_fields('A', array(), CART_LANGUAGE, array('get_custom' => true, 'get_profile_required' => true));

    Tygh::$app['view']->assign('profile_fields', $profile_fields);
    Tygh::$app['view']->assign('countries', fn_get_simple_countries(true, CART_LANGUAGE));
    Tygh::$app['view']->assign('states', fn_get_all_states());

    fn_add_breadcrumb(__('apply_for_vendor_account'));

    Tygh::$app['session']['apply_for_vendor']['return_url'] = !empty($_REQUEST['return_previous_url']) ? $_REQUEST['return_previous_url'] : fn_url('');

} elseif ($mode == 'products') {
    $company_data = !empty($_REQUEST['company_id']) ? fn_get_company_data($_REQUEST['company_id']) : array();

    if (empty($company_data)) {
        return array(CONTROLLER_STATUS_NO_PAGE);
    }

    $company_id = $company_data['company_id'];

    fn_add_breadcrumb(__('all_vendors'), 'companies.catalog');

    $params = $_REQUEST;

    $params['company_id'] = $company_id;
    $params['extend'] = array('description');

    if (!empty($_REQUEST['category_id'])) {
        fn_add_breadcrumb($company_data['company'], 'companies.products?company_id=' . $company_id);

        $category_id = $_REQUEST['category_id'];
        // Get full data for current category
        $category_data = fn_get_category_data($category_id);

        if (!empty($category_data)) {
            $params['cid'] = $category_id;
            if (Registry::get('settings.General.show_products_from_subcategories') == 'Y') {
                $params['subcats'] = 'Y';
            }

            // [Breadcrumbs]
            $parent_ids = explode('/', $category_data['id_path']);
            array_pop($parent_ids);

            if (!empty($parent_ids)) {
                $cats = fn_get_category_name($parent_ids);
                foreach ($parent_ids as $c_id) {
                    fn_add_breadcrumb($cats[$c_id], "companies.products?category_id=$c_id&company_id=$company_id");
                }
            }
            fn_add_breadcrumb($category_data['category']);
        }

        // Get subcategories list for current category
        Tygh::$app['view']->assign('subcategories', fn_get_subcategories(
            $category_id, array('company_ids' => $company_data['company_id'])
        ));
        Tygh::$app['view']->assign('category_data', $category_data);
        Tygh::$app['view']->assign('reset_url', fn_url('companies.products?category_id=' . $category_id . '&company_id=' . $company_id));

    } else {
        if (!empty($_REQUEST['q'])) {
            fn_add_breadcrumb($company_data['company'], 'companies.products?company_id=' . $company_id);
            fn_add_breadcrumb(__('search'));
        } else {
            fn_add_breadcrumb($company_data['company']);
        }
        Tygh::$app['view']->assign('reset_url', fn_url('companies.products?company_id=' . $company_id));
    }

    list($products, $search) = fn_get_products($params, Registry::get('settings.Appearance.products_per_page'));

    if (defined('AJAX_REQUEST') && (!empty($params['features_hash']) && !$products)) {
        fn_filters_not_found_notification();
        exit;
    }

    fn_gather_additional_products_data($products, array('get_icon' => true, 'get_detailed' => true, 'get_additional' => true, 'get_options'=> true));

    if (!empty($products)) {
        Tygh::$app['session']['continue_url'] = Registry::get('config.current_url');
    }

    $selected_layout = fn_get_products_layout($params);

    Tygh::$app['view']->assign('products', $products);
    Tygh::$app['view']->assign('search', $search);
    Tygh::$app['view']->assign('selected_layout', $selected_layout);
    Tygh::$app['view']->assign('company_id', $company_data['company_id']);

    Registry::set('runtime.vendor_id', $company_id);
}

 

the message intended for the admin is displayed to the vendor. How can this be disabled?



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19044 posts

Posted 24 October 2016 - 01:46 PM #15

the message intended for the admin is displayed to the vendor. How can this be disabled?

 

Please clarify your question?


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • buging
  • Member
  • Members
  • Join Date: 12-Jan 11
  • 332 posts

Posted 01 November 2016 - 03:43 AM #16

Please clarify your question?

I'm referring to this default message from cs-cart when new vendor is approved:

 

Notice New administrator account has been successfully created. You can edit the account details now. 



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19044 posts

Posted 01 November 2016 - 07:31 AM #17

I'm referring to this default message from cs-cart when new vendor is approved:

 

Notice New administrator account has been successfully created. You can edit the account details now. 

 

app/functions/fn.companies.php

 

replace 2 lines:

fn_set_notification('N', __('notice'), $msg, 'K');

with

//fn_set_notification('N', __('notice'), $msg, 'K');

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.