opentactics.com/uc_viral.tar.gz
Description:
Viral Discount (uc_viral) will allow admins to specify referral discounts for specific products. After a user purchases such a product, he is given the option to refer his friends. For each friend who purchases the product, the amount owed by the user is decreased by a pre-set amount. After a specified time period, admin can charge user based on prior authentication, taking into account any accumulated discount.
This is different than the affiliate module because it operates on product purchases instead of click-thrus and it reduces the price of the original user's ubercart order. Instead of affiliates, the target audience for this product is casual users who might tell-a-friend anyway but need some added incentive to share the product on social media.
The end goal is to create a viral phenomena in which the average user successfully refers more than one user, and purchases grow exponentially. To this aim, I plan on adding features that allow conversion testing of discount amount, offer page, etc so that the replication rate can be eked past 1.0 into true viral growth. Largely because of this emphasis on viral marketing, I think this merits a separate project instead of expanding Affiliate.
Future / Planned Improvements:
* Auto-Charge orders after pre-set waiting period (User has 48 hours to refer friends for discount and then gets charged.)
* Click-thru tracking
* Conversion testing of offer page / messages (perhaps through Google Optimizer module)
* Twitter module integration
* Rules integration
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | uc_viral.tar_.gz | 5.03 KB | heydemo |
| #9 | uc_viral.tar_.gz | 5.01 KB | heydemo |
| #7 | uc_viral.tar_.gz | 5.02 KB | heydemo |
| #6 | uc_viral.tar_.gz | 4.97 KB | heydemo |
| #2 | uc_viral.tar_.gz | 8.66 KB | heydemo |
Comments
Comment #1
heydemo commentedComment #2
heydemo commentedComment #3
avpadernoHello, and thanks for applying for a CVS account. I am adding the review tags, and some volunteers will review your code, pointing out what needs to be changed.
Comment #4
zzolo commentedThought bases on just a code review:
* Your README.txt links to a D5 page: http://drupal.org/getting-started/5/install-contrib/modules
* Your install file docblock says: "Installs the Recurring Fee module."
* Not all functions have docblocks.
* Keep lines of comments to 80 characters wide.
* On line 218, you are not using table prefixing:
{table_name}* What are the licensing on the images included in this module?
* In theme_uc_viral_offer_page(), you use a lot of break tags, when you should use div's and CSS, and the b tag is not semantically correct, you should use the strong tag
* For classes in themes, use your full module name like uc-viral-*
* In this, you are not actually using @title:
$title = t("Refer a friend and save $@amount off the price of your order.", array('@title' => $product->title, '@amount' => $discount));Overall, seems to be a solid module. Good work.
Comment #5
avpadernoThere have not been replies in the past week; I am marking this application as .
Comment #6
heydemo commentedzzolo, thanks for the thorough review.
I've removed images because of their non-GPL status. As far as the link (http://drupal.org/getting-started/5/install-contrib/modules) while it is labeled as a D5 page, the instructions are still up to date for D6 and there does not appear to be a comparable D6 page that gives new users an overview of installing modules for D6, so I would argue for keeping this in.
I've implemented the rest of the changes you suggested.
Comment #7
heydemo commentedNevermind, Found a link for installing contrib modules in D6.
Comment #8
zzolo commentedYour first item uses a page argument that is not defined. You should be using page loaders or a wildcard. Your second item sets access callback to TRUE which is badly formed and not secure.
You should be using url().
Your argument definitions are wrong. See documentation on hook_theme. You need to use your modules prefix for these theme functions.
I am not 100% sure, but this is not the standard SQL that Drupal uses and is probably not supported by all databases. Please use JOIN ON and specify the type of JOIN. You use the right syntax in other places.
Please note the correct syntax for all your docblocks:
You are not using t() when you need to.
Comment #9
heydemo commentedI've made all changes expect for #3 - removing 'access callback' => TRUE
I disagree that this is not well formed. In fact, it's used in core (see user.module line 897):
For the exact same reason - the callback should always be accessible
Comment #10
zzolo commentedImportant:
Is there some way to use the symbol of currency based on the language of the site or some other settings? You have just hard-coded US into your module.
Utilize drupal_write_record()
Your module depends on uc_credit but this is not a dependency in the .info. Maybe this is a dependency of uc_order?
Minor:
You should pick a consistent way of representing arrays as well as spacing though out the module. Consistency promotes better readability.
Comment #11
heydemo commentedFixed all important changes and arrays. The menu callback calls menu_execute_active_handler, so if store is off limits users will still get an access denied.
Comment #12
zzolo commentedLooks good. I think there is still a fair amount of room to improve coding standards and make the code more readable and add comments, but this good enough to get in. Please keep up with the coding standards and use Coder.
I appreciate your patience in this and hope that you have benefited from this process. I definitely encourage you to get involved with other aspects of the Drupal community.
As far as using CVS on Drupal.org, please read the following.
http://drupal.org/handbook/cvs/quickstart
http://drupal.org/node/10259
I have approved your application. Welcome, and please don't hesitate to ask questions in the correct channels!
Comment #15
avpaderno