Full audit of module including conditions and actions

joachim - October 21, 2008 - 15:13
Project:UC Discounts
Version:6.x-1.x-dev
Component:Documentation
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

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.

#1

joachim - October 21, 2008 - 15:52
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.

#2

psynaptic - October 21, 2008 - 16:03

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?

#3

joachim - October 26, 2008 - 17:46

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

#4

joachim - October 26, 2008 - 18:09

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.

#5

psynaptic - October 27, 2008 - 00:12

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.

#6

abdou17 - June 12, 2009 - 08:14
Version:5.x-1.x-dev» 6.x-1.x-dev

#7

glennnz - June 12, 2009 - 08:21

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

 
 

Drupal is a registered trademark of Dries Buytaert.