Sounds like a great module!

Will it do date or time-based prorating? Say, decrease price by 10% each week for next eight weeks, or decrease price by 10% for 8 weeks total, but skipping week 3 and 6? If it could do that, that would be awesome. I've been doing all of that with UC custom price and it sucks doing it that way.

Comments

djdevin’s picture

Component: Miscellaneous » Code
Category: support » feature
Status: Active » Needs work

Thanks - would be nice, but I can't think of a good way to do it with a UI. Suggestions welcome :)

butler360’s picture

Well, I'm not a programmer so... not really, haha.

But I've been doing it using PHP's date functions, using either the day number or week number.

Here's my cobbled together code I've been using:

$week = date('W');

if ($week == 40) {  // Week 0
  $rate = 0;
}

if ($week == 41) {  // Week 1
  $rate = 0;
}

if ($week == 42) {  // Week 2
  $rate = 1;
}

if ($week == 43) {  // Week 3
  $rate = 2;
}

if ($week == 44) {  // Week 4
  $rate = 3;
}

if ($week == 45) {  // Week 5
  $rate = 4;
}

$item->price = $item->price -(25 * $rate);

So if you could in the UI ask for a start time (day or week), duration, frequency, and discount amount, seems like it's possible, right?

djdevin’s picture

Version: » 6.x-1.x-dev

Don't see why not, will have to work on it.