Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Select group at login with SPPC


MWebb

Recommended Posts

Hi

 

I've installed the separate price per customer contribution and I have managed to create 3 separate groups for customers to select, the problem is that when I go to the log in page to sign up, I don't see an option that allows the user to select which group to belong to. Is there anything that I need to add to a bit of code that will allow me to do this?

 

I'm sure this has been ask before but I can't find anything. If someone can tell me what to do or point me to a post which shows how to do this I will be very grateful.

 

Thanks

Link to comment
Share on other sites

I don't think you understood the question. I would like it so that when a customer registers on the store site they can select which group they belong to. For example I have 3 groups; retail, member of and guest. I would it so that if a customer is a member of a group they can sign in and put in their groups details and then see the member of discount, whereas if a customer is just a regular customer then he would select the guest group and then only see the guest prices.

Link to comment
Share on other sites

Nothing at the moment but I'm planning on (if possible) of having a feature that requires the registration to be confirmed by the admin before continuing, but at the moment when a user registers, there is no option to select a group, it has to be done by the admin at the moment. I would like it so that when the user comes to the registration form he/she can put in details (such as name of group for the member of group) that will allow them to get the discounts of that specific group.

Link to comment
Share on other sites

In either case the admin has to do something.

 

1. requires the registration to be confirmed by the admin

or

2. option to select a group, it has to be done by the admin at the moment

 

so you are ;

 

a. not saving the admin any time at all

and

b. potentially annoying the customer

 

Whatever, that choice is yours. You need to create a dropdown menu populated by the available customer_groups, there is a post in this forum by "spooks" which shows how to create a dropdown menu.

Link to comment
Share on other sites

Well it's what the client wants. The registration to be confirmed by the admin is necessary because as you said earlier, there is nothing stopping the user from selecting a group and getting the discounts for that group.

 

So I assume I put that code for the drop down menu somewhere in either the login.php or the create-account.php

Link to comment
Share on other sites

@@MWebb

 

Well it's what the client wants

 

Your client should have hired a qualified developer that wouldn't have to go into the support forum for help. I understand that sometimes people get stuck, but what you have been asking for help with is pretty simple PHP. Since you are being paid to do that, I am sure you could afford to open a paid support ticket for your answers.

 

 

 

 

Chris

Link to comment
Share on other sites

@@DunWeb

 

I'm fine with most of the stuff on oscommerce (this is my first time using it but I'm gradually working things out on my own), it's just this bit with getting the customer to choose the customer group upon registration that is eluding me. I've got the administrator to accept new logins bit working.

 

I just need to know where to put the code for the customer groups and perhaps maybe what to change to it.

 

PS I am also just an apprentice atm

Link to comment
Share on other sites

This addon is mainly used for retail and wholesale/trade sites. Then there are two different price structures and different products for each group.

 

All customers are classed as retail customers when first registering on the site. The admin is made aware of a potential wholesale/trade customer when a company name is entered when creating an account. These are the only accounts that the admin has to bother about.

 

I am sure doing it your way will create more work for the admin, but as a designer/coder you should be able to figure something out for your client, after all that is what he/she is paying you for. As Chris has said, as you are getting paid for the work, you may well have to sub contract it out to someone who knows what they are doing.

REMEMBER BACKUP, BACKUP AND BACKUP

Link to comment
Share on other sites

Ah ok, so I could (in theory) rename the retail group to say for example guest, which would be the default group and then when a customer registers and puts something into the company boxes and an email is sent to the administrator, he can accept it and the put it into the respective group that isn't guest. Is that what your saying?

Link to comment
Share on other sites

as @@DunWeb said, "hire a a qualified developer" subcontract somebody in freelancer (maybe a Chinnese coder) you can get it done for $10, by a Chinnese coder

Link to comment
Share on other sites

@@MWebb

 

PS I am also just an apprentice atm

 

Then in NO WAY should you be offering osCommerce services. It takes 1-2 years to know osCommerce well enough to offer professional services and also a college degree in website development would be nice as well.

 

@@rabon33

 

as @DunWeb said, "hire a a qualified developer" subcontract somebody in freelancer (maybe a Chinnese coder) you can get it done for $10, by a Chinnese coder

 

You get what you pay for. I would NEVER hire a Chinese coder for anything. (no offense intended to Chinese members)

 

 

 

Chris

Link to comment
Share on other sites

Ah ok, so I could (in theory) rename the retail group to say for example guest, which would be the default group and then when a customer registers and puts something into the company boxes and an email is sent to the administrator, he can accept it and the put it into the respective group that isn't guest. Is that what your saying?

 

Yep, thats the way it was designed to work I think. All new customers are in the default group unless moved by admion. I have only tried this module once, and It didnt do what I wanted as it made other things too complicated so I removed it but I think I am right.

REMEMBER BACKUP, BACKUP AND BACKUP

Link to comment
Share on other sites

New registrations get by default a customer group id of 0. They get the default prices etc to the screen. You can call this group as you like

 

Once someone is registered, admin can add that account to any other group, doesn't matter if "company" field was filled out or not. You could use it however, to let people type in the group they would like to belong to

Link to comment
Share on other sites

@@multimixer

 

Right, after a bit of fiddling around and editing the SPPC files so that they work with the member approval, I have managed to get it so that I can have multiple customer groups and also member approval at the same time. However as it stands at the moment there is no area on the registration form that allows customers to choose which group they would like to belong to.

 

How would I go about adding a section to the registration form that allows users to specify which group they would like to belong to?

Link to comment
Share on other sites

How would I go about adding a section to the registration form that allows users to specify which group they would like to belong to?

 

In create_account.php: You need to query for the available customer groups, push the results into an array, use that array to build a drop down menu and take care that this get written to the DB upon customer sign up in case you want to have that data stored

 

In the DB, table customers, add a field for this

 

In admin/customers.php: you need to query for that field and display in anywhere you want

Link to comment
Share on other sites

Here is the query you can use

 

$customers_group_query = tep_db_query("select customers_group_id, customers_group_name from " . TABLE_CUSTOMERS_GROUPS . " order by customers_group_id ");

while ($customers_groups = tep_db_fetch_array($customers_groups_query)) {
 $customers_groups_array[] = array("id" => $customers_groups['customers_group_id'], "text" => $customers_groups['customers_group_name']);
}

 

Now you can use the $customers_groups_array to create your drop down

Link to comment
Share on other sites

@@multimixer

 

Just to make sure that I have this correct. I need to put that query into create_account.php, then create a drop down menu (in the same file i assume?) that allows the user to select which group they want to be in and then create a field in the database that allows this information to be stored. Am i right?

Link to comment
Share on other sites

Also, I have 2 member groups; "member of" and "retail", these 2 groups (at least the "member of" group) will need details putting in, so that for example the admin can check that the group that the customer is in is a real group, this is to stop people signing up claiming that they are a member of a particular group when they are not and just using it to get discounts. Is it possible to set up a group details section in the registration form as well?

Link to comment
Share on other sites

Yes, you are right in first question

 

Not clear what you mean with the second, visitors will be only able to select one of the existing groups, so they are all "real groups"

 

If you want to collect more info on registration you can do that in create_account.php

Link to comment
Share on other sites

@@multimixer

 

Ok so basically I would like that if a customer wants to belong to the "member of" group, he/she can put in the details of the group that they belong to (say website details etc). The admin would then receive a notification email telling him that this user wants to use the "member of" group discounts and has provided the details of the group that he belongs to (i.e a band), the admin can then check out that band's details to see if it is a real band and not a made up one so that that customer can get the discounts from the "member of" group.

 

It's basically to stop user from applying for a "member of" discount when they don't belong to a band.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...