By Paul Murray on Wednesday, 30 August 2017
Posted in General Issues
Likes 0
Views 820
Votes 0
Hello Si Team

Honestly I do not really understand my own question.
Here is what I posted in the Hika Forum and here is the reply...
Maybe you want to skip to the end and see the Reply from Nicloas from Hika Shop....

Hika Forum my question:

Hello Hika Shop

This is I guess a kind of pre sales question.
As of now I have a workflow where I
a) Use Hikashop as a store front to display products in conjunction with Easy Social.
http://www.finalbug.net/paul-david-murray/233-course-list
b) Have a plugin that takes a customer from the product to a reseller.
github.com/DeligenceTechnologies/DT-Fast...Payment-for-HikaShop
c) Confirms that the product has been paid for at the resellers end in the Hika Shop Component.

The product I am selling is access to a password protected (Easy Social / NOT Joomla) group such as this here:

http://www.finalbug.net/groups-learn-post-produ...x-foundations-videos

One of the functions of the reseller is to send a email where I can insert a password from a list of e.g. 100 pre defined passwords.
I can generate passwords here for e.g.:
http://www.random.org/

I can then insert the passwords in my site using this component here:
http://www.jlexart.com/jlex-block

I am wondering if there is maybe a more elegant way of doing this with for e.g.:

http://www.hikashop.com/extensions/hikaserial.html

If so could you kindly point me in the right direction.

thanks

Paul


Hika Forum anser from Nicolas:

Hi,

HikaSerial can indeed add a serial automatically to the email/order upon confirmation of the payment. And that serial can be used with the "consume" page of HikaSerial to add a user group to the user and grant him access to some place of your website restricted to that user group. Now the user group consume plugin of HikaSerial which does that adds standard Joomla user groups.
If you wanted instead for HikaSerial to add a Easysocial user group to the user upon serial consumption, it would require the development of a small consume plugin to do that:
http://www.hikashop.com/support/documentation/1...html#consumer_plugin
It's not necessarily complex to do. If you're a developer and EasySocial can tell you how to add an EasySocial user group to a user, it should be a walk in the park.


The last sentence is the important one:

If you're a developer and EasySocial can tell you how to add an EasySocial user group to a user, it should be a walk in the park.


What does a developer need to know from a Stackideas perspective to get this to work?

thanks

Paul
Hey Paul,

I am not quite sure I understand you here, basically what you trying to achieve here?

Is it you would like to do some of the restriction for certain Easysocial profile type user can able to sell the product?
·
Wednesday, 30 August 2017 15:32
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey Arlex

My question is what is the trigger that assigns a Easy Social User Group to a User?
The reason why I am asking is that I want to figure out a way to put:
Easy Social User ABC who has purchased product DEF via Hika Shop into Easy Social Group GHI.

Most of this stuff means nothing to me but here are examples here of where the trigger could be inserted

https://www.hikashop.com/support/documentation/125-hikaserial-developer.html#consumer_plugin

hope this makes sense

all the best

Paul
·
Thursday, 31 August 2017 01:52
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey Paul,

I think you should be looking at the triggers within Hikashop when a person purchases something. Assigning a user into an EasySocial group is pretty simple,

[gist]
$group = ES::group($groupId);
$group->createMember($user->id, true);
[/gist]
·
Friday, 01 September 2017 14:46
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey Mark

Thanks for this. Greatly appreciated.

And lets just imagine that I wanted to go one level deeper.

Is it possible as of ES 2.1 to assign a user to a “n-level” = a category within a group.

I am guessing as of now no?

best

Paul
·
Friday, 01 September 2017 16:23
·
0 Likes
·
0 Votes
·
0 Comments
·
Ah unfortunately that is not possible
·
Friday, 01 September 2017 22:21
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey Mark

Thanks all the same.
This is already a huge help.

all the best

Paul
·
Saturday, 02 September 2017 01:27
·
0 Likes
·
0 Votes
·
0 Comments
·
You're welcome Paul.
·
Saturday, 02 September 2017 12:11
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi SI Team

Stupid question.
Do I need to have a particular group type to get the above to work after plugin customisation from a developer

e.g.:

Open Group
OR
Open Group (Require Moderation to join)
OR
Closed Group
OR
Invite Only Group

thanks

Paul
·
Monday, 11 September 2017 19:14
·
0 Likes
·
0 Votes
·
0 Comments
·
Not really sure about your question here Paul
·
Monday, 11 September 2017 21:45
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Mark

Yes, sorry my question was very unclear.
It should have been.
Having got a developer to make a plugin that puts the purchaser (ES User) of Hika product ABC into an ES Group using:

The above code placed in the following or similar:

https://www.hikashop.com/support/documentation/62-hikashop-developer-documentation.html#order


$group = ES::group($groupId);
$group->createMember($user->id, true);


Does it matter what "type" of group the trigger puts the ES User in.

I have tested this for all groups other than Open and this works!

thanks

Paul
·
Tuesday, 12 September 2017 03:22
·
0 Likes
·
0 Votes
·
0 Comments
·
Nope, any group type also can use this createMember() method.

The different between group type using this method is :

Open Group - user can directly join into the group without under moderation
Open Group (require moderation to join) - when the user join this group, they have to wait for group owner/admin to approve it
Closed Group - when the user join this group, they have to wait for group owner/admin to approve it
Invite Group - when the user join this group, they have to wait for group owner/admin to approve it
·
Tuesday, 12 September 2017 11:42
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Arlex

Nope, any group type also can use this createMember() method.


Yep that is what I figured.

thanks

Paul
·
Tuesday, 12 September 2017 13:30
·
0 Likes
·
0 Votes
·
0 Comments
·
May i know do you still have any issue with this?
·
Tuesday, 12 September 2017 16:01
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Arlex

I can hardly believe this myself but every thing is working as expected.
Once a users (Hika Shop) purchase is confirmed they are out in an ES group.
I can hardly believe it myself.

thanks as always

Paul
·
Wednesday, 13 September 2017 03:37
·
0 Likes
·
0 Votes
·
0 Comments
·
Glad to heard your issue resolved Paul

As a gentle reminder, kindly start a new thread if you have any other issue in the future so it will be easier for us to manage your inquiry. I will lock and mark this thread as resolved.
·
Wednesday, 13 September 2017 10:21
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post