This patch forces the module to only show a license once. This means if you assign the same license to several products and the customer puts these products into their basket, they will only see the license checkout once.
--- uc_node_panes.module (revision 18190)
+++ uc_node_panes.module (working copy)
@@ -84,11 +84,15 @@
* returns the content to be displayed as a drupal form or false if conditions are not met
*/
function _uc_node_panes_ucpane($lid) {
+ static $nids = array();
+
$result = db_query("SELECT * FROM {uc_node_panes} WHERE lid = %d", $lid);
$row = null;
$row = db_fetch_array($result);
while ($row) {
- if (_uc_node_panes_checkcart($row['pid'])) {
+ if (_uc_node_panes_checkcart($row['pid']) && !isset($nids[$row['nid']])) {
+ $nids[$row['nid']] = TRUE;
+
$node = node_load($row['nid']);
unset($node->title);
Essentially its using a static array to only allow a license node to appear once.
Comments
Comment #1
nicholas.alipaz commentedI will look into adding this lateron this week. Thanks for the patch.