Closed (fixed)
Project:
Ubercart Discounts (Alternative)
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
11 Jul 2011 at 20:14 UTC
Updated:
27 Jul 2011 at 00:13 UTC
I deal with a few clients that want discounts added automatically based on a referral source to the website. If someone comes from an affiliate partners website, a token is placed in the URL and I check for this in another module that will set a cookie indicating they should get the discount. At the end of get_discounts_for_order() function, I only allow the discount to 'pass' and be applied if that token is present.
I suggest adding in a custom PHP discount validator for each discount. This opens up other developers to use that area of the GUI to put in their PHP without hacking the module.
I'll see if I can roll a patch for this soon.
Comments
Comment #1
jrust commentedCouldn't you do this using the uc_discount_alter() hook that's mentioned in the README?
Comment #2
bkosbornehuh? There's nothing in the README about that... and I can't find any refs to it in the code....?
Comment #3
jrust commentedhmm, maybe I haven't released :/ #1155784: Implement hooks for discounts
Comment #4
bkosborneCould you roll a dev release for that if you can? I need that functionality for a project. Thanks
Comment #5
jrust commentedDev release is rolled nightly, so it should have what you need.