how to disable shop function *after* order?

  • Posts: 79
  • Thank you received: 0
9 years 3 weeks ago #219722

-- HikaShop version -- : 2.6.0
-- Joomla version -- : 3.4.3
-- PHP version -- : 5.5.23

Hi,
i have a webshop for invitees only. My shoppers are already registred (by import) and allowed to shop only once. So, i need to disable the access to the shop after they haved shopped.

Perhaps by changing the acl groups after the last step of the checkout process?
for instance by removing the shopper from the shopper group and placing the shopper in the group "has-already-shopped".

Would this be possible?

Please Log in or Create an account to join the conversation.

  • Posts: 26159
  • Thank you received: 4028
  • MODERATOR
9 years 3 weeks ago #219723

Hi,

You can use the plugin "user group after purchase".
You can also use the HikaShop limitation system to create a general limitation.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 79
  • Thank you received: 0
9 years 3 weeks ago #219771

Hi,
is this a hikashop plugin or a third party plugin?

and what do you mean with the limitation system?

Please Log in or Create an account to join the conversation.

  • Posts: 79
  • Thank you received: 0
9 years 3 weeks ago #219777

Hi again,
If you mean the hikashop plugin, how would i *remove* a user from group? I seem to be only able to add the user to a new group?

And... when would this action (group change) take place, after checkout? (otherwise it wouldn't work of course)

Please Log in or Create an account to join the conversation.

  • Posts: 82908
  • Thank you received: 13379
  • MODERATOR
9 years 3 weeks ago #219837

Hi,

I think the best would be to create a mass action via the menu System>Mass actions.
There, you can configure a mass action like that:
take.ms/H2T5Q
So you could move the user from his user group to another user group, and then configure your shop menu items' access to only the former user group. The rest would then be automatic.

Please Log in or Create an account to join the conversation.

  • Posts: 79
  • Thank you received: 0
9 years 3 weeks ago #219851

Hi,
i've just tried this out.

The 'adding to a group' is working properly --> i've placed the user in a "has shopped" group. so, that is fine.

but 'removing' from a group isn't working properly. I need to remove the 'shopper' group but keep all other groups intact. What it actually did, it removed all groups except shopper.

How do i remove a single group (only shopper) and leave the other groups intact? (my users are in different groups)

Last edit: 9 years 3 weeks ago by proo4509.

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
9 years 2 weeks ago #219964

Hi,

This action was not implemented. We could only add a user group or replace all the groups by another one.
But I just added this feature, so please install these plugins on your website and enjoy ;)


File Attachment:

File Name: plg_hikash...user.zip
File Size:4 KB


File Attachment:

File Name: plg_system...tion.zip
File Size:29 KB

Attachments:
Last edit: 9 years 2 weeks ago by Xavier.

Please Log in or Create an account to join the conversation.

  • Posts: 79
  • Thank you received: 0
9 years 2 weeks ago #220021

Hi, i tried this all and I see the groups are changed after order, so this part is working.


So, all groups were removed (shopper and such) the only group left was a registered group.

In my configuration, all webshop functionality is only available for group "shopper".

But... the user (who is no longer in 'shopper') can still access the webshop! Only if he logs out and in again, the rights are changed.
So, how do i force that the change in acl really takes place?

Last edit: 9 years 2 weeks ago by proo4509.

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
9 years 2 weeks ago #220025

Hi,

This version of the plugin will delete the user session and log him out in order to force the use of the new groups and so the new ACLs.

File Attachment:

File Name: plg_hikash...1-09.zip
File Size:4 KB

Attachments:
Last edit: 9 years 2 weeks ago by Xavier.

Please Log in or Create an account to join the conversation.

  • Posts: 79
  • Thank you received: 0
9 years 2 weeks ago #220264

Hello Xavier,

I've been testen with the 3 new plugins:
plg_hikashop_massaction_user.zip
plg_system_hikashopmassaction.zip
plg_hikashop_massaction_user_2015-11-09

What happens,
1) the massaction is performed, so the condition and filter is working
2) it is adding the new group "reeds geshopt"
3) it should remove groups but it is not doing that. It is actually *adding* the groups it should remove
4) it's not logging out the user. The user can actually shop again (my shop is for registered only)

Please Log in or Create an account to join the conversation.

  • Posts: 79
  • Thank you received: 0
9 years 2 weeks ago #220552

Hello Xavier

the biggest issue is that the auto-logout doesn't work after the order.

It stops at the END step of the checkout process and doesn't logout the user. It would be ideal if the system would pauze 2-3 seconds at the END step, then Logout and then switch to a final good-bye page.

So, this part of your last php isn't doing anything:
if(!$app->isAdmin()){
foreach($user_ids as $user_id){
if($user_id != hikashop_loadUser())
continue;
$app->logout( $data->user_cms_id );
}
}

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
9 years 1 week ago #220679

Hi,

My bad, I gave you the new version of the massaction_user plugin instead of the massaction_order one.
And as you are using an order mass action, that couldn't work as expected.

Here is the new version of the massaction order plugin:

File Attachment:

File Name: plg_hikash...rder.zip
File Size:10 KB

Attachments:
Last edit: 9 years 1 week ago by Xavier.

Please Log in or Create an account to join the conversation.

  • Posts: 79
  • Thank you received: 0
9 years 1 week ago #220862

Hi Xavier,

it's still not working:
- adding 1 new group = OK
- removing 1 group = NOT OK (it does nothing)
- logout user after order = NOT OK (it does nothing)

Wouldn't you need a "Force user logout on group update" option for the order-plugin like you have for the group-plugin?

Can perhaps one of the other plugins conflict with my order plugin?

regards
Suzanne

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
9 years 1 week ago #220927

Hi,

The code:

		$app = JFactory::getApplication();
		$config = JFactory::getConfig();
		$handler = $config->get('session_handler', 'none');
		if($handler=='database'){
			$db->setQuery('DELETE FROM '.hikashop_table('session',false).' WHERE client_id=0 AND userid IN ('.implode(',',$user_ids).')');
			$db->query();
		}
		if(!$app->isAdmin()){
			foreach($user_ids as $user_id){
				if($user_id != hikashop_loadUser())
					continue;
				$app->logout( $data->user_cms_id );
			}
		}
should handle the logout.

Does the install of the latest plugin has been done correctly ? No errors returned ?
If it is, please provide a backend and a FTP access via our contact form (with a link to that topic).

Please Log in or Create an account to join the conversation.

  • Posts: 79
  • Thank you received: 0
9 years 1 week ago #221074

I've mailed everything.

Shop is non-public and still in maintenance so you can test.

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
9 years 1 week ago #221141

Hi,

I am not able to log via FTP, please check the sent informations.

Please Log in or Create an account to join the conversation.

  • Posts: 79
  • Thank you received: 0
9 years 1 week ago #221233

i've just send the right hostname (my mistake), but had to reset the password as well, so there's another password too.

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
9 years 1 week ago #221278

Hi,

I just tried with the new FTP informations you give, but I have a timeout when trying to reach the FTP.
Don't you have IP restrictions of things like that ?

Please Log in or Create an account to join the conversation.

  • Posts: 79
  • Thank you received: 0
9 years 1 week ago #221325

In my filezilla config i have to use:
Encryption-> Only use plain FTP

otherwise same problem

Please Log in or Create an account to join the conversation.

  • Posts: 79
  • Thank you received: 0
9 years 1 week ago #221326

BTW, I see some improvements:

the groups are changed now after the order and status of the order also changed.
But, there is still no forced logout after order.

and I've disabled caching totally (also disabled jotcache)

Last edit: 9 years 1 week ago by proo4509.

Please Log in or Create an account to join the conversation.

Time to create page: 0.106 seconds
Powered by Kunena Forum