View Single Post
  #1  
Old 09-26-2002, 01:31 PM
  minorgod's Avatar 
minorgod minorgod is offline
 

X-Adept
  
Join Date: Sep 2002
Location: Arivaca, AZ
Posts: 402
 

Default A Digital Subscription Module is born

In case anyone is interested, I have nearly completed my DigitalSubscription module for X-Cart. It works almost identically to the regular subscription module, but it allows you to specify a protected directory which users can gain access to after they pay for the specific product to which the subscription is attached via the x-cart admin area. The users are then able to broswe their DigitalSubscriptions via their user profile area. The actually directory protection is handled via a script that modifies .htaccess files (Apache servers only) in the specified directories when users purchase a subscription.

I will probably only make the files available by request because creating this module required modifying many x-cart files and I'm not about to bug test them myself for everyone's various x-cart installs. Suffice it to say, I had to modify all of the following files:
  • \xcart\config.php
    created a new calendar.php \xcart\admin\digital_subscription_calendar.php
    \xcart\admin\orders.php
    \xcart\customer\auth.php
    \xcart\customer\cart.php
    \xcart\customer\featured_products.php
    \xcart\customer\orders.php
    \xcart\customer\product.php
    \xcart\customer\products.php
    \xcart\include\product_modify.php
    \xcart\provider\orders.php
    \xcart\skin2\menu_profile.tpl
    \xcart\skin2\admin\menu.tpl
    created a new calendar.tpl called \xcart\skin2\admin\main\digital_subscription_calen dar.tpl
    \xcart\skin2\customer\home.tpl
    \xcart\skin2\customer\main\product.tpl
    \xcart\skin2\main\product_modify.tpl
    \xcart\skin2\single\home.tpl
In addition I had to create the actual digital subscription module files (both php and tpl files) and modify the x-cart database by adding two new tables based on the original subscription module's tables.

It was a lot of work. In retrospect I'm not sure if x-cart "modules" actually qualify as what I've always considered to be modules. They are definitely not plug-in type modules and are not particularly easy to figure out or to code.

The last thing I need to do before the module is ready for prime-time is to add the .htaccess delete routines for when a user unsubscribes or his subscription expires. Hopefully the site will actually be live in another week so interested parties can see it in action. I'm not even sure why I'm telling everyone except that I was so excited about figuring this out that I had to tell SOMEONE. I think the file list above might be helpful for anyone else trying to write a module. You've got to modify more files than you might think.
__________________
www.brettbrewer.com
Getting back into x-cart dev after a long hiatus. Modded lots of x-carts from version 3.1.x to 4.1.x. Developer of ImageScaler mod, Pre-login per user coupon mod, Wordpress feed mod, DigitalSubscriptions mod, Phonetic bulk download keys addon for DownloadExpander mod, Serial Number Generator for ESD products, Custom CMS/LMS integrations, external products mod, and more.
Reply With Quote