Wednesday 11 February 2004 6:16:18 am
Hi, Since my company is both a web host and an Application Service Provider for web based software, I've come to discover the severe limitations of the ezprice datatype (and the rest of the shop module) for handling subscription based products and services. So, I though I would get a discussion going on this as I'm sure several people would benefit from such functionality. Here are some ideas as to how subscription based products could be handled: The following fields should be available when editing a class attribute created upon the ezprice datatype (in addition to the existing ones):
- The possibility to choose whether the product is a "Single purchase" or "Subscription based".
- For what period the product price is defined (1 day/week/month/year) (only applies if the price is "Subscription based"). - Whether the subscription is automatically renewed or not (only applies if the price is "Subscription based") Next, it should be possible to create available subscription cycles under the "Shop" section of the admin interface. Each subscription cycle should consist of a number and a selection of the available options "days", "weeks", "months" and "years". Examples of subscription cycles would be "3 days" or "4 months" and these would be the available options when registering an order. When displaying the price of a subscription based product (defined in the template for the view mode of the ezprice datatype), it should be visible for what period the price of the product is defined, for instance "$49 (pr/month)". When registering an order, if the basket contains subscription based products, the shop/register template should automatically displays a drop down list containing the available subscription cycles. The ezorder table needs to be expanded in order to store the selected subscription cycle. A new db table should be created to store information about each subscription cycle for an order. At a minimum, this new table would need to contain information about until which date the order has been "paid". (Of course, ezp doesn't know whether a product has been paid or not, so this will in fact be until which date the order has been ordered according to the subscription cycle and the order date, in addition to previous records in the table for the same order.) A new cron job script would run to see if there are any subscription based orders that expire soon ("soon" would be defined as the amount of days in advance by an INI setting, probably in shop.ini). For each subscription based order that expires soon
If the product is set to be automatically renewed
Store another subscription cycle for the order Send info to admin containing information about the subscription renewal
If the product is not set to be automatically renewed Send an email to the order owner (as fetched by the associated shopaccounthandler) asking them to renew their subscription, including a link to do so. The page allowing a shopper to renew their subscription would require two new functions "all" and "own" to a new "renewsubscription" view of the shop module. If the user has the required privileges, a basket containing the products to be renewed (the subscription based products) will be displayed, including a button labeled "Renew". When the button is clicked, the same thing happens as when a product is set to be automatically renewed. In addition, an Email is sent to the order owner notifying them that the subscription has been renewed. Finally, to have the possibility of using a credit card payment gateway upon the renewal of a subscription based order, the trigger "shop | renewsubscription | after" should be defined. Questions/possible problems: Another way to go would be to select a different set of available subscription cycles for each product object, and then select the preferred subscription cycle when adding a product to the cart. However, this would result in several subscription cycles for one order, and would make things more complicated, both for the shopper and the admin. Could anyone think of a scenario where product-specific subscription cycles are needed? As far as I can tell, "ezproduct" would be a more appropriate name for the "ezprice" datatype, especially after adding the above functionality. Regardless, I prefer the "ezproduct" name as it much better describes the purpose of the datatype (and how it is handled in ezp). Looking forward to hearing your input ! Sincerely, Eirik Johansen
Sincerely,
Eirik Alfstad Johansen
http://www.netmaking.no/
|