Jump to content

Force login before adding products to the cart


Recommended Posts

I have an issue with people getting discounts on non-discounted products. This is how its setup as of now. I have different groups in the members categories and they get different levels of discounts to match their status. However some of my products I dont want anyone to have a discount on and that causes a few issues. I'm currently getting around it by doing different products for the same article to match the price which I really dont like doing but as of now its the only way I can see. The problem that I have is that people add their products to the cart before they login and therefor gets their discount anyway.

 

As I see it if I could force a login before people can add products to the cart that would solve everything and resolve that issue. Anyone knows if thats possible and where I can do this?

 

Thanks in advance for any help

Link to comment
Share on other sites

While I do not agree in principle that a visitor has to login to be able to add items to cart, here is a module that will do what you want :)

 

It requires that a specific controller is not already overridden (don't worry if this does not make sense), and will give an error during installation if it finds that to be the case.

 

It is compatible with PS versions 1.4 and 1.5, may also be compatible with version 1.3 but I don't have a 1.3 installation handy to test. If you are running a version earlier than 1.4 let me know and I'll see what I can do.

 

Screenshots

Module

On "Add to cart"

 

SHA-256 : 9ABBFF8D9BC46A2593238FDE5514A5BE75835CA46B4B4D985FD9D84AEE4D3516

MD5 : 7E49F9266FCD6449475E70F566B4D541

 

Module icon by famfamfam

requirelogin.zip

Link to comment
Share on other sites

The problem is that when you are not logged in you are classified as default and all products priced accordingly and that's all correct. When you log in you get the appropriate discount and that is all correct as well. This is applied to all products regardless what they are in the store.

 

Here is the problem. I do have some products that I do a campaign on that I want to be the same for everyone and thats when the problem occurs for me. There are no way to exclude a single product from a certain groups discount and therefore I need to compensate the price to match their discount and that forces me to create a separate product for each discounted group and that is doable even though I dont like it. The loophole in presta that causes the issue is that if you are not logged in to the system and add the product to your cart you have the default category's price and once you do log in your discount does apply to it instantly. That is the whole problem

Link to comment
Share on other sites

  • 3 years later...

Hi,

 

This is what I have been looking for!

 

I installed it on 1.6.0.9 and it almost works perfectly except that if the user is not logged in and they click "add to cart", no message is displayed to tell them that they need to login...

 

Any chance of providing this function?

 

Thanks

 

Regards

Greg

Link to comment
Share on other sites

  • 3 months later...

Hi,

 

This is what I have been looking for!

 

I installed it on 1.6.0.9 and it almost works perfectly except that if the user is not logged in and they click "add to cart", no message is displayed to tell them that they need to login...

 

Any chance of providing this function?

 

Thanks

 

Regards

Greg

 

Any idea how to force the login or registration when the user try to add a product to the cart ?

 

Thx

Link to comment
Share on other sites

  • 2 years later...
  • 2 years later...

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