Skip to content

Commit

Permalink
Ticket #3265 - Different fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonLV committed May 18, 2021
1 parent 9f96f61 commit f7cea74
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions modules/boonex/ads/classes/BxAdsConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* @{
*/

bx_import('BxDolInformer');

class BxAdsConfig extends BxBaseModTextConfig
{
protected $_oDb;
Expand Down
4 changes: 4 additions & 0 deletions modules/boonex/ads/classes/BxAdsDb.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ public function getCategories($aParams = array())
$sWhereClause = " AND `tc`.`parent_id`=:parent_id";
if(isset($aParams['with_content']) && $aParams['with_content'] === true)
$sWhereClause .= " AND `tc`.`items`>0";
if(isset($aParams['active']) && $aParams['active'] === true)
$sWhereClause .= " AND `tc`.`active`=1";
break;

case 'parent_id_count':
Expand All @@ -164,6 +166,8 @@ public function getCategories($aParams = array())

$sSelectClause = "COUNT(`tc`.`id`)";
$sWhereClause = " AND `tc`.`parent_id`=:parent_id";
if(isset($aParams['active']) && $aParams['active'] === true)
$sWhereClause .= " AND `tc`.`active`=1";
break;

case 'parent_id_order':
Expand Down
2 changes: 1 addition & 1 deletion modules/boonex/ads/classes/BxAdsMenuView.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ protected function _isVisible ($a)

$bResult = true;
$this->addMarkers(array(
'add_to_cart_title' => _t('_bx_market_menu_item_title_add_to_cart', $aCurrency['sign'], $this->_aContentInfo[$CNF['FIELD_PRICE']]),
'add_to_cart_title' => _t('_bx_ads_menu_item_title_add_to_cart', $aCurrency['sign'], $this->_aContentInfo[$CNF['FIELD_PRICE']]),
'add_to_cart_onclick' => $sJsMethod
));
break;
Expand Down
2 changes: 1 addition & 1 deletion modules/boonex/ads/classes/BxAdsModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -1230,7 +1230,7 @@ protected function _serviceEntityForm ($sFormMethod, $iContentId = 0, $sDisplay

protected function _getCategoryOptions($iParentId, &$aValues)
{
$aCategories = $this->_oDb->getCategories(array('type' => 'parent_id', 'parent_id' => $iParentId));
$aCategories = $this->_oDb->getCategories(array('type' => 'parent_id', 'parent_id' => $iParentId, 'active' => true));
foreach($aCategories as $aCategory) {
$aValues[] = array('key' => $aCategory['id'], 'value' => str_repeat('--', (int)$aCategory['level']) . ' ' . _t($aCategory['title']));

Expand Down

0 comments on commit f7cea74

Please sign in to comment.