Jump to content

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

Backend Display Of Usergroup Rate Topic   - - - - -

 
  • caseymccune
  • Newbie
  • Trial users
  • Join Date: 16-Oct 15
  • 14 posts

Posted 16 December 2015 - 12:31 AM #1

I am looking for a way to display which user group a customer belongs to.  I need this to show up in two locations. 

One is the customer list page.  I have already added a column and am attempting to insert the user group variable.  Unfortunately nothing I have tried works.

 

Also i need it to display under customer information in the abandoned carts information.  

 

I have tried several variations, none of which have worked.

 

{$user_data.usergroup}

{$usergroup.usergroup}

{$user_data.usergroups}

{$user_data.usergroup_active}

{$usergroups.usergroup}
{$usergroup.usergroup_id}

 

just to name a few.  I would appreciate some guidance here!

 

Thank you in advance.



 
  • galtinbaeva
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 06-Dec 13
  • 3632 posts

Posted 16 December 2015 - 06:49 AM #2

For abandonded carts:

 

Add the following code:

    foreach ($carts_list as $key => $cart_data) {
        $carts_list[$key]['usergroups'] = '';
        if (!empty($cart_data['user_data']) && !empty($cart_data['user_data']['usergroups'])) {
            $usergroups = db_get_fields("SELECT usergroup FROM ?:usergroup_descriptions WHERE usergroup_id IN (?a) AND lang_code = ?s", array_keys($cart_data['user_data']['usergroups']), DESCR_SL);
            $carts_list[$key]['usergroups'] = implode(', ', $usergroups);
        }
    }

just above the following line:
 

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

 

 

in the app/controllers/backend/cart.php.

 

Then replace the following line:

{if $customer.user_data.email}<a href="{"profiles.update?user_id=`$customer.user_id`"|fn_url}" class="underlined">{if $customer.firstname || $customer.lastname}{$customer.lastname} {$customer.firstname}{else}{$customer.user_data.email}{/if}</a>{else}{__("unregistered_customer")}{/if}

with this one:

{if $customer.user_data.email}<a href="{"profiles.update?user_id=`$customer.user_id`"|fn_url}" class="underlined">{if $customer.firstname || $customer.lastname}{$customer.lastname} {$customer.firstname}{else}{$customer.user_data.email}{/if}</a></br>{$customer.usergroups nofilter}{else}{__("unregistered_customer")}{/if}

in the design/backend/templates/views/cart/cart_list.tpl


Simtech Development | sales@simtechdev.com | www.simtechdev.com
CERTIFIED CS-CART PARTNER | LICENSES | DEVELOPMENT | ADD-ONS | DESIGN | UPGRADE

Google Analytics Enhanced Ecommerce - get advanced ecommerce analytics


 
  • galtinbaeva
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 06-Dec 13
  • 3632 posts

Posted 16 December 2015 - 07:02 AM #3

For Customers page in the administrator area, add the following lines:

    foreach ($users as $key => $user) {
        $user_usergroups = array_keys(fn_get_user_usergroups($user['user_id']));
        if (!empty($user_usergroups)) {
            $usergroups = db_get_fields("SELECT usergroup FROM ?:usergroup_descriptions WHERE usergroup_id IN (?a) AND lang_code = ?s", $user_usergroups, DESCR_SL);
        } else {
            $usergroups = array();
        }
        $users[$key]['usergroups'] = implode(', ', $usergroups);
    }

just below the following line:

list($users, $search) = fn_get_users($_REQUEST, $auth, Registry::get('settings.Appearance.admin_elements_per_page'));

in the app/controllers/backend/profiles.php

 

Then replace the following line:

<td class="row-status">{if $user.firstname || $user.lastname}<a href="{"profiles.update?user_id=`$user.user_id`&user_type=`$user.user_type`"|fn_url}">{$user.lastname} {$user.firstname}</a>{else}-{/if}{if $user.company_id}{include file="views/companies/components/company_name.tpl" object=$user}{/if}</td>

with the following one:

<td class="row-status">{if $user.firstname || $user.lastname}<a href="{"profiles.update?user_id=`$user.user_id`&user_type=`$user.user_type`"|fn_url}">{$user.lastname} {$user.firstname}</a>{else}-{/if}</br>{$user.usergroups nofilter}{if $user.company_id}{include file="views/companies/components/company_name.tpl" object=$user}{/if}</td>

in the design/backend/templates/views/profiles/manage.tpl


And do not forget to clear clear the cache before checking the changes.


Simtech Development | sales@simtechdev.com | www.simtechdev.com
CERTIFIED CS-CART PARTNER | LICENSES | DEVELOPMENT | ADD-ONS | DESIGN | UPGRADE

Google Analytics Enhanced Ecommerce - get advanced ecommerce analytics


 
  • caseymccune
  • Newbie
  • Trial users
  • Join Date: 16-Oct 15
  • 14 posts

Posted 16 December 2015 - 07:17 PM #4

Worked perfectly!  Thank you very much!



 
  • galtinbaeva
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 06-Dec 13
  • 3632 posts

Posted 17 December 2015 - 08:51 AM #5

You are welcome!


Simtech Development | sales@simtechdev.com | www.simtechdev.com
CERTIFIED CS-CART PARTNER | LICENSES | DEVELOPMENT | ADD-ONS | DESIGN | UPGRADE

Google Analytics Enhanced Ecommerce - get advanced ecommerce analytics