I have a project requirement that I just can’t find a way to meet, these are the criteria for a site I’ve been asked to develop:
Need to show one set of prices to non-logged in users and offer to show a ‘discounted prices’ to users prepared to register hand over their email address.
The site will have hundreds of products with multiple prices (not a blanket discount) and those prices need to be updated frequently and easily.
I’ve tried to do this with Joomla (1.5.15) and Virtuemart (1.1.4 stable) but I can meet one criteria or the other not both, because although Virtuemart will allow the different prices to be set up in different ‘shopper groups’, new users are automatically put into the defult shopper group and therefore see the normal prices even though they’re registered. You have to manually add them to the discounted shopper group for them to see the discounted prices and that’s not good enough, it needs to happen automatically.
If there were a way to assign new users to specific shopper groups in Virtuemart the job would be in the bag but it’s really looking like there isn’t a way to do this.
So, can someone either help me figure out how to meet the requirements with shareware plugin type software or any PHP programmers out there who want to write a plugin for Virtuemart that would do this would get a serious amount of downloads I think.
Add a few lines of code to whatever processes the registration form, to go update the database and change the user’s “shopper group”. Whatever Virtuemart does when you manually change someone’s group, you do that yourself directly.
I haven’t used Virtuemart, no. But you can probably figure it out by looking at the database for some kind of column on the user table that corresponds to a group. Or look at the code that the “change shopper group” page runs.
I don’t want to hire someone, it’s only a couple of lines you said, I’d do it for someone else if I knew how. If I’d realised that I needed to pay for this I’d have gone to elancers but my very ignorance of this area led me to here first.
Since this thread is ranking on the first page of Google for the phrase “virtuemart hack/code assign users to specific shopper groups” and I actually managed to find a solution I thought I’d post it for other people to find in the future. This may not be the only solution but it seems to work and doesn’t seem to break anything else going on in the process.
I’m using Joomla 1.5.15 and Virtuemart 1.1.4 (stable) in ‘Catalogue’ mode but with prices enabled. I don’t know if this would work if VM was configured differently but I don’t see why not, this only should affect that one shopper group.
The problem was one of overiding the assignment of a new user to the default shopper group in virtuemart and instead assign them to one I’d created myself. Virtuemart seems to assign a shopper group ID of ‘7’ to the first custom shopper group created so you need to tell the registration process to assign new users to group 7.
The file that needs to be changed is ps_shopper.php and it can be found in admin/components/com_virtuemart/classes