Преглед изворни кода

Ticket #3265 - Hide 'Pay Offer' block if the ad was already purchased.

AntonLV пре 5 година
родитељ
комит
6f8d12dc8d
1 измењених фајлова са 3 додато и 1 уклоњено
  1. 3 1
      modules/boonex/ads/classes/BxAdsModule.php

+ 3 - 1
modules/boonex/ads/classes/BxAdsModule.php

@@ -973,6 +973,8 @@ class BxAdsModule extends BxBaseModTextModule
 
     public function serviceEntityOfferAccepted($iContentId = 0)
     {
+        $CNF = &$this->_oConfig->CNF;
+
         if(!$this->_oConfig->isAuction())
             return '';
 
@@ -982,7 +984,7 @@ class BxAdsModule extends BxBaseModTextModule
             $iContentId = (int)$_iContentId;
 
         $aContent = $this->_oDb->getContentInfoById($iContentId);
-        if(empty($aContent) || !is_array($aContent))
+        if(empty($aContent) || !is_array($aContent) || $aContent[$CNF['FIELD_QUANTITY']] <= 0)
             return '';
 
         $aOffer = $this->_oDb->getOffersBy(array(