------------
Summary
-------------
A coupon type that awards users a fixed value of user points on completion of checkout.

Project Page: http://drupal.org/sandbox/kimberlydb/1882566

Git: git clone --branch 7.x-1.x kimberlydb@git.drupal.org:sandbox/kimberlydb/1882566.git commerce_coupon_userpoints_fixed

2 Types of bonuses (can be compounded in a single coupon):

1. Order Bonus:
When a minimum purchase amount is reached (before tax), x number of userpoints
are awarded to the user.

2. Product Bonus:
When certain products are purchased, a number of points are awarded per each
product in the cart of that type.

-------------
Installation
-------------

1. Install commerce coupon module.
2. Install and configure the userpoints module.
2.a. Create a taxonomy term in userpoints vocabulary (Say "Credit" for instance)
2.b. Go to Store > Config > Commerce points settings
3. Create a coupon for a specific type.

---------------
Coupon Fields
----------------

Title: The text the user will see in their cart to verify the correct code is
entered.

Userpoints Type: the type of userpoints to be awarded.

Order Bonus - Number of Points: The points added to the order if purchase
minimum is met.

Purchase Minimum: The value required to meet before the coupon is valid for the
order bonus amount.

Product Bonus - Number of Points: The points awarded for each promo product
in the cart, including multiples of the same item. (i.e. a quantity of 5 of a
single product gets 5x the bonus).

Eligible Products: the products for which the specified bonus code applies.
Each selected product is independently awarded bonus points.

-----------------------------------------------

Reviews of other projects:

Comments

kimberlydb’s picture

Issue summary: View changes

wrote the module name wrong...oops should be commerce_coupon_userpoints_fixed

kimberlydb’s picture

Issue summary: View changes

missed a field

PA robot’s picture

Status: Needs review » Needs work

There are some errors reported by automated review tools, did you already check them? See http://ventral.org/pareview/httpgitdrupalorgsandboxkimberlydb1882566git

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)

Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).

I'm a robot and this is an automated message from Project Applications Scraper.

kimberlydb’s picture

Status: Needs work » Needs review

I have cleaned up the formatting errors. Will look into reviewing others.

kimberlydb’s picture

Issue summary: View changes

hilighting project page and git urls

kimberlydb’s picture

Issue summary: View changes

Adding a review link

kimberlydb’s picture

Issue summary: View changes

Another review

kimberlydb’s picture

Issue summary: View changes

Changing title to match review bonus desc

kimberlydb’s picture

Issue summary: View changes

7.x-1.x branch instead of master

kimberlydb’s picture

Issue tags: +PAreview: review bonus

Added 3 reviews

klausi’s picture

Assigned: Unassigned » stborchert
Status: Needs review » Reviewed & tested by the community
Issue tags: -PAreview: review bonus

Review of the 7.x-1.x branch:

  • DrupalPractice has found some issues with your code, but could be false positives.
    
    FILE: /home/klausi/pareview_temp/commerce_coupon_userpoints_fixed.rules.inc
    --------------------------------------------------------------------------------
    FOUND 0 ERROR(S) AND 5 WARNING(S) AFFECTING 5 LINE(S)
    --------------------------------------------------------------------------------
     58 | WARNING | Are you accessing field values here? Then you should use
        |         | LANGUAGE_NONE instead of 'und'
     60 | WARNING | Are you accessing field values here? Then you should use
        |         | LANGUAGE_NONE instead of 'und'
     90 | WARNING | Are you accessing field values here? Then you should use
        |         | LANGUAGE_NONE instead of 'und'
     96 | WARNING | Are you accessing field values here? Then you should use
        |         | LANGUAGE_NONE instead of 'und'
     97 | WARNING | Are you accessing field values here? Then you should use
        |         | LANGUAGE_NONE instead of 'und'
    --------------------------------------------------------------------------------
    
    Time: 0 seconds, Memory: 3.75Mb
    

This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. You have to get a review bonus to get a review from me.

manual review:

  1. "commerce_coupon_userpoints_fixed" is quite long, wouldn't "commerce_coupon_userpoints" suffice?
  2. commerce_coupon_userpoints_fixed_commerce_coupon_granted_amount_alter(): this is a hook implementation, right? Should be documented as such, see http://drupal.org/node/1354#hookimpl

But that are not blockers, looks RTBC to me otherwise. Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.

Assigning to stBorchert as he might have time to take a final look.

stborchert’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for your contribution, Kimberly!

There are no further objectives from me (only some suggestions).

Regarding the notes about the use of 'und' (for example $commerce_order->field_userpoints_earned['und']['0']['value']): if you wrap $commerce_order with entity_metadata_wrapper() (which I think has been already done in the calling function) you may access the fields value using $commerce_order->field_userpoints_earned->value().
This is much easier and you do not need to worry about the language and the delta.

I saw you already did this in commerce_coupon_userpoints_fixed.module line 203 so it should be easy for you to change this in commerce_coupon_userpoints_fixed.rules.inc.

I'm also a fan of short module names so I would suggest "commerce_cuf", but thats personal taste only ;)

I updated your account to let you promote this to a full project and also create new projects as either a sandbox or a "full" project.

Here are some recommended readings to help with excellent maintainership:

You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and get involved!

Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

Thanks to the dedicated reviewer(s) as well.

kimberlydb’s picture

Thanks guys. I'll clean up these last few issues, and probably change the name to just "commerce_coupon_userpoints".

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

Adding third review