Jump to content

Group handling module development


brucedevries

Recommended Posts

I need to allow customers assigned to a specific group to access a product. If they are not in the  group the product should not be displayed.  I need to promote a customer to a group if they purchase a specific product.  I need to promote a customer to a group if their total purchase history exceeds $49.95.  How much to develop this module?

 

http://awardfilms.com/shop

Edited by brucedevries (see edit history)
Link to comment
Share on other sites

Hi Bruce,

If you can live with the restriction that the products of that group of customers are in separate categories, then that's already possible with the current standard PrestaShop.

Go to a category (or create a new one), and there you can restrict the groups that can access that category. If you then hang the products of these customers in this category, then you're done with that.

 

Stays open the point of promoting the customer to the group.

When exactly should the person get promoted? When ordered, when confirmation of payment is in, other?

 

Maybe easiest is to add a trigger to your database, when a purchase is made, the trigger fires and checks for all customers how much each spent already. If more than the 49.95 in total (you can also maybe restrict purchases must be made within the last x months or so) they will get promoted to group x. In the group x definition you can add promotional prices etc.

 

Let me know if this sounds viable,

pascal

  • Like 1
Link to comment
Share on other sites

Hi Bruce,

If you can live with the restriction that the products of that group of customers are in separate categories, then that's already possible with the current standard PrestaShop.

Go to a category (or create a new one), and there you can restrict the groups that can access that category. If you then hang the products of these customers in this category, then you're done with that.

 

Stays open the point of promoting the customer to the group.

When exactly should the person get promoted? When ordered, when confirmation of payment is in, other?

 

Maybe easiest is to add a trigger to your database, when a purchase is made, the trigger fires and checks for all customers how much each spent already. If more than the 49.95 in total (you can also maybe restrict purchases must be made within the last x months or so) they will get promoted to group x. In the group x definition you can add promotional prices etc.

 

Let me know if this sounds viable,

pascal

 

 

Instead of a trigger I would use the hook actionPaymentConfirmation to put some logic

 

For example

public function hookActionPaymentConfirmation($params){
		$order=new Order($params["id_order"]);
		
		$customer = new Customer($order->id_customer);
                $customer->getBoughtProducts()// OR better a custom sql to get the total
                 $total = /*get total*/
		if ($total > 49.95){
			//change customer group....
			$customer->update();
		}
Link to comment
Share on other sites

  • 1 month later...

Hi Bruce,

If you can live with the restriction that the products of that group of customers are in separate categories, then that's already possible with the current standard PrestaShop.

Go to a category (or create a new one), and there you can restrict the groups that can access that category. If you then hang the products of these customers in this category, then you're done with that.

 

Stays open the point of promoting the customer to the group.

When exactly should the person get promoted? When ordered, when confirmation of payment is in, other?

 

Maybe easiest is to add a trigger to your database, when a purchase is made, the trigger fires and checks for all customers how much each spent already. If more than the 49.95 in total (you can also maybe restrict purchases must be made within the last x months or so) they will get promoted to group x. In the group x definition you can add promotional prices etc.

 

Let me know if this sounds viable,

pascal

 

Hi PascalVG,

 

This is useful information. Is it then possible to restrict this special category, so it is only visible when a customer assigned to the special group is logged in? How would I manage that? If I just do as you explain above, the special category is still visible for all other users, but of course if a non-group member tries to access this category, they receive a Not Authorized to view message.

 

I want to remove the category from view, except when someone from that group is logged in. How would I do that?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...