What actions are there?
Which module are they in?
What do they do?

Add details to this issue and we can eventually write them up as a handbook page.

Eg. "Product" module, "Discounts on products". This looks like it means what it says: reduce the price of products.
But the action only reduces the price of ONE product.

Comments

joachim’s picture

Title: Documentation needed: actions » Full audit of module including conditions and actions

Updating title.
We need to test each condition and action module.

Conditions:
uc_discounts_role.module -- apply discount if user belongs to a particular role. Works. But BEWARE: uid 1 has no special privileges, unlike what Drupal's standard behaviour might have you expect!

Actions:
- uc_discounts_order_total.module -- Apply discount to entire order. Tested percentage option: works.

psynaptic’s picture

I've tested taxonomy discounts and that condition is working as expected. I also tested product discounts and they seem to be working apart from the confusion about applying a discount to a specific product. I still think the product discounts need further investigation so please can you check that yourself to see if they are working as we should expect?

joachim’s picture

Here's a list of all the conditions and actions, with the module providing them:

conditions:
- uc_discounts_multi_product: Multi Product
- uc_discounts_order_total: Order Total
- uc_discounts_product: Product
- uc_discounts_product_class: Product Type
- uc_discounts_role: User Role
- uc_discounts_site: Site
- uc_discounts_taxonomy: Taxonomy

actions:
- uc_discounts_multi_product: Discount multiple products from order
- uc_discounts_order_total: Discount amount from order total
- uc_discounts_product: Discount product price from order
- uc_discounts_product_class: Discount all products of a type from order
- uc_discounts_taxonomy: Discount product type price from order

joachim’s picture

Site condition: no idea what this does or how it's meant to work. Aren't the sites in a multi-site setup separate anyway -- the database for one site knows nothing of the database for the others, if I've understood all that stuff correctly.

Taxonomy condition: looking at the code, this goes through all products in the cart and satisfies the condition if any product has the condition's term applied.
I see a number of problems in the code:
Firstly, it's storing term names rather than tids.
Secondly, the 'not equal' option seems weird to me. It satisfies the condition if any one product doesn't have the term applied. TBH I've no idea why you'd want a negative term comparison anyway, and if you did, surely you'd want to check that NO product has that term.
We should probably expand this condition with the code from http://drupal.org/node/324296 to allow for specifying a number of products with the term.

psynaptic’s picture

Multi-sites usually require some sharing of database tables e.g. you may wish to share the same users between different sites, or the same product catalogue.

I think the not equal comparison operator is something that could be useful. Maybe you have a term that you're already applying a certain level of discount to and you would like to apply a different level discount to all other terms. I don't think the less than (or equal to) and greater than (or equal to) really make sense here and that seems to be what is left out in the uc_discounts_taxonomy_check() function anyway.

abdou17’s picture

Version: 5.x-1.x-dev » 6.x-1.x-dev
glennnz’s picture

Use Case:

This would be nice. Rather than using a role to specify a %age or $ discount, I can set an actual price for a product, and for it's attributes, depending on a user's role.

Thanks

Glenn

rfmartorelli’s picture

If you have a discount set up to discount the whole order on the condition that one product is in the cart, the discount will be applied to the product but not the cart. So
- uc_discounts_product: Product
+
- uc_discounts_order_total: Discount amount from order total
=
BROKEN

I'm doing my damnedest to solve this problem, but I haven't gotten any good results yet. Maybe somebody more familiar with this code can devise a patch.
(BTW if you're curious we are selling trial memberships that give users with the role assigned to members 10% off so they will also get 10% off when purchasing the trial(or membership) which is why I NEED this to work)

joachim’s picture

@rfmartorelli: are you saying you have this scenario:

- membership product grants you the member role.
- member role gives you 10% discount on all purchases

and what you want is:

- buy membership + widgets in the same order and widgets should be discounted by 10%.

Best file a new issue for that :)