Дмитрий

Дмитрий

С нами с 19 октября 2015; Место в рейтинге пользователей: #639
Дмитрий
05 апреля 2022, 18:30
0
Кстати об обновлениях! На носу MODx 3. Работать будет? У вас последнее обновление было 4 года назад (15.03.2018)!!!
Дмитрий
19 ноября 2020, 11:22
0
Спасибо! Часто требуется сделать две цены (розница/опт). Раньше делал это ручками!))
Дмитрий
09 июля 2020, 17:06
0


Такая ошибка возникает при загрузке картинки через поиск google.

А при загрузке PNG с прозрачностью фон загружает черный, но в настройках источников файлов стоит белый («bg»:«ffffff»). Почему так?
Дмитрий
14 апреля 2020, 00:44
2
+3
REST API в 1С УНФ 1.6 пример получения остатков
<?php
$url = "https://XXX.XXX.XXX.XXX/SmallBusiness/odata/standard.odata/AccumulationRegister_ЗапасыНаСкладах/Balance?&%24select=Номенклатура_Key,СтруктурнаяЕдиница_Key,КоличествоBalance&%24format=json;odata=nometadata";

$ch = curl_init($url); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_USERPWD, "odata.user:xxxxxxxxxxxxxxxxxxxxxxxx");
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Accept: application/json'));
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");

$json = curl_exec($ch);
$err_status = curl_error($ch);
echo ("<pre>");
echo $err_status;
echo ("</pre>");
curl_close($ch);

$json = json_decode($json, true);

?>
Описание товара:
$url="https://192.168.1.52/SmallBusiness/odata/standard.odata/";
$url .= "Catalog_Номенклатура?%24filter=like(Description,'ИСКОМОЕ НАЗВАНИЕ')&%24select=*&%24top=10&%24format=json;odata=nometadata";
Ну и так далее. Работает быстро.
mSync теперь только заказы с сайта выгружает.
Дмитрий
30 мая 2018, 22:03
0
'OR:class_key:IN' => array('TicketsSection','Ticket','msCategory','msProduct','modDocument'),
Дмитрий
01 июля 2016, 15:18
0
SKU (stock keeping unit) — единица складской наличности.
Дмитрий
01 июля 2016, 15:17
0
SKU (stock keeping unit) — единица складской наличности. Фактически — это ассортиментная позиция.
Дмитрий
12 апреля 2016, 03:09
0
Вообщем сам решил задачу.
1. Идем в настройки импорта mSync. Создаем или обновляем «Цена» или «Розничная цена» (у меня розничная) и устанавливаем тип поля -> msProduct и цель -> currency of price.
2. Еще создаем настройки импорта с источниками USD, EUR, руб типом msProduct и соответствующими целями price_usd, price_euro, price.

3. В файле core/components/msklad/model/msklad/mskladcataloghandler.class.php заменяем
//update price
$selectedPrice=0;
if($this->config['import_all_prices']){
	//Импортируем цены согласно связям
	$c=0;
	foreach($xml->Цены->Цена as $price){
		$priceTypeId = addslashes((string) $price->ИдТипаЦены);
		$priceTypeName='';
		if(isset($_SESSION['price_mapping'][$priceTypeId])) $priceTypeName = $_SESSION['price_mapping'][$priceTypeId];
		if(!empty($priceTypeName)){
			if(!isset($this->properties[$priceTypeName])) continue;
			$priceSum = addslashes((string) $price->ЦенаЗаЕдиницу);
			if($c==0) $selectedPrice=$priceSum;

			if($this->properties[$priceTypeName]['type']==1){
				$processorProps = array(
					'id'=>$product_id
					,'class_key' => 'msProduct'
					,'context_key' => $this->config['catalog_context']
				);
				$processorProps[$this->properties[$priceTypeName]['target']] = $priceSum;
				$this->modx->runProcessor('mgr/extend/updatemsproduct', $processorProps, array('processors_path'=>$this->config['processorsPath']));
			}
			elseif($this->properties[$priceTypeName]['type']==2){
				$product->setTVValue($this->properties[$priceTypeName]['target'], $priceSum);
			}
		}
		++$c;
	}
}


на вот это
//update price
$selectedPrice=0;
if($this->config['import_all_prices']){
	//Импортируем цены согласно связям
	$c=0;
	foreach($xml->Цены->Цена as $price){
		
		$priceTypeId = addslashes((string) $price->ИдТипаЦены);
		$priceTypeName='';
		if(isset($_SESSION['price_mapping'][$priceTypeId])) $priceTypeName = $_SESSION['price_mapping'][$priceTypeId];
		if(!empty($priceTypeName) AND $this->properties[$priceTypeName]['target'] = 'currency of price'){
			if(!isset($this->properties[$priceTypeName])) continue;
			$priceTypeName = addslashes((string) $price->Валюта);
			$priceSum = addslashes((string) $price->ЦенаЗаЕдиницу);
			if($c==0) $selectedPrice=$priceSum;

			if($this->properties[$priceTypeName]['type']==1){
				$processorProps = array(
					'id'=>$product_id
					,'class_key' => 'msProduct'
					,'context_key' => $this->config['catalog_context']
				);
				$processorProps[$this->properties[$priceTypeName]['target']] = $priceSum;
				$this->modx->runProcessor('mgr/extend/updatemsproduct', $processorProps, array('processors_path'=>$this->config['processorsPath']));
			}
			elseif($this->properties[$priceTypeName]['type']==2){
				$product->setTVValue($this->properties[$priceTypeName]['target'], $priceSum);
			}
		}
		if(!empty($priceTypeName) AND $this->properties[$priceTypeName]['target'] != 'currency of price'){
			if(!isset($this->properties[$priceTypeName])) continue;
			$priceSum = addslashes((string) $price->ЦенаЗаЕдиницу);
			if($c==0) $selectedPrice=$priceSum;

			if($this->properties[$priceTypeName]['type']==1){
				$processorProps = array(
					'id'=>$product_id
					,'class_key' => 'msProduct'
					,'context_key' => $this->config['catalog_context']
				);
				$processorProps[$this->properties[$priceTypeName]['target']] = $priceSum;
				$this->modx->runProcessor('mgr/extend/updatemsproduct', $processorProps, array('processors_path'=>$this->config['processorsPath']));
			}
			elseif($this->properties[$priceTypeName]['type']==2){
				$product->setTVValue($this->properties[$priceTypeName]['target'], $priceSum);
			}
		}
		++$c;
	}
}
У меня в настройках mSync стоит «импортировать все цены» (msklad_import_all_prices).
Дмитрий
11 апреля 2016, 21:20
0
В minishop2 сделано "Расширение модели товара".
У товара может быть 3 цены:
price
price_usd
price_euro
Соответственно в 1С есть цены в рублях и валюте.
<Предложение>
	<Ид>9bf7a895-0073-11e5-bef5-28924a4fd90c</Ид>
	<Наименование>CAV-72B</Наименование>
	<БазоваяЕдиница Код="796 " НаименованиеПолное="Штука">шт</БазоваяЕдиница>
	<Цены>
		<Цена>
			<Представление>321,76 USD за шт</Представление>
			<ИдТипаЦены>6fb11424-230c-11e1-8558-00252271fc01</ИдТипаЦены>
			<ЦенаЗаЕдиницу>321.76</ЦенаЗаЕдиницу>
			<Валюта>USD</Валюта>
			<Единица>шт</Единица>
			<Коэффициент>1</Коэффициент>
		</Цена>
	</Цены>
</Предложение>
Насколько я понимаю мне нужно создать плагин на одно из событий mskladOnProductImport или mskladOnProductOffers.
Пожалуйста дайте пример, где отловить <Валюта>USD</Валюта> и перенаправить price в msProductData price_usd.
Ну или хотя бы, как получить список свойств $properties и $resource?
Дмитрий
31 октября 2015, 22:32
0
[[!msGallery?  
    &product=`[[*id]]`
    &showLog=`1`
    ]]
0.0001950: Added where condition: product_id=5131, parent=0
5131 это не id, а sku_id который выставлен по умолчанию, но картинок для него нет. Да и картинки по умолчанию в админке не отображаются.
Дмитрий
31 октября 2015, 22:14
0
Присоединяюсь. На стр. товара попробовал вызывать
[[!msGallery?  &where=`{'Data.default':1}`]]
Could not process query, error #1054: Unknown column 'Data.default' in 'where clause'
Но не помогло. Видимо этого не достаточно.
Дмитрий
19 октября 2015, 02:25
0
На главной store-F:
<meta property="og:url" content="http://store-f.devdevel.net/http://store-f.devdevel.net/">
<link rel="next" href="?page=2">
Дальше смотреть не стал. Последнее минус по SEO.