Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Membership contribution.


aboyz

Recommended Posts

Hi,

 

I was wondering if anyone know if there is a contribution for Membership? I selling design. and I want user have the option to become a membership in order to download all of the design i make. If they are not a member. they can download the free design i make. I was wondering if anyone know of a contribution that does this. Or a third pary application that does this. Please advise. Really appreciated this.

 

thanks

:D

Link to comment
Share on other sites

There is a contribution that lets you purchase without an account.. let's see if I can find the link...

 

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

 

:D

 

Edit:

 

Oh there is also a contribution that lets you require members to be logged in to see product prices.. I don't know if there's one that requires you to be logged in to even SEE particular products..

 

 

What you CAN do is, in your FREE DESIGNS section, in each PRODUCT INFO PAGE, just provide a link to the download in the product info. That way they don't have to do any kind of checkout to download, it's just right there from the page.

 

That's what I'm going to do.

Edited by TheBlueEyz
Link to comment
Share on other sites

  • 4 months later...

I'm not sure if this is what you're looking for, but our site has membership tiers (or levels) as well as a free section. Visitors can download certain designs for free. Members are given access to download designs based on their membership level. The higher the membership, the more features available to them.

 

I created memberaccess.php to check a member's status:

<?php
/*
 $Id: memberaccess.php,v 1.0 2004/07/13 03:01:48 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/
/*

 Membership Access - Copyright (c) 2004 Va Tavenner - [email protected]

*/

      // Return a customer greeting
         function tep_customer_pgreeting() {
           global $customer_id, $customer_first_name;

           if (tep_session_is_registered('customer_first_name') && tep_session_is_registered('customer_id')) {
             $pgreeting_string = sprintf(TEXT_GREETING_PRODUCT, tep_output_string_protected($customer_first_name), tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL'));
           } else {
             $pgreeting_string = sprintf(TEXT_GREETING_GUEST, tep_href_link(FILENAME_LOGIN, '', 'SSL'), tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'));
           }

           return $pgreeting_string;
        }

       define('TEXT_GREETING_PRODUCT', 'Hello <span class="greetUser">%s!</span>');

//fetch order variables from the ORDERS table
//5.21.04 added the order by statement
      $member_query=(tep_db_query("select orders_status, orders_id, date_format(date_purchased, '%Y-%m-%d') as date_purchased_day from " . TABLE_ORDERS . " where customers_id = '$customer_id' order by date_purchased DESC"));
      $member = tep_db_fetch_array($member_query);
      $ordernumber = $member['orders_id'];
      $orderstatus = $member['orders_status'];
      $orderdate = $member['date_purchased_day'];

//define length of membership by product ID number
      $expiry_query=(tep_db_query("select products_id  from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '$ordernumber'"));
      $expiry = tep_db_fetch_array($expiry_query);
      $product=$expiry['products_id'];
      //product id determines length of membership, product 155 is for one month etc
      if ($product == '155') $exp=1;
      if ($product == '156') $exp=3;
      if ($product == '157') $exp=6;
      if ($product == '158') $exp=12;

//define expiration of membership by product ID number
      list($y, $m, $d) = explode('-', $orderdate);
      $member_timestamp = mktime(23, 59, 59, ($m)+$exp, $d, $y);
      $newtime = $member_timestamp;
      $member_expiry = date('m-d-Y', $newtime);

//define whether membership is current or expired
       if ($member_timestamp <= time()) $active=expired;
       if ($member_timestamp > time()) $active=current;

//define whether payment for order was completed
       if ($orderstatus == '3') $orderstat=completed;
       if ($orderstatus != '3') $orderstat=incomplete;

//set access status

//if they are a member with a completed order but expired membership
       if (tep_session_is_registered('customer_id') && ($orderstat==completed) && ($active == expired)) $memaccess='renew';
//if they are a member with a completed order and current membership
       if (tep_session_is_registered('customer_id') && ($product!='158') && ($orderstat==completed) && ($active == current)) $memaccess='member';
//if they are a member with a completed order and current pro membership
       if (tep_session_is_registered('customer_id') && ($product=='158') && ($orderstat==completed) && ($active == current)) $memaccess='pro';
//if they are not a member or haven't logged in yet
     if (!tep_session_is_registered('customer_id')) $memaccess='new';
?>

 

In product_info.php, or any page where you want to define what certain members will see, insert the following at the top:

include('memberaccess.php');

 

Then where the member-specific information will be displayed insert:

////////////////////////
//Define what they will see based on conditions defined in memberaccess.php
///////////////////////
//if they are not a member or haven't logged in yet
      if ($memaccess == 'new')
             {echo tep_customer_pgreeting(). "You must log in or become a member in order to access this design.";}
///////////////////////
//if they are a member with a completed order but expired membership
       if ($memaccess == 'renew')
             {echo tep_customer_pgreeting(). "<BR>Your membership expired: <B>".$member_expiry. "</B>.  Please renew your membership.";}
///////////////////////
//if they are a member with a completed order and current standard membership
       if ($memaccess == 'member')
              {echo "<table border=0 width=100% class=infoBox><tr class=infoBoxContents><td align=left class=main><b>".tep_customer_pgreeting(). <table border=0 width=100% class=infoBox><tr class=infoBoxContents><td align=left class=main><b>".tep_customer_pgreeting(). "</B></td><td align=right class=main>Your membership expires <B>".$member_expiry."</B></td></tr></table>The following design options are available:";
///////////////////////               }
//if they are a member with a completed order and current pro membership
       if ($memaccess == 'pro')
              {echo "<BR><BR><table border=0 width=100% class=infoBox><tr class=infoBoxContents><td align=left class=main><b>".tep_customer_pgreeting(). "</B></td><td align=right class=main>Your membership expires <B>".$member_expiry."</B></td></tr></table>The following design options are available";
              }

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...