Jump to content

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

Automatically assign registered users to a user group Rate Topic   - - - - -

 
  • lake
  • Member
  • Members
  • Join Date: 05-Nov 12
  • 29 posts

Posted 02 January 2013 - 06:31 AM #1

I read a previous thread dated 2010 asking whether or not it was possible to automatically assign a customer who registers to a user group. This was in regard to V2.

Now that CS3 exists, I'm wondering was that feature added. If so, does anyone know how to do that?

The reason I need this is because I am using Reward Points that only for those who have a registered account.

I am hoping that I don't have to activate each user manually as they register.

We cleared the user database as of 1/1/13 so that we can start fresh. We already had several customers register and purchase products but I see that their reward points were not added to their account. I now have to go in manually and add them.

I am really hoping that I don't have to do this for every customer who registers. I am about to send out a newsletter announcing this new rewards points feature.

Thanks in advance for your assistance.

~ Lake

 
  • johnbol1
  • Never Re
  • Members
  • Join Date: 23-Feb 10
  • 4657 posts

Posted 02 January 2013 - 12:13 PM #2

May or may not help but CS gave me this for v 2.1.4 ages back

John


1) Open the "auth.php" file located in the "controllers/common" directory of your CS-Cart installation.
2) Replace the following part of the code:

if (defined('AJAX_REQUEST') && Registry::get('settings.General.one_page_checkout') == 'Y') {
	$redirect_url = "checkout.checkout";
} elseif (!empty($_REQUEST['return_url'])) {
	$redirect_url = $_REQUEST['return_url'];
}
with this one:

if (in_array(USERGROUP_ID, $_SESSION['auth']['usergroup_ids'])) {
	$redirect_url = "categories.view&category_id=CATEGORY_ID";
} elseif (defined('AJAX_REQUEST') && Registry::get('settings.General.one_page_checkout') == 'Y') {
	$redirect_url = "checkout.checkout";
} elseif (!empty($_REQUEST['return_url'])) {
	$redirect_url = $_REQUEST['return_url'];
}

where USERGROUP_ID is an ID of a created user group and CATEGORY_ID is an ID of a necessary category. In order to get to know a desired user group ID, you should open its editing page (click on the "edit" link of the user group on the "User groups" page of your CS-Cart admin panel) in the new window, the link in your browser address bar will be similar to the following:
http://www.yourdomai...&usergroup_id=3, where 3 is the user group ID. In order to get to know a desired category ID, you should open its editing page (click on its name on the "Categories" page of your CS-Cart admin panel). The link in your browser address bar will be similar to the following: http://www.yourdomai...&category_id=93, where 93 is the ID of the category. It should look as follows (e.g):

if (in_array(3, $_SESSION['auth']['usergroup_ids'])) {
	$redirect_url = "categories.view&category_id=93";
} elseif (defined('AJAX_REQUEST') && Registry::get('settings.General.one_page_checkout') == 'Y') {
	$redirect_url = "checkout.checkout";
} elseif (!empty($_REQUEST['return_url'])) {
	$redirect_url = $_REQUEST['return_url'];
}

and if you dont want it crawled you can do this

Create the "meta.post.tpl" file in the "skins/default_orange/customer/addons/my_changes/hooks/index" directory

{if ($controller == "categories" && $mode == "view" && $category_data.category_id == CATEGORY_ID) || ($controller == "products" && $mode == "view" && $product.main_category == CATEGORY_ID)}
<meta name="robots" content="noindex,nofollow" />
{/if}
where CATEGORY_ID is an ID of the necessary category. It should look as follows (e.g):

{if ($controller == "categories" && $mode == "view" && $category_data.category_id == 93) || ($controller == "products" && $mode == "view" && $product.main_category == 93)}
<meta name="robots" content="noindex,nofollow" />
{/if}

Custom printed hi visibility clothing sale the UK's online hivis safety shop
v4.5.2


 
  • lake
  • Member
  • Members
  • Join Date: 05-Nov 12
  • 29 posts

Posted 02 January 2013 - 03:26 PM #3

Thanks John,

Yes, your post from 2010 was the one that I was referring to. :-) I appreciate you reposting the code modification, but I was hoping that there would be a update in v3.

But maybe there is another way... Is it possible that when a customer registers and then click the user group that it is automatically approved instead of saying pending?

That would at least be helpful in eliminating having to manually approve each one.

Thank you!

 
  • johnbol1
  • Never Re
  • Members
  • Join Date: 23-Feb 10
  • 4657 posts

Posted 02 January 2013 - 03:37 PM #4

This should help
http://forum.cs-cart...oup-membership/

Custom printed hi visibility clothing sale the UK's online hivis safety shop
v4.5.2


 
  • lake
  • Member
  • Members
  • Join Date: 05-Nov 12
  • 29 posts

Posted 02 January 2013 - 03:46 PM #5

Thanks! That was helpful, but it looks like that was for V2. Also sounded like tech support would be able to do the fix for free if I had enough credits... but I am still holding out to find out if V3 included this capability.

Thanks so much for your help John.