OSCOMMERCE SUPPORT CALL 702-453-3332

 

Help - Search - Members - Calendar
Full Version: Member's discount
osCommerce Community Support Forums > osCommerce Online Merchant v2.x > Contributions / Add-Ons > Order Total Modules
livefood.no
Hi there, and happy new year!

I need a contribution to our online store.


We run a store where we sell food and other supplies to reptiles and such. We want to give members of an organisation,
Norsk Herpetologisk Forening, 15% off all purchases.
Since reptiles are illegal in Norway, the organisation keep the identity of their members secret.
What we recieve is a list with members no. and postal code (They generate the members no. based on the postal code and a random number) I recon I may get the algoritm they use to generate number if I ask nicely...

So comes the problem:

We need a contribution which allows the customers to check a checkbox if he/she is a member of this organisation.
When checked, they are allowed to enter their members no.
The script will then (hopefully) check the number and postal code against the list as mentioned, or against the algoritm used to generate the number (I believe the latter would be easier).
If this comes back TRUE, it will take 15% off the purchase, else it will give the customer info that the number isn't legit, and tell them to contact us.

I've look in every corner of this forum without luck.
If there is a contribution that can do this, please let me know.

Or please let me know how to work this out myself... I know minimal .php, but are always willing to learn something new.


Morten Mørch
john1890
This is precisely what I'm looking for too!

At the moment, we ask members of Bohemian FC (Dublin) to choose a 10% discount on each item, but this is a clumsy and labour-intensive method for everyone. What you outline would be ideal for our site too, but despite searching extensively I can't find anything that matches this relatively simple scenario!


QUOTE (livefood.no @ Jan 3 2008, 09:25 AM) *
Hi there, and happy new year!

I need a contribution to our online store.
We run a store where we sell food and other supplies to reptiles and such. We want to give members of an organisation,
Norsk Herpetologisk Forening, 15% off all purchases.
Since reptiles are illegal in Norway, the organisation keep the identity of their members secret.
What we recieve is a list with members no. and postal code (They generate the members no. based on the postal code and a random number) I recon I may get the algoritm they use to generate number if I ask nicely...

So comes the problem:

We need a contribution which allows the customers to check a checkbox if he/she is a member of this organisation.
When checked, they are allowed to enter their members no.
The script will then (hopefully) check the number and postal code against the list as mentioned, or against the algoritm used to generate the number (I believe the latter would be easier).
If this comes back TRUE, it will take 15% off the purchase, else it will give the customer info that the number isn't legit, and tell them to contact us.

I've look in every corner of this forum without luck.
If there is a contribution that can do this, please let me know.

Or please let me know how to work this out myself... I know minimal .php, but are always willing to learn something new.
Morten Mørch
hari_shyam
QUOTE (john1890 @ Jan 11 2008, 09:11 PM) *
This is precisely what I'm looking for too!

At the moment, we ask members of Bohemian FC (Dublin) to choose a 10% discount on each item, but this is a clumsy and labour-intensive method for everyone. What you outline would be ideal for our site too, but despite searching extensively I can't find anything that matches this relatively simple scenario!


2 things are being addressed here:
a. check while creation of an account.
you need to find the algorithm for this one and create a simple check along with the code in the bginning of the creat_account.php file.you can find if(action == process ) or similar in the beginning of the file. you can add in the code there for the validation.

b. discount.
you can create an order total line ( a simple one ). when the customer logs in note a flag in a session variable and in order total , offer discount of 15% towards the end during checkout confirmtion. with minimal changes you can also give the discount info in the shipping cart page as well as shopping cart box as well.

Let me know if you need any help

Regards
Hari
livefood.no
QUOTE (hari_shyam @ Jan 27 2008, 01:06 PM) *
2 things are being addressed here:
a. check while creation of an account.
you need to find the algorithm for this one and create a simple check along with the code in the bginning of the creat_account.php file.you can find if(action == process ) or similar in the beginning of the file. you can add in the code there for the validation.

b. discount.
you can create an order total line ( a simple one ). when the customer logs in note a flag in a session variable and in order total , offer discount of 15% towards the end during checkout confirmtion. with minimal changes you can also give the discount info in the shipping cart page as well as shopping cart box as well.

Let me know if you need any help

Regards
Hari


Thank you, Hari.

Although I haven't got a clue on how to do this, I get the general idea.

However, what then if our present customers becomes a member of this organization, after creating an account.
Or customers resigning from this organization.

When I come to think about it, it would maybe be easier to create a database where I manually input the postal codes and membernumbers, and then, in the checkout-process the customer enter his/hers membernumber.
The script then checks the number entered against the database and the customers postal code.
If the code then Comes back true, the order total takes 15% off the purchase.
Since we frequently recieve an updated list, it would perhaps be the easiest way to make sure the customer still is an actual member.

So, a new question:

How can I make the checkout to do a such check to a database?

BTW, does anyone know of a GOOD site where I can learn the basics of .php?
Every site I've tried kinda starts at the guru-level...

Regards,

Morten Mørch
chris thomas
This is the main site for PHP, there is an on-line manual there, with all the commands referenced.

http://www.php.net/

My advice in terms of learning would be to get hold of the O'Reilly books on PHP as they are generally a good refence.

http://www.amazon.co.uk/Programming-PHP-Ra...0570&sr=8-5

http://www.amazon.co.uk/Learning-MySQL-Ste...0570&sr=8-3

Apart from that, its just a case I guess of reading around and getting your hands dirty, trying things out.

The main thing to bear in mind with website coding and PHP, is that generally you'll be picking up session variables i.e.

$customerCountry = 'US'

and using that value to perfom some kind of logic, for instance, apply certain taxes if the customer is from the US. You will then be setting other variables based on this logic, and this will be picked up elsewhere.

In the case of an e-store like this, you have a pretty decent environment in which to learn. So.....

* Pick the area of the order process you want to effect
* Find out what .php file holds that code
* Read that .php file and try to work out what it does (use all the various sites on the net to help with this, ask questions here)
* Try and work out what variables the script reads in, uses in execution and writes out
* Then try hard coding these variables to see what each does in more detail
* Once you are happy with this, try popping in some logic

And be patient, it does take a while to learn. But once you have learnt PHP, most other scripting languages are very similar and are pretty easy to pickup

Cheers

CT
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.