Member approval

Messagepar dAvydAv » Jeu 15 Nov 2007, 17:42

Ce module permet aux administrateurs d'approuver les membres avant un accès au panier.

Les clients pourront suivre l'inscription de routine habituelle, à l'issue de laquelle l'administrateur du site reçoit un courrier électronique avisant qu'un nouveau client a signé.

Le client peut alors être approuvée ou rejetée par le biais du panneau d'administration.

http://www.oscommerce.com/community/contributions,1339

Je suis en train d'essayer d'adpater la contribution ...malgrè mon incompétence en php

1/ Ajout d'un champ à la table customers
ALTER TABLE `customers` ADD `member_level` INT(5) DEFAULT '0' NOT NULL;

2/ Dans catalog/create_account.php supprimer
Code: Tout sélectionner
    tep_session_register('customer_id');
    tep_session_register('customer_first_name');
    tep_session_register('customer_default_address_id');
    tep_session_register('customer_country_id');
    tep_session_register('customer_zone_id');

// restore cart contents
    $cart->restore_contents();

3/Remplacer
Code: Tout sélectionner
} else {
        $email_text = sprintf(EMAIL_GREET_NONE, $firstname);
      }

      $email_text .= EMAIL_WELCOME . EMAIL_TEXT . EMAIL_CONTACT . EMAIL_WARNING;
      tep_mail($name, $email_address, EMAIL_SUBJECT, $email_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

      tep_redirect(tep_href_link(FILENAME_CREATE_ACCOUNT_SUCCESS, '', 'SSL'));

par
Code: Tout sélectionner
 } else {
      $email_text = sprintf(EMAIL_GREET_NONE, $firstname);
    }
  }
    // customer email notification
    $email_text .= EMAIL_WELCOME . EMAIL_TEXT . EMAIL_CONTACT . EMAIL_WARNING;
    tep_mail($name, $email_address, EMAIL_SUBJECT, nl2br($email_text), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

    // admin email notification

    $admin_email_text .= ADMIN_EMAIL_WELCOME . ADMIN_EMAIL_TEXT . EMAIL_WARNING;

    tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_SUBJECT, nl2br($admin_email_text), $name, $email_address, '');
 
    tep_redirect(tep_href_link(FILENAME_CREATE_ACCOUNT_SUCCESS, '', 'SSL'));
  }

4/Remplacer dans catalog/includes/languages/french/create_account.php
Code: Tout sélectionner
define('EMAIL_TEXT', 'You can now take part in the <b>various services</b> we have to offer you. Some of these services include:' . "nn" . '<li><b>Permanent Cart</b> - Any products added to your online cart remain there until you remove them, or check them out.' . "n" . '<li><b>Address Book</b> - We can now deliver your products to another address other than yours! This is perfect to send birthday gifts direct to the birthday-person themselves.' . "n" . '<li><b>Order History</b> - View your history of purchases that you have made with us.' . "n" . '<li><b>Products Reviews</b> - Share your opinions on products with our other customers.' . "nn");

par
Code: Tout sélectionner
define('ADMIN_EMAIL_WELCOME', 'Application to become a wholesale customer of <b>' . STORE_NAME . '</b>.' . "nn");

define('EMAIL_TEXT', 'Your application to become a wholesale customer [which will enable you purchase our products at a discounted rate] is currently being evaluated.  We will notify you within 48 hours as to when you can access our eCommerce  system.  <br><br>You can now take part in the <b>various services</b> we have to offer you. Some of these services include:' . "nn" . '<li><b>Permanent Cart</b> - Any products added to your online cart remain there until you remove them, or check them out.' . "n" . '<li><b>Address Book</b> - We can now deliver your products to another address other than yours! This is perfect to send birthday gifts direct to the birthday-person themselves.' . "n" . '<li><b>Order History</b> - View your history of purchases that you have made with us.' . "n" . '<li><b>Products Reviews</b> - Share your opinions on products with our other customers.' . "nn");

define('ADMIN_EMAIL_TEXT', 'You have received an application to become a wholesale customer from your website.  Information regarding this application can be found at your online administration panel.' . "nn");

5/ Dans catalog/login.php remplacer :

Code: Tout sélectionner
$check_customer_query = tep_db_query("select customers_id, customers_firstname, customers_password, customers_email_address, customers_default_address_id from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "'");


par

Code: Tout sélectionner
$check_customer_query = tep_db_query("select customers_id, customers_firstname, customers_password, customers_email_address, customers_default_address_id, member_level  from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "'");

après ça [approx line 34]

Code: Tout sélectionner
  if (!tep_validate_password($password, $check_customer['customers_password'])) {
        $error = true;
      } else {

insérer ça
Code: Tout sélectionner
if ($check_customer['member_level'] == 0 ) {
          $HTTP_GET_VARS['login'] = 'invalid';
   $messageStack->add('login', TEXT_NOT_APPROVED);
        } else {
Dernière édition par dAvydAv le Jeu 15 Nov 2007, 18:14, édité 1 fois.
dAvydAv
Membre actif
 
Messages: 59
Inscription: Lun 06 Aoû 2007, 18:44

Messagepar dAvydAv » Jeu 15 Nov 2007, 18:01

Suite

Toujours dans catalog/login.phpon remplace ça:

Code: Tout sélectionner
} else {
          tep_redirect(tep_href_link(FILENAME_ACCOUNT));
        }
      }
    }
  }
  if ($error == true) {

par
Code: Tout sélectionner
} else {
          tep_redirect(tep_href_link(FILENAME_ACCOUNT));
          }
        }
      }
    }
  }
  if ($error == true) {

là c un peu différent que la contribution intial je pense :/ (j'ai remplacé FILENAME_DEFAULT, par FILENAME_ACCOUNT)

6/Dans catalog/includes/languages/french/login.php, ajouter
Code: Tout sélectionner
define('TEXT_VALID_ERROR', '<font color="#ff0000"><b>ERROR:</b></font> This account has not been approved yet, please contact the site Administrator.');

define('TEXT_NEW_CUSTOMER_INTRODUCTION', 'By creating an account at ' . STORE_NAME . ' you will be able to shop faster, be up to date on an orders status, and keep track of the orders you have previously made.  Please note that new accounts must first be approved to gain access to the catalog.');

define('TEXT_NOT_APPROVED', 'Your membership has not been approved yet');

7/Dans admin/includes/filesnames.php
ajouter:
Code: Tout sélectionner
  define('FILENAME_MEMBERS', 'members.php');
dAvydAv
Membre actif
 
Messages: 59
Inscription: Lun 06 Aoû 2007, 18:44

Messagepar dAvydAv » Jeu 15 Nov 2007, 18:13

suite

8/ Dans admin/includes/application_top.php ajouter

Code: Tout sélectionner
  define('FILENAME_MEMBERS', 'members.php')

9/ c'est là où je bloque, je pense qu'il faut modifier le fichier admin/customers
Dans la contrib os commerce initial on a ça
ouvrir
admin/includes/boxes/customers.php
'<a href="' . tep_href_link(FILENAME_CUSTOMERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CUSTOMERS_CUSTOMERS . '</a><br>' .
inserer ça
'<a href="' . tep_href_link(FILENAME_MEMBERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CUSTOMERS_APPROVAL . '</a><br>' .

Puis ajouter ce qui suit à la fin juste au-dessus (traduction google, mdr), je pense qu'en faite c ajouter au fichier orders du repertoire includes d'admin
Code: Tout sélectionner
define('EMAIL_CONTACT', 'For help with any of our online services, please email us at: ' . STORE_OWNER_EMAIL_ADDRESS);

define('EMAIL_TEXT_CONFIRM', 'Your application to become a wholesale customer of (your store) has been approved. You can now access pricing on the (your store) site.<br>You can now take part in the <b>various services</b> we have to offer you. Some of these services include:' . "n" . '<li><b>Permanent Cart</b> - Any products added to your online cart remain there until you remove them, or check them out.' . "n" . '<li><b>Address Book</b> - We can now deliver your products to another address other than yours! This is perfect to drop ship direct to your customer.' . "n" . '<li><b>Order History</b> - View your history of purchases that you have made with us.' . "n" . '<li><b>Products Reviews</b> - Share your opinions on products with our other customers.' . "n");

define('EMAIL_WARNING', '<b>Note:</b> This email address was used to request access to our wholesale website. If you did not signup to be a customer, please send an email to ' . STORE_OWNER_EMAIL_ADDRESS . "nn");

define('EMAIL_TEXT_SUBJECT', 'Account Approved');

define('EMAIL_SEPARATOR', '----------------------------------------------');

Affaire à suivre
++
dAvydAv
Membre actif
 
Messages: 59
Inscription: Lun 06 Aoû 2007, 18:44


Retourner vers Plugin

Qui est en ligne

Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 1 invité

cron