According to this definition of the 'uc_discount_condition_node_type' callback:
<?php
$conditions['uc_discount_condition_node_type'] = array(
'#title' => t('Node type'),
'#description' => t('The node has a particular type.'),
'#category' => t('Node'),
'#callback' => 'uc_discount_condition_node_type',
'#arguments' => array(
'node' => array('#entity' => 'node', '#title' => t('Node')),
),
);
?>
There should be a function called uc_discount_condition_node_type(), but I've grepped for that string recursively in my ubercart directory and apparently it doesn't exist. Also, I don't have the option to specify a node type when configuring this condition. Is some code missing?
Thanks!
Comments
Comment #1
joachim commentedHi Ezra!
Here's a patch.
I have no idea if it works or not, due to #576014: calculate_product_discounts doesn't seem to get called.
Comment #2
joachim commentedIt's working for me now I've fixed #578196: uc_discount_price_handler_alter never has any effect. Obviously it's my own patch so this doesn't count as a review...
Comment #3
joachim commentedActually, shouldn't this be in CA core, so any predicate can use it without this module? Checking on a product node's type strikes me as something lots of predicates might want to check.
Comment #4
jody lynnHere's a reroll without the debug code. It seems to be working fine for me.
Comment #5
joachim commentedI've got commit access to uc_discount now, so I'm happy to commit this (all the more because I'm using the patch on a site of mine...)
But it does seem to me it could belong in CA core...
Can we get a UC maintainer's opinion on this?
Comment #6
joachim commentedHuh.
UC maintainers have pointed out to me that the 'Compare a node field value' condition lets you do this. But they've suggested we add this anyway here, as it's more userfriendly :)
So I've committed the patch, with the whitespace tweaked. Thanks for the reroll Jody :)
#538320 by joachim, Jody Lynn: Fixed missing callback for node type condition.