do not try to affect NULL prices

joachim - October 16, 2009 - 12:22
Project:UC Discount Framework
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

Dicsount module doesn't work with my uc_notforsale:

I have this alterer in uc_notforsale:

function uc_notforsale_price_handler_alter(&$price, &$context, &$options) {
  //dsm($price);
  //dsm($context);
  //dsm($options);
  if (isset($context['subject']) && isset($context['subject']['node'])) {
    if (_uc_notforsale_isnotforsale($context['subject']['node']->nid)) {
      //dsm('not for sale');
      $price['price'] = NULL;
      $options['label'] = FALSE;
    }
  }

Then in the price display I don't show a price if it is NULL.
(This is a hack, IMO -- UC core shouldn't try to show a null price.)

However, uc Discount deducts its discount, and a negative price is shown.

More generally, don't create negative prices, perhaps?

 
 

Drupal is a registered trademark of Dries Buytaert.