Closed (works as designed)
Project:
UC Discount Framework
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
9 Jul 2010 at 18:07 UTC
Updated:
9 Jul 2010 at 20:30 UTC
If there any particular reason for this code setting $node->sell_price, only to read it off again into something else?
// $node was got like this so there's no pass by reference as far as I can see:
$node = clone $context['subject']['node'];
// SNIP
if (!isset($prices[$cache])) {
// The discount action modifies the node's sell_price field.
$node->sell_price = $price_info['price'];
//dsm('pull!');
ca_pull_trigger('calculate_product_discounts', $node, $user);
$prices[$cache] = $node->sell_price;
}
else {
$node->sell_price = $prices[$cache];
}
// Alter the price given in place.
$price_info['price'] = $node->sell_price;
// The function ends here -- nothing more is done with $node
Why not just store it in $sell_price?
The reason I ask is the extra code needed for #840208: discounts not applied to attribute option labels will return a price that is not the node sell price...
Comments
Comment #1
joachim commentedTurns out this is a hack -- we have to set
$node->sell_price = $price_info['price'];
for the CA to work its stuff.