Documentation

Order properties

Getting list of order properties associated to payment system and delivery service:

    $dbRes = \Bitrix\Sale\Property::getList([
    	'select' => ['ID'], 
    	'filter' => [
    		'REL_PS.ENTITY_ID' => 184,
    		'REL_DLV.ENTITY_ID' => 1,
    	],
    	'runtime' => [
    		new \Bitrix\Main\Entity\ReferenceField(
    			'REL_PS',
    			'\Bitrix\Sale\Internals\OrderPropsRelationTable',
    			array("=ref.PROPERTY_ID" => "this.ID", "=ref.ENTITY_TYPE" => new \Bitrix\Main\DB\SqlExpression('?', 'P')),
    			array("join_type"=>"left")
           		),
    		new \Bitrix\Main\Entity\ReferenceField(
    			'REL_DLV',
    			'\Bitrix\Sale\Internals\OrderPropsRelationTable',
    			array("=this.ID" => "ref.PROPERTY_ID", "=ref.ENTITY_TYPE" => new \Bitrix\Main\DB\SqlExpression('?', 'D')),
    			array("join_type"=>"left")
    		),
    	],
    	'group' => ['ID'],
    	'order' => ['ID' => 'DESC']
    ]);
    
    while ($property = $dbRes->fetch())
    {
    	var_dump($property);
    }
    

© «Bitrix24», 2001-2024
Up