R
R
Ruslan Absalyamov2018-06-21 11:14:17
1C-Bitrix
Ruslan Absalyamov, 2018-06-21 11:14:17

Why doesn't getList work for me?

Maybe I'm doing something wrong, but it seems to work. I need to display the delivery service by groups
Here is my code

if (in_array($USER::WHOLESALE, $USER->GetUserGroupArray())){
        $groupDelivery = array(9, 11);
    } else {
        $groupDelivery = array(10 , 11);
    }


    $parametr = array(
        'filter' => array(
            'PARENT_ID' => $groupDelivery[0].'&'.$groupDelivery[1],
            )
    );

    $dbResultList = \Bitrix\Sale\Delivery\Services\Table::getList($parametr);
    while($res = $dbResultList->fetch()){
        var_dump($res);
    }

If you take it without parameters
, I get
array (size=14)
  'ID' => string '3' (length=1)
  'CODE' => string '3' (length=1)
  'PARENT_ID' => string '11' (length=2)
  'NAME' => string 'Самовывоз из офиса Риолис в Москве' (length=63)
  'ACTIVE' => string 'Y' (length=1)
  'DESCRIPTION' => string 'Настраиваемая служба доставки для совместимости со старыми службами доставки.' (length=145)
  'SORT' => string '200' (length=3)
  'LOGOTIP' => null
  'CONFIG' => 
    array (size=1)
      'MAIN' => 
        array (size=3)
          'CURRENCY' => string 'RUB' (length=3)
          'PRICE' => string '200' (length=3)
          'PERIOD' => 
            array (size=3)
              ...
  'CLASS_NAME' => string '\Bitrix\Sale\Delivery\Services\Configurable' (length=43)
  'CURRENCY' => string 'RUB' (length=3)
  'TRACKING_PARAMS' => 
    array (size=0)
      empty
  'ALLOW_EDIT_SHIPMENT' => string 'Y' (length=1)
  'VAT_ID' => string '0' (length=1)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Danbka, 2018-06-21
@rusline18

You somehow strangely build a filter:

'filter' => array(
    'PARENT_ID' => $groupDelivery[0].'&'.$groupDelivery[1],
)

Try like this:
'filter' => array(
    'PARENT_ID' => $groupDelivery
)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question