Expirable Product

Contrib type: 
Module
Status: 
Work in progress

Downloads

Latest version: 
5.x-1.0-alpha3
Compatibility: 
Ubercart 1.x

Thanks to this module, you can create expirable products. A new 'expiry' tab appears when you edit a product (eg: node/15/edit/expiry) and you can enter several expiry periods for a product (eg: 1 month, 3 months, 6 months...).

You can define too a reminder (triggered before product expiry) and a different price for each period.

Then, when a user view the product, there is a select box displayed in order to choose the period to purchase. The price associated to this period replaces the default product price in the cart view.

TODO: The default product price should be automatically hidden, or dymamically changed if javascript is enabled.

Note that once a user purchased an expirable product, then the expiry setting for that product can't be changed.

You can associate this module with uc_role.module in order to create expirable subsciptions to a role.

This module main goal is to provide a hook that triggers events related to product expiry:

<?php
/**
* Hook called on product expiry events.
*
* @param $op Operation
*    'new' : a new product expiry is scheduled
*    'reminder': a product expiry reminder is triggered
*    'renew': a product expiry has been renewed by a new order
*    'expiry': a product expired
* @param $full_schedule Product expiry schedule informations
*/
function hook_product_expiry($op, $full_schedule) {
...
}
?>

Remember that this is beta code... not in production for now... bla bla bla bla... use it at your own risk... bla bla bla bla....

CHANGE LIST
5.x-1.0-alpha3

  • Disabled quantity field.
  • Added expiry infos when viewing the product.

PreviewAttachmentSize
uc_expiry-5.x-1.0-alpha3.tar.gz6.9 KB
frankstallone's picture
Offline
Uber DonorEarly adopter... addicted to alphas.Not Kulvik
Joined: 08/08/2007
Juice: 211
everywhere i go, there's always something to remind me...

This reminds me of a functionality I saw on an older version of Ubercart where one could choose how many items they had in stock, so when the number became 0 no one was able to add it to their cart. Then of course when the store owner had more in stock he could just add a new number to the product and make it available again. However I believe that may have been another contribution from someone else.

This too "You can associate this module with uc_role.module in order to create expirable subsciptions to a role." provides a great service!

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15453
Re: everywhere i go, there's always something to remind me...

I believe you're looking for CpILL's inventory contribution:

http://www.ubercart.org/contrib/132

detour's picture
Offline
Bug FinderGetting busy with the Ubercode.
Joined: 10/02/2007
Juice: 150
patch for ubercart alpha 7e

aymerick,

Thanks for your work on this module. For compatibility with Ubercart alpha 7e, some code changes are required:

1. uc_order_get_status_id seems to be deprecated in favor of uc_order_status_data, as per the discussion at: http://www.ubercart.org/comment/3572/Re-Alpha-7e-Released

2. The second argument of hook_order has been changed from the order id to the new order object. See: http://www.ubercart.org/docs/api/hook_order

Attached is a patch for these two issues. With these modifications, uc_expiry is running on my site with Ubercart alpha 8.

Thanks!

AttachmentSize
uc_expiry-uc7e.diff 1.41 KB
torgosPizza's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.
Joined: 08/14/2007
Juice: 4111
Re: patch for ubercart alpha 7e

Just wondering if this contrib will conflict with the Expiration info on the uc_role product. I like the idea of sending the reminder a few days or so before their role expires again. Is there any added value for installing this contrib alongside the uc_role module? Thanks!

--
Help directly fund development: Donate via PayPal!

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15453
Re: Re: patch for ubercart alpha 7e

It's my understanding this functionality was included in the new roles module... perhaps not? This won't work in conjunction w/ uc_role.

Shawn Conn's picture
Offline
Administrator
Joined: 08/07/2007
Juice: 920
Re: Re: Re: patch for ubercart alpha 7e

uc_roles's logic was based off some of the code in uc_role & this module, however it was all written from scratch. As far as I can remember, there shouldn't be any conflict with this module & uc_roles; each have their own tables they work off of. This far from a guarantee though.

-Shawn Conn: If the Name Don't Rhyme It Ain't Mine

detour's picture
Offline
Bug FinderGetting busy with the Ubercode.
Joined: 10/02/2007
Juice: 150
Related module

I recently posted a module for handling subscriptions that came through a long derivation from this module. Please see:
http://www.ubercart.org/contrib/2851

glennnz's picture
Offline
Joined: 01/20/2009
Juice: 458
Re: Expirable Product

I'm looking for a different type of product expiry functionality. I sell training courses, and I want to be able to prevent users from registering for the course within a week of it starting. So the 'Add to Cart' disappears, or is replaced by 'Enrolments closed' or something like that, one week out from the event start date.

Any ideas?

Thanks

Glenn

macifl@drupal.org's picture
Offline
Joined: 07/21/2009
Juice: 2
D6 Update?

Hi,

Have any idea to when you update this modul to Ubercart 2.0 (Drupal 6)?

Thank,

Laci.

andrews501's picture
Offline
Joined: 11/15/2010
Juice: 71
Hello, I was wondering if

Hello,

I was wondering if this module will be updated to Drupal 6. I installed it but doesnt work.

Many thanks