Re: MultiSite Module Support Thread
Quote:
I'd like to set a default for the customers_allowance field to access one or two of the sites. What would I need to add to the previously used SQL command?
Unfortunately setting a default for the TEXT type isn't possible.
Quote:
Second question is what SQL Command would I need to enter when someone is given permission to access the more restricted site?
Simply an update query with the correct parameters.
For example (if you add another field in the "edit customer", admin) the field in the form is called "site".
Just do this query then:
Code:
$field_customers_allowance = '--';
$field_customers_allowance = $_POST['site'];
$field_customers_allowance . '--';
mysql_query("UPDATE customers SET customers_allowance = '".$field_customers_allowance."'" WHERE customers_id = '".$_GET['cID']."');
That will be it.
Re: MultiSite Module Support Thread
Alright, after having spent a while working on this problem, I found a much easier solution. I actually gave it a try earlier, but I didn't quite have it all together.
Problem:
I have 2 sites. 1 site is open for the public to view, and the 2nd is only for authoirzed personnel to view, and purchase. All customers should be able to shop on the public site immediately without any hold up.
Solution:
1)Admin>Customer Details>Customer Approval Status - Authorization Pending Set to 1
2)Config site switch for public store as such
Code:
define('CUSTOMERS_APPROVAL_AUTHORIZATION','0'); //Customer Approval Status - Authorization Pending
3)Edit includes/modules/create_account.php
Code:
$sql_data_array = array('customers_firstname' => $firstname,
'customers_lastname' => $lastname,
'customers_email_address' => $email_address,
'customers_nick' => $nick,
'customers_telephone' => $telephone,
'customers_fax' => $fax,
'customers_newsletter' => (int)$newsletter,
'customers_email_format' => $email_format,
'customers_default_address_id' => 0,
'customers_password' => zen_encrypt_password($password),
'customers_authorization' => (int)CUSTOMERS_APPROVAL_AUTHORIZATION
);
Change to:
Code:
$sql_data_array = array('customers_firstname' => $firstname,
'customers_lastname' => $lastname,
'customers_email_address' => $email_address,
'customers_nick' => $nick,
'customers_telephone' => $telephone,
'customers_fax' => $fax,
'customers_newsletter' => (int)$newsletter,
'customers_email_format' => $email_format,
'customers_default_address_id' => 0,
'customers_password' => zen_encrypt_password($password),
'customers_authorization' => 1
);
Result:
Customer will not be automatically approved by the main settings, but the public site doesn't care if a customer is authorized.
Note:
Now as always be careful when adjusting the code to Zen, but this was the best solution that was suited for our needs.
Thank you streetglow for all your help!
Re: MultiSite Module Support Thread
Your welcome.
Please beware that this will only suit for having 1 site unauthorized and the other site authorized. If you would have 3 different sites, with all 3 different authorizations (this is our case) you can only do it by or creating for every site a new variable definition or by using the method I described earlier.
Indeed, for your needs this was the easiest way to archieve it.
Re: MultiSite Module Support Thread
Ok, we need something more structured to develop this module, its instructions, documentation and tips and advice before it becomes too complicate and confusing.
I think that we should create a Multisite section in the zen-cart Wiki documentation
http://www.zen-cart.com/wiki/
Then everything will be clearer and make sense.
The only problem is that I don't know how to create an account for it or how to login ...
When you use something like:
PHP Code:
... LIKE "-'.SITE_NAME.'-" ....
you only need one dash between the site names like that:
PHP Code:
-site1-site2-site3-
This is how it feets into the description of the categories
PHP Code:
<!--site1-site2-site3-->
however a double dash still works ! :lamo:
Re: MultiSite Module Support Thread
The first site will not work, are my experiences. I might have made a typo.
But for preventing any issues I use double dash. Works fine.
Also if you use double dash you will be able to perform a PHP-function like "explode();" while this isn't possible with single dash.
Re: MultiSite Module Support Thread
Quote:
Originally Posted by
streetglow
The first site will not work, are my experiences. I might have made a typo.
But for preventing any issues I use double dash. Works fine.
Also if you use double dash you will be able to perform a PHP-function like "explode();" while this isn't possible with single dash.
for the first site, make sure you start by a dash.
Explode for "-site1-site2-site3-":
PHP Code:
$site_array=explode('-',trim($site_string,'-'));
But of course you can do as you wish ...
Re: MultiSite Module Support Thread
Alright, I'm back with another problem, hopefully not every is sick of me yet.:blush:
I'm wanting to set up the site_links feature so the session ID and everything is working as it should. My problem I'm picky and it's not quite all that I'm looking for. :lookaroun
When someone who is authorized for the public site is signed in and clicks to visit the restricted site, they are automatically given full access to the restricted site. I'd like the people with customer_authorization of 1 to not be allowed full access but to the authorization pending page.
Essentially I need the customers_authorization to transfer along with the session_id. I assume this is not only controlled by the site_links sidebox, but also by the who's online table in the database. I'm I correct in my assumptions?
If so I guess I'll need to run
Code:
ALTER TABLE whos_online ADD customer_authorization int(1) default NULL;
Then edit the side box to carry the authorization value with it, but I'm not entirely sure where to place that.
I'm I on the right track?
Re: MultiSite Module Support Thread
Okay, it's turns out that the site links do work for filter customer authorization 90% of the time, without any modification to the file or database.
The only case when it does not pay attention to the authorization value is just after a new customer has signed up. I'm not sure why that is though.
Re: MultiSite Module Support Thread
1st: This Module is just what I was looking for. Thanks Gerome.
2nd: Implementing the module looks simple, but it doesn't work for me yet:
[QUOTE=Gerome;418983]Hi Jvoce,
You still need to add that at the begining of your 'configure.php':
PHP Code:
include_once('includes/config_sites/sites_switch.php');
QUOTE]
After making (and solving) the same mistake as above, now I'm facing the following problem:
The Admin still works fine, but opening the site gives the nddbc.html page (antiekbeslag.nl).
The database seems to work/connect normal...
It wasn't a fresh install, but I carefully merged the few files I changed.
(super orders in includes/classes/order.php;
includes/modules/product_listing.php:
$listing_split = new splitPageResults($listing_sql, $max_results, 'p.products_id', 'page');
Changed in:
$listing_split = new splitPageResults(cat_filter($listing_sql), $max_results, 'p.products_id', 'page');
Instead of:
$listing_split = new splitPageResults(cat_filter($listing_sql), MAX_DISPLAY_PRODUCTS_LISTING, 'p.products_id', 'page');
(But both ways don't work)
)
Is there a simple mistake I'm overlooking? Does anybody have a clue what's obvious I did wrong?
Thanks in advance.
Re: MultiSite Module Support Thread
I changed an old Configure.php file and after uploading the databaseconnection on the front-end didn't work....
Waste of some quality hours but now I'm ready to test the rest.