Hi fairestcape
Thanks for your interest and responses – if I may I’d like to expand on the project.
I am doing this job for my son who runs a fishing bait company.
He has been using the Zen Cart shopping cart very successfully for the last year or so.
He wants to create a members area on the site.
The members will have a (group) discount of 10% across all products.
They will also have access to a members area on the site where they will be sections for videos, articles etc.
He has accumulated over 200 customers already – most of which have signed up for the newsletter option.
My thought processes are as follows:
Use the newsletter field as a flag for members.
Make all existing customers who haven’t signed up for the newsletter, members by setting the newsletter option. Thus existing customers become members.
Remove the option when creating an account to sign up for the newsletter using Admin/Configuration/customer details.
Comment out the code where the customer can edit his newsletter option.
Set up a product on the site for purchasing yearly membership.
On purchase of the membership, manually alter the customer details to set the newsletter flag to indicate membership and allow the 10% group discount.
“Normal” customers will not have this newsletter flag set unless they purchase membership.
The membership area will be accessed by the main page which is accessed via Define Pages Editor/define_main_page.php
(I wanted to set up a members category, but as category files are stored as text files, I thought it would be easier to use php commands to communicate with the customer database)
On the define_main_page.php I need to check before allowing access to the members area:
- if someone has signed in to an account
- if the newsletter flag is set
And give messages to indicate what the customer must do to become a member.
If both of these conditions are true they gain access to the members area which will be a normal hyperlink to a sub-site.
At the moment I am struggling with the php commands for the main page.
I am testing on the main page this coding (with a customer signed in):
**<?php
$querynewsletter = "SELECT customers_newsletter FROM customers";
$resultnewsletter = mysql_query($query)
or die ("couldn't execute query");
echo "<br> customers_newsletter {$resultnewsletter}<br>";
?>**
With this output:
customers_newsletter Resource id #220
I was hoping for “1” !!!
Am also looking at !$_SESSION['customer_id'] along with PHP/MYSQL manuals
I hope all this makes sense!!
Again, any help would be appreciated
Derek