Skip to content

Commit

Permalink
#4148 - Build-in API support: Ads
Browse files Browse the repository at this point in the history
  • Loading branch information
romanlesnikov committed Nov 9, 2023
1 parent 5c8f53a commit b5fc289
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions modules/boonex/ads/classes/BxAdsModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,19 @@ function __construct(&$aModule)
BX_ADS_OFFER_STATUS_DECLINED
);
}

public function decodeDataApi ($aData, $bExtended = false)
{
$CNF = $this->_oConfig->CNF;

$aResult = parent::decodeDataApi($aData, $bExtended);

$aResult[$CNF['FIELD_PRICE']] = $aData[$CNF['FIELD_PRICE']];
$aResult[$CNF['FIELD_QUANTITY']] = $aData[$CNF['FIELD_QUANTITY']];
$aResult[$CNF['FIELD_NOTES_PURCHASED']] = $aData[$CNF['FIELD_NOTES_PURCHASED']];

return $aResult;
}

public function actionGetCategoryForm()
{
Expand Down
2 changes: 1 addition & 1 deletion modules/boonex/ads/classes/BxAdsSearchResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function __construct($sMode = '', $aParams = array())
'object_metatags' => $CNF['OBJECT_METATAGS'],
'title' => _t('_bx_ads_page_title_browse'),
'table' => $CNF['TABLE_ENTRIES'],
'ownFields' => array('id', 'title', 'text', 'thumb', 'author', 'added'),
'ownFields' => array('id', 'title', 'text', 'thumb', 'author', 'added', 'price', 'quantity', 'notes_purchased'),
'searchFields' => array(),
'restriction' => array(
'author' => array('value' => '', 'field' => 'author', 'operator' => '='),
Expand Down

0 comments on commit b5fc289

Please sign in to comment.