Great work on this module. I thought it could use some support for Organic Groups (OG) http://www.drupal.org/project/og. I have basically cloned the User Role criteria, interface, and database schema for use with OG. With this patch you can create a discount that allows members of an Organic Group to purchase products with a discounted price.

I have tested the basics in creating a discount for one group then completing checkout with a user account in the group. The discount is successfully applied. I have not tested:

  • The upgrade script (I made changes manually to the db)
  • Multiple group discounts
  • All groups discount

I will report more testing when I have a chance. Please review the code and hopefully integrate it permanently into the module. I would appreciate any coding pointers if I have done something wrong.

Thanks

CommentFileSizeAuthor
uc_discounts_alt-6.x-2.x_og.patch16.37 KBtinker

Comments

tinker’s picture

Status: Active » Needs review

OK I finished testing and everything is working for me. I noticed that the "Enter Discount code" checkout pane had to be activated for the discount to be applied during order creation. Before I enabled the pane the discount was visible throughout the whole checkout process but the discount was not applied to the order when payment was processed. I noticed this on another site that is using unmodified uc_discount_alt code. I also noticed some code that stated "Ensures that javascript for adding discounts is added to checkout, regardless of whether discounts pane is used." which sounds like the checkout pane does not have to be active. Is this a bug?

Either way my Organic Group feature works the same as the current role feature so I guess this patch is ready to be reviewed.

tinker’s picture

Successfully using this patch on a production site for one month now.

jrust’s picture

So did you confirm that the database upgrade path works?

tinker’s picture

Yes I tested the database update on a new install and it worked. It just modifies one table and creates a new one.

tinker’s picture

Yes I tested the database update on a new install and it worked. It just modifies one table and creates a new one.

tinker’s picture

I have been using this patch on a live site for over 9 months. The site gives codeless discounts on certain products depending on groups the user belongs to. I have also had a few email campaigns where codes were set out. These code were only valid for certain groups. All of these organic groups features worked flawlessly. Most of the code is a direct dupe from Role limits.

Could this feature be committed?