2021-05-31 16:33:02 +03:00
|
|
|
|
<?php
|
|
|
|
|
/**
|
|
|
|
|
* PHP version 7.1
|
|
|
|
|
*
|
|
|
|
|
* @category Integration
|
|
|
|
|
* @package Intaro\RetailCrm\Model\Bitrix
|
|
|
|
|
* @author RetailCRM <integration@retailcrm.ru>
|
|
|
|
|
* @license MIT
|
|
|
|
|
* @link http://retailcrm.ru
|
|
|
|
|
* @see http://retailcrm.ru/docs
|
|
|
|
|
*/
|
|
|
|
|
namespace Intaro\RetailCrm\Model\Bitrix\Xml;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Class XmlOffer
|
|
|
|
|
* @package Intaro\RetailCrm\Model\Bitrix\Xml
|
|
|
|
|
*/
|
|
|
|
|
class XmlOffer
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* @var int
|
|
|
|
|
*/
|
|
|
|
|
public $id;
|
2021-11-02 11:25:26 +03:00
|
|
|
|
|
2021-05-31 16:33:02 +03:00
|
|
|
|
/**
|
|
|
|
|
* @var int
|
|
|
|
|
*/
|
|
|
|
|
public $productId;
|
2021-11-02 11:25:26 +03:00
|
|
|
|
|
2021-05-31 16:33:02 +03:00
|
|
|
|
/**
|
2024-04-24 09:48:51 +03:00
|
|
|
|
* @var string
|
2021-05-31 16:33:02 +03:00
|
|
|
|
*/
|
|
|
|
|
public $quantity;
|
2021-11-02 11:25:26 +03:00
|
|
|
|
|
2021-05-31 16:33:02 +03:00
|
|
|
|
/**
|
|
|
|
|
* @var string
|
|
|
|
|
*/
|
|
|
|
|
public $picture;
|
2021-11-02 11:25:26 +03:00
|
|
|
|
|
2021-05-31 16:33:02 +03:00
|
|
|
|
/**
|
|
|
|
|
* @var string
|
|
|
|
|
*/
|
|
|
|
|
public $url;
|
2021-11-02 11:25:26 +03:00
|
|
|
|
|
2021-05-31 16:33:02 +03:00
|
|
|
|
/**
|
|
|
|
|
* @var float
|
|
|
|
|
*/
|
|
|
|
|
public $price;
|
2021-11-02 11:25:26 +03:00
|
|
|
|
|
2021-05-31 16:33:02 +03:00
|
|
|
|
/**
|
|
|
|
|
* Категории, к которым относится товар
|
|
|
|
|
*
|
|
|
|
|
* @var array
|
|
|
|
|
*/
|
|
|
|
|
public $categoryIds;
|
2021-11-02 11:25:26 +03:00
|
|
|
|
|
2021-05-31 16:33:02 +03:00
|
|
|
|
/**
|
|
|
|
|
* @var string
|
|
|
|
|
*/
|
|
|
|
|
public $name;
|
2021-11-02 11:25:26 +03:00
|
|
|
|
|
2021-05-31 16:33:02 +03:00
|
|
|
|
/**
|
|
|
|
|
* @var int
|
|
|
|
|
*/
|
|
|
|
|
public $xmlId;
|
2021-11-02 11:25:26 +03:00
|
|
|
|
|
2021-05-31 16:33:02 +03:00
|
|
|
|
/**
|
|
|
|
|
* @var string
|
|
|
|
|
*/
|
|
|
|
|
public $productName;
|
2021-11-02 11:25:26 +03:00
|
|
|
|
|
2021-05-31 16:33:02 +03:00
|
|
|
|
/**
|
|
|
|
|
* @var OfferParam[]
|
|
|
|
|
*/
|
|
|
|
|
public $params;
|
2021-11-02 11:25:26 +03:00
|
|
|
|
|
2021-05-31 16:33:02 +03:00
|
|
|
|
/**
|
|
|
|
|
* @var string
|
|
|
|
|
*/
|
|
|
|
|
public $vendor;
|
2021-11-02 11:25:26 +03:00
|
|
|
|
|
2021-05-31 16:33:02 +03:00
|
|
|
|
/**
|
|
|
|
|
* @var Unit
|
|
|
|
|
*/
|
|
|
|
|
public $unitCode;
|
2021-11-02 11:25:26 +03:00
|
|
|
|
|
2021-05-31 16:33:02 +03:00
|
|
|
|
/**
|
|
|
|
|
* ставка налога (НДС)
|
|
|
|
|
*
|
|
|
|
|
* @var string
|
|
|
|
|
*/
|
|
|
|
|
public $vatRate;
|
2021-11-02 11:25:26 +03:00
|
|
|
|
|
2021-05-31 16:33:02 +03:00
|
|
|
|
/**
|
|
|
|
|
* штрих-код
|
|
|
|
|
*
|
|
|
|
|
* @var string
|
|
|
|
|
*/
|
|
|
|
|
public $barcode;
|
2021-11-02 11:25:26 +03:00
|
|
|
|
|
2021-05-31 16:33:02 +03:00
|
|
|
|
/**
|
|
|
|
|
* Закупочная цена
|
|
|
|
|
*
|
|
|
|
|
* @var mixed|null
|
|
|
|
|
*/
|
|
|
|
|
public $purchasePrice;
|
2021-11-02 11:25:26 +03:00
|
|
|
|
|
2021-05-31 16:33:02 +03:00
|
|
|
|
/**
|
|
|
|
|
* Вес товара
|
|
|
|
|
*
|
|
|
|
|
* @var int
|
|
|
|
|
*/
|
|
|
|
|
public $weight;
|
2021-11-02 11:25:26 +03:00
|
|
|
|
|
2021-05-31 16:33:02 +03:00
|
|
|
|
/**
|
|
|
|
|
* Габариты товара
|
|
|
|
|
*
|
|
|
|
|
* @var string
|
|
|
|
|
*/
|
|
|
|
|
public $dimensions;
|
2021-11-02 11:25:26 +03:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Тип каталога
|
|
|
|
|
* \Bitrix\Catalog\ProductTable::TYPE_PRODUCT - простой товар
|
|
|
|
|
* \Bitrix\Catalog\ProductTable::TYPE_SKU – товар с торговыми предложениями
|
|
|
|
|
* \Bitrix\Catalog\ProductTable::TYPE_OFFER – торговое предложение
|
|
|
|
|
*
|
2022-02-04 15:16:14 +03:00
|
|
|
|
* @var int
|
2021-11-02 11:25:26 +03:00
|
|
|
|
*/
|
|
|
|
|
public $productType;
|
|
|
|
|
|
2023-04-13 13:50:18 +03:00
|
|
|
|
/**
|
|
|
|
|
* Активность товара/торгового предложения (N|Y)
|
|
|
|
|
*
|
|
|
|
|
* @var string
|
|
|
|
|
*/
|
|
|
|
|
public $activity;
|
|
|
|
|
|
2024-04-24 09:48:51 +03:00
|
|
|
|
/**
|
|
|
|
|
* Признак активности товара при наличии торговых предложений
|
|
|
|
|
* @var string | null
|
|
|
|
|
*/
|
|
|
|
|
public ?string $activityProduct = null;
|
|
|
|
|
|
2021-05-31 16:33:02 +03:00
|
|
|
|
/**
|
|
|
|
|
* @param $productValue
|
|
|
|
|
* @param $offerValue
|
|
|
|
|
* @return mixed
|
|
|
|
|
*/
|
|
|
|
|
public function mergeValues($productValue, $offerValue)
|
|
|
|
|
{
|
|
|
|
|
return empty($offerValue) ? $productValue : $offerValue;
|
|
|
|
|
}
|
|
|
|
|
}
|