| Project: | Discounts |
| Component: | Code |
| Category: | |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Environment:
Drupal 5.8
Ubercart 1.2
Discount version: pcambra's version
Test: For users of a certain role, discount all products of a certain class
How I did it:
Created a role "member" and added my user to the role
Created a product class "Seeds"
Created a product of class "seeds" called "test seeds". Price set at 100.
Created a discount called "memberdiscount" as follows:
CONDITIONS:
Userrole = member
Producttype >= 1. Type Seeds
ACTION:
Discount all products of a type (seeds) from order, qty=1, amount=10%
Behaviour:
10% Discount appears when viewing product
When product is added to cart, Full price is used.
When cart is checked out, full price is used, with no discount details of any kind shown
Debugging:
When viewing the product node:
uc_discounts_product_discount_price creates a "pseudo shopping cart" of a single item, the current node. The product details for this include the product's type (ie class). This pseudo shoppping cart is passed into uc_discounts_product_class_check, which correctly returns that the conditions are satisfied.
When adding product to cart:
uc_discounts_product_discount_price is called, but this time the product is not a full node, and the product type information is not available. This causes the uc_discounts_product_class_check to fail, so the discount isn't applied.
--
+1 for someone who is familiar with Discount code to take over maintenance.
I'll provide a small bounty ($100) for the new maintainer once he/she takes over, establishes a single codestream, and fixes this particular bug.


