Jump to content

Restricting certain products.


Recommended Posts

Hello,

 

Is it possible to restrict customers from buying individual products unless there is a a primary product in cart ?

For example,

I am selling laptops as primary product, and also i provide printers, scanners and other peripherals. Now i want to restrict my customers from buying just the peripherals unless there is a laptop in cart.

 

How do i do this ?

 

Thank you.

 

Regards,

Sharath Bharadwaj

Link to comment
Share on other sites

I don't think there is an easy way to do it.
What you'd probably have to do, would be to override the OPC controller, so that it has a check on the cart products in the _getPaymentMethods() function. If there is no product belonging to the laptops category, then return an error. Given that you use opc of course, otherwise you need to modify OrderController.php

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...