Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Subscription Module


Guest

Recommended Posts

Hi everybody. One of my clients is after something that I have seen requested a massive number of times, so I have taken it on myself to tackle it once and for all. Subscriptions.

 

 

 

Yes, I know there is a module which will pass through to PayPal subscriptions, but what this in effect does is bypass the shopping cart and just add in a paypal link to the product info page. I want to devise a system whereby people can use their shopping basket to add in subscription items, have this info stored and then complete their order. It is imperitave that this work for subscription AND non-subscription items. So, in addition to the current product price, it needs to carry a product_subscription amount through, total it and present this in the checkout pages ready for passing to the payment processor.

 

 

 

So far, I have added in an extra field to the admin panel under price (gross) called subscription_amount. I have got this to display correctly in the catalog, with the price being a setup fee and the subscription showing as ?x.xx per month as defined in admin. I have also got this to NOT show if no subscription proce has been set in admin, so the product displays as normal. I have even plugged into the paypal module so that it goes into paypal subscriptions direct (the only weakpoint being this has no basket function and just shows one total - this is a weakness with paypal and cant see any way around it).

 

 

 

Now to the bit I'm stuck on, and for somebody who has been working with osc for 3 or 4 years this is a tad embarassing to admit, but I cant for the life of me figure how to add a susbcsriptions field into the cart and order_total functions. I have no doubt that this will mean tinkering with a large amount of files, but I'm quite happy to put the work in if someone can be kind enough to point me in the right direction. Obviously once I have a fully functioning version working I will be releasing as a contrib...any help appreciated!

 

 

 

Also, I would like to create a direct debit payment module using the same info to create a printable page with my clients bank details and the amounts already filled in dynamically, along with a unique identifier (order number would do for this)

 

 

 

Anyone want to look at what Ive managed to complete so far, please get in touch and I'll send you a zip file.

 

 

 

Thanks in advance.

Link to comment
Share on other sites

quick question Tony, have thought of setting this subscription field as a product attribute? The osc has full support for attributes and something like that could then make it very easy to do. The "per month" requirement can be done separately but still on the attribute level. So you detect the option type and you perform the additional tasks required.

Link to comment
Share on other sites

Also, I would like to create a direct debit payment module using the same info to create a printable page with my clients bank details and the amounts already filled in dynamically, along with a unique identifier (order number would do for this)

Try this contrib: http://www.oscommerce.com/community/contri...earch,cc+by+fax 'cc by fax' for the print off page - with this contrib, you can print a page during checkout to be faxed, it automatically fills in the appropriate fields (i.e. name, total order amount, etc), and could probably be tweaked for your needs...

 

~bobsi18~

Link to comment
Share on other sites

Hi - thanks bobsi - good tip, gives a very good starting point for the dd aspect. Mark - I like the cut of your jib with reference to attributes, except it still comes down to the splitting out of subscriptions at some point. The way I am trying to go about it is to set up subscriptions as a completely seperate field, leaving attributes free for setup fees etc. I can appreciate that it could be very useful to have attributes used in this way though, as this would make the module much more adaptable.

 

Either way, Im left with the same stumbling block - where do I add in the extra information to carry the subscription amounts through to the checkout stages? I can add in the total functions etc. without any problems, and the work I have done on a dev site so far causes no errors, but no matter what i do the subscription amount isnt being carried through. I cant help feeling I am playing in the wrong places! The files I have modified for this purpose so far are:

 

includes/classes/shopping_cart.php and

includes/classes/order.php

 

with an extra column being added to the orders_products table to acrry subscription values where present.

 

Any comments?

Link to comment
Share on other sites

i did this once and as far as i remember i used the weight field since there was no shipping required so i suppose you can follow that field

i guess you also have to put a cron to repopulate the cart every month

and send an email requesting them to pay

incase you do not want to use a paypal subscription or similar method or if you want to allow more than one subscription to allow for partial cancelation

there is a reorder contribution that populates the cart from an order number that you might want to look at

Link to comment
Share on other sites

I have made up a subscription module and implemented it many times for various sites. here is the breakdown of what I did:

 

used the product model like like:

 

mem_12_1234

 

where mem indicates it is a members product

12 is the duration, (can be months or days)

1234 a unique number associated with the product

 

Now in the checkout process I added some code to check if the product is a mem or not, if it is, then I get the info nd populate a new table with the customers id, order id, expiration date and product id.

 

This sets up the products and stores it so it contains relevant info that is used for the subscription. With this info, when the user logs in the site can now reference this table to see if they have a current subscription or not.

 

On the admin site, I wrote up a CRON which runs daily, it reads the table and looks for subscriptions which expire in X amount of day and emails them that the subscription is about to end, and adds the item into the cart for them to renew (re purchase).

 

Automates the subscription process totally and keeps them coming back :)

 

cheers,

Peter M

Edited by cannuck1964

Peter McGrath

-----------------------------

See my Profile (click here) for more information and to contact me for professional osCommerce support that includes SEO development, custom development and security implementation

Link to comment
Share on other sites

  • 2 weeks later...
I just came across this Recurring Coffee Subscription Would be real cool to see something like that for oscommerce.
This is not really all that difficult, depending if you wanted to automate all of the payment and processing. If youy wanted to automate all of the payment processing, then you would need to set up some type of system to do the following:

 

Sell the product and associate a time frequency with it (use the attributes for this).

 

Save the order and set the order to have a recurring billing with the payment gateway.

 

add this recurring order to a new table so that the frequency, product id and customer id is saved.

 

Read this table once daily, and add a new order to the system everytime a coffee can is to be sent out (has been paid for as well via the gateway).

 

send and email confirming the order processing to the customer...

 

this can be mostly done with existing contributions being added in and modified....

 

cheers,

Peter M

Peter McGrath

-----------------------------

See my Profile (click here) for more information and to contact me for professional osCommerce support that includes SEO development, custom development and security implementation

Link to comment
Share on other sites

  • 5 months later...

tonystewart, did you ever get the PayPal subscriptions to carry to the cart? We want to sell our hosting on a recurring basis via OSC but we also want to sell other products that are one time sales & I think your future contrib will do this for us. Let me know, thanks.

Knowledge is Power!

Link to comment
Share on other sites

  • 5 months later...

Hi Tonystewart, did you ever complete the subscription module you were creating? I have searched the forums 3 days now, but no solid answer! Just read this thread and the type of subscription you were creating was just what Im looking for :)

 

Jane

Link to comment
Share on other sites

  • 2 months later...
Hi Tonystewart, did you ever complete the subscription module you were creating? I have searched the forums 3 days now, but no solid answer! Just read this thread and the type of subscription you were creating was just what Im looking for :)

 

Jane

Does anyone know of any subscription modules that have been completed? Any links or tips are greatly appreciated.

 

Kevin

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...